text:
Q: Issues running a Keras model with custom layers I am currently working on my bachelor's thesis at FIIT STU, the primary goal of which is to attempt to replicate and verify the results of the following study. The authors of this study use a fake news detection model of their own design. I managed to find the code on GitHub: https://github.com/cuilimeng/dEFEND-web.
They use the following dataset, also on GitHub: https://github.com/cuilimeng/CoAID. The data features news articles from the first couple of months of the covid-19 pandemic and IDs of tweets that comment on those articles. I retrieved the tweets from Twitter api, but per their user agreement (or whatever the correct term for that is), I cannot share the contents.
The linked code for the model features a web app in "application.py" and the model itself in "defend.py". The web app doesn't really matter for me, with the latter being the important file.
Here are the classes and methods I have been trying to use, and have issues with: (note, I have played around with the code a bit, so there might be slight differences in prints and other non-essential lines, as compared to the original on GitHub)
    def train(self, train_x, train_y, train_c, val_c, val_x, val_y,
              batch_size=20, epochs=10,
              embeddings_path=False,
              saved_model_dir='saved_models', saved_model_filename=None, ):
        # Fit the vocabulary set on the content and comments
        self._fit_on_texts_and_comments(train_x, train_c, val_x, val_c)
        self.model = self._build_model(
            n_classes=train_y.shape[-1],
            embedding_dim=100,
            embeddings_path=embeddings_path)

        # Create encoded input for content and comments
        encoded_train_x = self._encode_texts(train_x)
        encoded_val_x = self._encode_texts(val_x)
        encoded_train_c = self._encode_comments(train_c)
        encoded_val_c = self._encode_comments(val_c)
        callbacks = [
            LambdaCallback(
                on_epoch_end=lambda epoch, logs: self._save_tokenizer_on_epoch_end(
                    os.path.join(saved_model_dir,
                                 self._get_tokenizer_filename(saved_model_filename)), epoch))
        ]

        if saved_model_filename:
            callbacks.append(
                ModelCheckpoint(
                    filepath=os.path.join(saved_model_dir, saved_model_filename),
                    monitor='val_loss',
                    save_best_only=True,
                    save_weights_only=False,
                )
            )
        callbacks.append(self.metrics)

        # """
        print("Input shapes for fit:")
        print(encoded_train_c.shape)
        print(encoded_train_x.shape)
        print(train_y.shape)
        print(encoded_val_c.shape)
        print(encoded_val_x.shape)
        print(val_y.shape)
        # """

        self.model.fit([encoded_train_c, encoded_train_x], y=train_y,
                       validation_data=([encoded_val_c, encoded_val_x], val_y),
                       batch_size=batch_size,
                       epochs=epochs,
                       verbose=1,
                       callbacks=callbacks)

Of particular importance is this bit of code here:
self.model = self._build_model(
            n_classes=train_y.shape[-1],
            embedding_dim=100,
            embeddings_path=embeddings_path)

This is the method it calls:
    def _build_model(self, n_classes=2, embedding_dim=100, embeddings_path=False, aff_dim=80):
        GLOVE_DIR = "."
        embeddings_index = {}
        f = open(os.path.join('./', 'glove.6B.100d.txt'))
        for line in f:
            values = line.split()
            word = values[0]
            coefs = np.asarray(values[1:], dtype='float32')
            embeddings_index[word] = coefs
        f.close()
        word_index = self.tokenizer.word_index
        embedding_matrix = np.random.random((len(word_index) + 1, embedding_dim))
        for word, i in word_index.items():
            embedding_vector = embeddings_index.get(word)
            if embedding_vector is not None:
                embedding_matrix[i] = embedding_vector

        # embeddings_initializer = initializers.Constant(embedding_matrix),
        embedding_layer = Embedding(len(word_index) + 1,
                                    embedding_dim,
                                    weights=[embedding_matrix],
                                    input_length=self.MAX_SENTENCE_LENGTH,
                                    trainable=True,
                                    mask_zero=True)

        com_embedding_layer = Embedding(len(word_index) + 1,
                                        embedding_dim,
                                        weights=[embedding_matrix],
                                        input_length=self.MAX_COMS_LENGTH,
                                        trainable=True,
                                        mask_zero=True)

        sentence_input = Input(shape=(self.MAX_SENTENCE_LENGTH,), dtype='int32')
        embedded_sequences = embedding_layer(sentence_input)
        l_lstm = Bidirectional(GRU(100, return_sequences=True), name='word_lstm')(embedded_sequences)
        l_att = AttLayer(name='word_attention')(l_lstm)
        sentEncoder = Model(sentence_input, l_att)
        plot_model(sentEncoder, to_file='model_images/SentenceEncoder.png', show_shapes=True)

        self.news_content_word_level_encoder = sentEncoder
        self.news_content_word_level_encoder.summary()

        content_input = Input(shape=(self.MAX_SENTENCE_COUNT, self.MAX_SENTENCE_LENGTH), dtype='int32')
        print(f"content_input shape: {content_input.shape}")
        content_encoder = TimeDistributed(sentEncoder)(content_input)
        print(f"content_encoder shape: {content_encoder.shape}")
        l_lstm_sent = Bidirectional(GRU(100, return_sequences=True), name='sentence_lstm')(content_encoder)
        content_encoder = Model(content_input, l_lstm_sent)
        plot_model(content_encoder, to_file='model_images/ContentEncoder.png', show_shapes=True)

        self.news_content_sentence_level_encoder = content_encoder
        self.news_content_sentence_level_encoder.summary()

        # learn comments representations
        comment_input = Input(shape=(self.MAX_COMS_LENGTH,), dtype='int32')
        com_embedded_sequences = com_embedding_layer(comment_input)
        c_lstm = Bidirectional(GRU(100, return_sequences=True), name='comment_lstm')(com_embedded_sequences)
        c_att = AttLayer(name='comment_word_attention')(c_lstm)
        comEncoder = Model(comment_input, c_att, name='comment_word_level_encoder')
        plot_model(comEncoder, to_file='model_images/CommentEncoder.png', show_shapes=True)

        self.comment_word_level_encoder = comEncoder
        self.comment_word_level_encoder.summary()

        all_comment_input = Input(shape=(self.MAX_COMS_COUNT, self.MAX_COMS_LENGTH), dtype='int32')
        all_comment_encoder = TimeDistributed(comEncoder, name='comment_sequence_encoder')(all_comment_input)
        allComEncoder = Model(all_comment_input, all_comment_encoder)
        plot_model(allComEncoder, to_file='model_images/AllCommentEncoder.png', show_shapes=True)

        self.comment_sequence_encoder = allComEncoder
        self.comment_sequence_encoder.summary()

        # Co-attention

        L = LLayer(name="co-attention")([all_comment_encoder, l_lstm_sent])
        L_Model = Model([all_comment_input, content_input], L)

        self.co_attention_model = L_Model
        self.co_attention_model.summary()

        plot_model(L_Model, to_file='model_images/l_representation.png', show_shapes=True)

        preds = Dense(2, activation='softmax')(L)
        model = Model(inputs=[all_comment_input, content_input], outputs=preds)
        model.summary()
        plot_model(model, to_file='model_images/CHATT.png', show_shapes=True)

        optimize = RMSprop(lr=0.001)
        model.compile(loss='categorical_crossentropy',
                      optimizer=optimize)

        return model

The _build_model() method uses two custom layers:
class AttLayer(Layer):
    """
    Attention layer used for the calculating attention in word and sentence levels
    """

    def __init__(self, **kwargs):
        super(AttLayer, self).__init__(**kwargs)
        self.init = initializers.get('normal')
        self.supports_masking = True
        self.attention_dim = 100

    def build(self, input_shape):
        assert len(input_shape) == 3
        self.W = K.variable(self.init((input_shape[-1], self.attention_dim)))
        self.b = K.variable(self.init((self.attention_dim,)))
        self.u = K.variable(self.init((self.attention_dim, 1)))
        self._trainable_weights = [self.W, self.b, self.u]
        super(AttLayer, self).build(input_shape)

    def compute_mask(self, inputs, mask=None):
        return mask

    def call(self, x, mask=None):
        # size of x :[batch_size, sel_len, attention_dim]
        # size of u :[batch_size, attention_dim]
        # uit = tanh(xW+b)
        uit = K.tanh(K.bias_add(K.dot(x, self.W), self.b))
        ait = K.dot(uit, self.u)
        ait = K.squeeze(ait, -1)
        ait = K.exp(ait)
        if mask is not None:
            # Cast the mask to floatX to avoid float64 upcasting in theano
            ait *= K.cast(mask, K.floatx())
        print(ait)
        ait /= K.cast(K.sum(ait, axis=1, keepdims=True) + K.epsilon(), K.floatx())
        ait = K.expand_dims(ait)
        weighted_input = x * ait
        output = K.sum(weighted_input, axis=1)

        return output

    def compute_output_shape(self, input_shape):
        return input_shape[0], input_shape[-1]

and
class LLayer(Layer):
    """
    Co-attention layer which accepts content and comment states and computes co-attention between them and returns the
     the weighted sum of the content and the comment states
    """

    def __init__(self, **kwargs):
        self.init = initializers.get('normal')
        self.latent_dim = 200
        self.k = 80
        super(LLayer, self).__init__(**kwargs)

    def build(self, input_shape, mask=None):
        self.Wl = K.variable(self.init((self.latent_dim, self.latent_dim)))

        self.Wc = K.variable(self.init((self.k, self.latent_dim)))
        self.Ws = K.variable(self.init((self.k, self.latent_dim)))

        self.whs = K.variable(self.init((1, self.k)))
        self.whc = K.variable(self.init((1, self.k)))
        self._trainable_weights = [self.Wl, self.Wc, self.Ws, self.whs, self.whc]

    def compute_mask(self, inputs, mask=None):
        return mask

    def call(self, x, mask=None):
        comment_rep = x[0]
        sentence_rep = x[1]
        sentence_rep_trans = K.permute_dimensions(sentence_rep, (0, 2, 1))
        comment_rep_trans = K.permute_dimensions(comment_rep, (0, 2, 1))
        L = K.tanh(tf.einsum('btd,dD,bDn->btn', comment_rep, self.Wl, sentence_rep_trans))
        L_trans = K.permute_dimensions(L, (0, 2, 1))

        Hs = K.tanh(tf.einsum('kd,bdn->bkn', self.Ws, sentence_rep_trans) + tf.einsum('kd,bdt,btn->bkn', self.Wc,
                                                                                comment_rep_trans, L))
        Hc = K.tanh(tf.einsum('kd,bdt->bkt', self.Wc, comment_rep_trans) + tf.einsum('kd,bdn,bnt->bkt', self.Ws,
                                                                                sentence_rep_trans, L_trans))
        As = K.softmax(tf.einsum('yk,bkn->bn', self.whs, Hs))
        Ac = K.softmax(tf.einsum('yk,bkt->bt', self.whc, Hc))
        co_s = tf.einsum('bdn,bn->bd', sentence_rep_trans, As)
        co_c = tf.einsum('bdt,bt->bd', comment_rep_trans, Ac)
        co_sc = K.concatenate([co_s, co_c], axis=1)

        return co_sc

    def compute_output_shape(self, input_shape):
        return input_shape[0][0], self.latent_dim + self.latent_dim

The last bit of code that I think is important is a custom callback:
class Metrics(Callback):
    def __init__(self, platform):
        self.log_file = open('./Log_Defend_' + platform + '.txt', 'a')

    def on_train_begin(self, logs={}):
        self.val_f1s = []
        self.val_recalls = []
        self.val_precisions = []
        self.val_auc = []
        self.val_acc = []

    def on_epoch_end(self, epoch, logs={}):
        val_predict_onehot = (
            np.asarray(self.model.predict([self.validation_data[0], self.validation_data[1]]))).round()
        val_targ_onehot = self.validation_data[2]
        val_predict = np.argmax(val_predict_onehot, axis=1)
        val_targ = np.argmax(val_targ_onehot, axis=1)
        _val_f1 = f1_score(val_targ, val_predict)
        _val_recall = recall_score(val_targ, val_predict)
        _val_precision = precision_score(val_targ, val_predict)
        _val_auc = roc_auc_score(val_targ, val_predict)
        _val_acc = accuracy_score(val_targ, val_predict)
        self.val_f1s.append(_val_f1)
        self.val_recalls.append(_val_recall)
        self.val_precisions.append(_val_precision)
        self.val_auc.append(_val_auc)
        self.val_acc.append(_val_acc)
        print("Epoch: %d - val_accuracy: % f - val_precision: % f - val_recall % f val_f1: %f auc: %f" % (
            epoch, _val_acc, _val_precision, _val_recall, _val_f1, _val_auc))
        self.log_file.write(
            "Epoch: %d - val_accuracy: % f - val_precision: % f - val_recall % f val_f1: %f auc: %f\n" % (epoch,
                                                                                _val_acc,
                                                                                _val_precision,
                                                                                _val_recall,
                                                                                _val_f1,
                                                                                _val_auc))
        return

As best I could figure out, the model uses glove word embeddings with dim=100, and the shapes for model.fit are the following:
(948, 150, 120)
(948, 50, 120)
(948, 2)
(411, 150, 120)
(411, 50, 120)
(411, 2)
where 120 is the maximum number of words in a sentence, (missing words are set to 0), 150 is the number of tweets per article, 50 is the number of sentences per article, and 2 is a target value pair for the dense layer with 2 output nodes (I am not exactly sure why the authors use 2 output nodes, but I didn't want to mess with their code too much and so I tried to adjust the data to fit)
The model should look something like this:

The time distributed wrapper on the left contains this model:

And the one on the right contains this:

Now we can get to the issues:
When I tried running the code on python 3.6 with the requirements per the requirements.txt file from teh model, that is on tensorflow 1.13, the model seemed to build correctly, and I got the following error during fit:
WARNING:tensorflow:From C:\Users\vikio\PycharmProjects\Bakalarka\venv36\lib\site-packages\tensorflow\python\ops\math_ops.py:3066: to_int32 (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.cast instead.
Train on 948 samples, validate on 411 samples
Epoch 1/10
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "C:\Users\vikio\AppData\Local\JetBrains\Toolbox\apps\PyCharm-P\ch-0\211.7142.13\plugins\python\helpers\pydev\_pydev_bundle\pydev_umd.py", line 197, in runfile
    pydev_imports.execfile(filename, global_vars, local_vars)  # execute the script
  File "C:\Users\vikio\AppData\Local\JetBrains\Toolbox\apps\PyCharm-P\ch-0\211.7142.13\plugins\python\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "C:/Users/vikio/PycharmProjects/Bakalarka/dEFEND-web-master/defend_test.py", line 42, in <module>
    saved_model_filename='covid')
  File "C:\Users\vikio\PycharmProjects\Bakalarka\dEFEND-web-master\defend.py", line 420, in train
    callbacks=callbacks)
  File "C:\Users\vikio\PycharmProjects\Bakalarka\venv36\lib\site-packages\keras\engine\training.py", line 1039, in fit
    validation_steps=validation_steps)
  File "C:\Users\vikio\PycharmProjects\Bakalarka\venv36\lib\site-packages\keras\engine\training_arrays.py", line 199, in fit_loop
    outs = f(ins_batch)
  File "C:\Users\vikio\PycharmProjects\Bakalarka\venv36\lib\site-packages\keras\backend\tensorflow_backend.py", line 2715, in __call__
    return self._call(inputs)
  File "C:\Users\vikio\PycharmProjects\Bakalarka\venv36\lib\site-packages\keras\backend\tensorflow_backend.py", line 2675, in _call
    fetched = self._callable_fn(*array_vals)
  File "C:\Users\vikio\PycharmProjects\Bakalarka\venv36\lib\site-packages\tensorflow\python\client\session.py", line 1439, in __call__
    run_metadata_ptr)
  File "C:\Users\vikio\PycharmProjects\Bakalarka\venv36\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 528, in __exit__
    c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.InvalidArgumentError: Inputs to operation sentence_lstm/while_1/Select_1 of type Select must have the same size and shape.  Input 0: [20,12000] != input 1: [20,100]
     [[{{node sentence_lstm/while_1/Select_1}}]]

As best I can figure out, the issue seems to be caused be the custom AttLayer, but I honestly have no idea.
I also tried running the code on python 3.8 and tensorflow 2, with the following issues, one of which seems to also relate to the same custom layer:
Traceback (most recent call last):
  File "C:\Users\vikio\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\framework\ops.py", line 1853, in _create_c_op
    c_op = pywrap_tf_session.TF_FinishOperation(op_desc)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Dimensions must be equal, but are 120 and 100 for '{{node while/SelectV2}} = SelectV2[T=DT_FLOAT](while/Tile, while/add_3, while/SelectV2/zeros_like)' with input shapes: [?,120], [?,100], [?,100].
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "C:\Users\vikio\AppData\Local\Programs\Python\Python38\lib\site-packages\IPython\core\interactiveshell.py", line 3437, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-2-7e73ed9a0d40>", line 1, in <module>
    runfile('C:/Users/vikio/PycharmProjects/Bakalarka/dEFEND-web-master/defend_test.py', wdir='C:/Users/vikio/PycharmProjects/Bakalarka/dEFEND-web-master')
  File "C:\Users\vikio\AppData\Local\JetBrains\Toolbox\apps\PyCharm-P\ch-0\211.7142.13\plugins\python\helpers\pydev\_pydev_bundle\pydev_umd.py", line 197, in runfile
    pydev_imports.execfile(filename, global_vars, local_vars)  # execute the script
  File "C:\Users\vikio\AppData\Local\JetBrains\Toolbox\apps\PyCharm-P\ch-0\211.7142.13\plugins\python\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "C:/Users/vikio/PycharmProjects/Bakalarka/dEFEND-web-master/defend_test.py", line 40, in <module>
    h.train(x_train, y_train, t_train,
  File "C:\Users\vikio\PycharmProjects\Bakalarka\dEFEND-web-master\defend.py", line 377, in train
    self.model = self._build_model(
  File "C:\Users\vikio\PycharmProjects\Bakalarka\dEFEND-web-master\defend.py", line 234, in _build_model
    l_lstm_sent = Bidirectional(GRU(100, return_sequences=True), name='sentence_lstm')(content_encoder)
  File "C:\Users\vikio\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\keras\layers\wrappers.py", line 539, in __call__
    return super(Bidirectional, self).__call__(inputs, **kwargs)
  File "C:\Users\vikio\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\keras\engine\base_layer.py", line 951, in __call__
    return self._functional_construction_call(inputs, args, kwargs,
  File "C:\Users\vikio\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\keras\engine\base_layer.py", line 1090, in _functional_construction_call
    outputs = self._keras_tensor_symbolic_call(
  File "C:\Users\vikio\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\keras\engine\base_layer.py", line 822, in _keras_tensor_symbolic_call
    return self._infer_output_signature(inputs, args, kwargs, input_masks)
  File "C:\Users\vikio\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\keras\engine\base_layer.py", line 863, in _infer_output_signature
    outputs = call_fn(inputs, *args, **kwargs)
  File "C:\Users\vikio\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\keras\layers\wrappers.py", line 652, in call
    y = self.forward_layer(forward_inputs,
  File "C:\Users\vikio\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\keras\layers\recurrent.py", line 660, in __call__
    return super(RNN, self).__call__(inputs, **kwargs)
  File "C:\Users\vikio\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\keras\engine\base_layer.py", line 1012, in __call__
    outputs = call_fn(inputs, *args, **kwargs)
  File "C:\Users\vikio\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\keras\layers\recurrent_v2.py", line 470, in call
    last_output, outputs, runtime, states = self._defun_gru_call(
  File "C:\Users\vikio\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\keras\layers\recurrent_v2.py", line 546, in _defun_gru_call
    last_output, outputs, new_h, runtime = gru_with_backend_selection(
  File "C:\Users\vikio\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\keras\layers\recurrent_v2.py", line 841, in gru_with_backend_selection
    last_output, outputs, new_h, runtime = defun_standard_gru(**params)
  File "C:\Users\vikio\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\eager\function.py", line 2941, in __call__
    filtered_flat_args) = self._maybe_define_function(args, kwargs)
  File "C:\Users\vikio\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\eager\function.py", line 3361, in _maybe_define_function
    graph_function = self._create_graph_function(args, kwargs)
  File "C:\Users\vikio\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\eager\function.py", line 3196, in _create_graph_function
    func_graph_module.func_graph_from_py_func(
  File "C:\Users\vikio\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\framework\func_graph.py", line 990, in func_graph_from_py_func
    func_outputs = python_func(*func_args, **func_kwargs)
  File "C:\Users\vikio\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\keras\layers\recurrent_v2.py", line 621, in standard_gru
    last_output, outputs, new_states = K.rnn(
  File "C:\Users\vikio\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\util\dispatch.py", line 201, in wrapper
    return target(*args, **kwargs)
  File "C:\Users\vikio\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\keras\backend.py", line 4459, in rnn
    final_outputs = control_flow_ops.while_loop(
  File "C:\Users\vikio\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\ops\control_flow_ops.py", line 2687, in while_loop
    return while_v2.while_loop(
  File "C:\Users\vikio\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\ops\while_v2.py", line 192, in while_loop
    body_graph = func_graph_module.func_graph_from_py_func(
  File "C:\Users\vikio\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\framework\func_graph.py", line 990, in func_graph_from_py_func
    func_outputs = python_func(*func_args, **func_kwargs)
  File "C:\Users\vikio\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\ops\while_v2.py", line 178, in wrapped_body
    outputs = body(*_pack_sequence_as(orig_loop_vars, args))
  File "C:\Users\vikio\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\keras\backend.py", line 4440, in _step
    flat_new_output = compute_masked_output(mask_t, flat_output,
  File "C:\Users\vikio\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\keras\backend.py", line 4391, in compute_masked_output
    return tuple(
  File "C:\Users\vikio\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\keras\backend.py", line 4392, in <genexpr>
    array_ops.where_v2(m, o, fm)
  File "C:\Users\vikio\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\util\dispatch.py", line 201, in wrapper
    return target(*args, **kwargs)
  File "C:\Users\vikio\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\ops\array_ops.py", line 4598, in where_v2
    return gen_math_ops.select_v2(condition=condition, t=x, e=y, name=name)
  File "C:\Users\vikio\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\ops\gen_math_ops.py", line 8742, in select_v2
    _, _, _op, _outputs = _op_def_library._apply_op_helper(
  File "C:\Users\vikio\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 748, in _apply_op_helper
    op = g._create_op_internal(op_type_name, inputs, dtypes=None,
  File "C:\Users\vikio\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\framework\func_graph.py", line 590, in _create_op_internal
    return super(FuncGraph, self)._create_op_internal(  # pylint: disable=protected-access
  File "C:\Users\vikio\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\framework\ops.py", line 3528, in _create_op_internal
    ret = Operation(
  File "C:\Users\vikio\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\framework\ops.py", line 2015, in __init__
    self._c_op = _create_c_op(self._graph, node_def, inputs,
  File "C:\Users\vikio\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\framework\ops.py", line 1856, in _create_c_op
    raise ValueError(str(e))
ValueError: Dimensions must be equal, but are 120 and 100 for '{{node while/SelectV2}} = SelectV2[T=DT_FLOAT](while/Tile, while/add_3, while/SelectV2/zeros_like)' with input shapes: [?,120], [?,100], [?,100].

It fails on this line of code
l_lstm_sent = Bidirectional(GRU(100, return_sequences=True), name='sentence_lstm')(content_encoder)

so I believe it is also caused by the previous layer, which is a timedistributed wrapper of the model ending with the custom AttLayer.
Any help is appreciated!


text:
#pragma once
#include <aws/sagemaker/SageMaker_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/sagemaker/model/VpcConfig.h>
#include <utility>

namespace Aws
{
namespace Utils
{
namespace Json
{
  class JsonValue;
  class JsonView;
} // namespace Json
} // namespace Utils
namespace SageMaker
{
namespace Model
{

  /**
   *
Configure encryption on the storage volume attached to the ML compute
   * instance used to run automated data labeling model training and inference.
   *

See Also:
   AWS
   * API Reference

   */
  class AWS_SAGEMAKER_API LabelingJobResourceConfig
  {
  public:
    LabelingJobResourceConfig();
    LabelingJobResourceConfig(Aws::Utils::Json::JsonView jsonValue);
    LabelingJobResourceConfig& operator=(Aws::Utils::Json::JsonView jsonValue);
    Aws::Utils::Json::JsonValue Jsonize() const;

    /**
     *
The Amazon Web Services Key Management Service (Amazon Web Services KMS) key
     * that Amazon SageMaker uses to encrypt data on the storage volume attached to the
     * ML compute instance(s) that run the training and inference jobs used for
     * automated data labeling.

You can only specify a
     * VolumeKmsKeyId when you create a labeling job with automated data
     * labeling enabled using the API operation CreateLabelingJob. You
     * cannot specify an Amazon Web Services KMS key to encrypt the storage volume used
     * for automated data labeling model training and inference when you create a
     * labeling job using the console. To learn more, see Output
     * Data and Storage Volume Encryption.

The VolumeKmsKeyId
     * can be any of the following formats:

KMS Key ID

     * "1234abcd-12ab-34cd-56ef-1234567890ab"

Amazon
     * Resource Name (ARN) of a KMS Key

     * "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
     *

     */
    inline const Aws::String& GetVolumeKmsKeyId() const{ return m_volumeKmsKeyId; }

    /**
     *
The Amazon Web Services Key Management Service (Amazon Web Services KMS) key
     * that Amazon SageMaker uses to encrypt data on the storage volume attached to the
     * ML compute instance(s) that run the training and inference jobs used for
     * automated data labeling.

You can only specify a
     * VolumeKmsKeyId when you create a labeling job with automated data
     * labeling enabled using the API operation CreateLabelingJob. You
     * cannot specify an Amazon Web Services KMS key to encrypt the storage volume used
     * for automated data labeling model training and inference when you create a
     * labeling job using the console. To learn more, see Output
     * Data and Storage Volume Encryption.

The VolumeKmsKeyId
     * can be any of the following formats:

KMS Key ID

     * "1234abcd-12ab-34cd-56ef-1234567890ab"

Amazon
     * Resource Name (ARN) of a KMS Key

     * "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
     *

     */
    inline bool VolumeKmsKeyIdHasBeenSet() const { return m_volumeKmsKeyIdHasBeenSet; }

    /**
     *
The Amazon Web Services Key Management Service (Amazon Web Services KMS) key
     * that Amazon SageMaker uses to encrypt data on the storage volume attached to the
     * ML compute instance(s) that run the training and inference jobs used for
     * automated data labeling.

You can only specify a
     * VolumeKmsKeyId when you create a labeling job with automated data
     * labeling enabled using the API operation CreateLabelingJob. You
     * cannot specify an Amazon Web Services KMS key to encrypt the storage volume used
     * for automated data labeling model training and inference when you create a
     * labeling job using the console. To learn more, see Output
     * Data and Storage Volume Encryption.

The VolumeKmsKeyId
     * can be any of the following formats:

KMS Key ID

     * "1234abcd-12ab-34cd-56ef-1234567890ab"

Amazon
     * Resource Name (ARN) of a KMS Key

     * "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
     *

     */
    inline void SetVolumeKmsKeyId(const Aws::String& value) { m_volumeKmsKeyIdHasBeenSet = true; m_volumeKmsKeyId = value; }

    /**
     *
The Amazon Web Services Key Management Service (Amazon Web Services KMS) key
     * that Amazon SageMaker uses to encrypt data on the storage volume attached to the
     * ML compute instance(s) that run the training and inference jobs used for
     * automated data labeling.

You can only specify a
     * VolumeKmsKeyId when you create a labeling job with automated data
     * labeling enabled using the API operation CreateLabelingJob. You
     * cannot specify an Amazon Web Services KMS key to encrypt the storage volume used
     * for automated data labeling model training and inference when you create a
     * labeling job using the console. To learn more, see Output
     * Data and Storage Volume Encryption.

The VolumeKmsKeyId
     * can be any of the following formats:

KMS Key ID

     * "1234abcd-12ab-34cd-56ef-1234567890ab"

Amazon
     * Resource Name (ARN) of a KMS Key

     * "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
     *

     */
    inline void SetVolumeKmsKeyId(Aws::String&& value) { m_volumeKmsKeyIdHasBeenSet = true; m_volumeKmsKeyId = std::move(value); }

    /**
     *
The Amazon Web Services Key Management Service (Amazon Web Services KMS) key
     * that Amazon SageMaker uses to encrypt data on the storage volume attached to the
     * ML compute instance(s) that run the training and inference jobs used for
     * automated data labeling.

You can only specify a
     * VolumeKmsKeyId when you create a labeling job with automated data
     * labeling enabled using the API operation CreateLabelingJob. You
     * cannot specify an Amazon Web Services KMS key to encrypt the storage volume used
     * for automated data labeling model training and inference when you create a
     * labeling job using the console. To learn more, see Output
     * Data and Storage Volume Encryption.

The VolumeKmsKeyId
     * can be any of the following formats:

KMS Key ID

     * "1234abcd-12ab-34cd-56ef-1234567890ab"

Amazon
     * Resource Name (ARN) of a KMS Key

     * "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
     *

     */
    inline void SetVolumeKmsKeyId(const char* value) { m_volumeKmsKeyIdHasBeenSet = true; m_volumeKmsKeyId.assign(value); }

    /**
     *
The Amazon Web Services Key Management Service (Amazon Web Services KMS) key
     * that Amazon SageMaker uses to encrypt data on the storage volume attached to the
     * ML compute instance(s) that run the training and inference jobs used for
     * automated data labeling.

You can only specify a
     * VolumeKmsKeyId when you create a labeling job with automated data
     * labeling enabled using the API operation CreateLabelingJob. You
     * cannot specify an Amazon Web Services KMS key to encrypt the storage volume used
     * for automated data labeling model training and inference when you create a
     * labeling job using the console. To learn more, see Output
     * Data and Storage Volume Encryption.

The VolumeKmsKeyId
     * can be any of the following formats:

KMS Key ID

     * "1234abcd-12ab-34cd-56ef-1234567890ab"

Amazon
     * Resource Name (ARN) of a KMS Key

     * "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
     *

     */
    inline LabelingJobResourceConfig& WithVolumeKmsKeyId(const Aws::String& value) { SetVolumeKmsKeyId(value); return *this;}

    /**
     *
The Amazon Web Services Key Management Service (Amazon Web Services KMS) key
     * that Amazon SageMaker uses to encrypt data on the storage volume attached to the
     * ML compute instance(s) that run the training and inference jobs used for
     * automated data labeling.

You can only specify a
     * VolumeKmsKeyId when you create a labeling job with automated data
     * labeling enabled using the API operation CreateLabelingJob. You
     * cannot specify an Amazon Web Services KMS key to encrypt the storage volume used
     * for automated data labeling model training and inference when you create a
     * labeling job using the console. To learn more, see Output
     * Data and Storage Volume Encryption.

The VolumeKmsKeyId
     * can be any of the following formats:

KMS Key ID

     * "1234abcd-12ab-34cd-56ef-1234567890ab"

Amazon
     * Resource Name (ARN) of a KMS Key

     * "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
     *

     */
    inline LabelingJobResourceConfig& WithVolumeKmsKeyId(Aws::String&& value) { SetVolumeKmsKeyId(std::move(value)); return *this;}

    /**
     *
The Amazon Web Services Key Management Service (Amazon Web Services KMS) key
     * that Amazon SageMaker uses to encrypt data on the storage volume attached to the
     * ML compute instance(s) that run the training and inference jobs used for
     * automated data labeling.

You can only specify a
     * VolumeKmsKeyId when you create a labeling job with automated data
     * labeling enabled using the API operation CreateLabelingJob. You
     * cannot specify an Amazon Web Services KMS key to encrypt the storage volume used
     * for automated data labeling model training and inference when you create a
     * labeling job using the console. To learn more, see Output
     * Data and Storage Volume Encryption.

The VolumeKmsKeyId
     * can be any of the following formats:

KMS Key ID

     * "1234abcd-12ab-34cd-56ef-1234567890ab"

Amazon
     * Resource Name (ARN) of a KMS Key

     * "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
     *

     */
    inline LabelingJobResourceConfig& WithVolumeKmsKeyId(const char* value) { SetVolumeKmsKeyId(value); return *this;}

    inline const VpcConfig& GetVpcConfig() const{ return m_vpcConfig; }

    inline bool VpcConfigHasBeenSet() const { return m_vpcConfigHasBeenSet; }

    inline void SetVpcConfig(const VpcConfig& value) { m_vpcConfigHasBeenSet = true; m_vpcConfig = value; }

    inline void SetVpcConfig(VpcConfig&& value) { m_vpcConfigHasBeenSet = true; m_vpcConfig = std::move(value); }

    inline LabelingJobResourceConfig& WithVpcConfig(const VpcConfig& value) { SetVpcConfig(value); return *this;}

    inline LabelingJobResourceConfig& WithVpcConfig(VpcConfig&& value) { SetVpcConfig(std::move(value)); return *this;}

  private:

    Aws::String m_volumeKmsKeyId;
    bool m_volumeKmsKeyIdHasBeenSet = false;

    VpcConfig m_vpcConfig;
    bool m_vpcConfigHasBeenSet = false;
  };

} // namespace Model
} // namespace SageMaker
} // namespace Aws

redpajama_set_name: RedPajamaGithub


Music and food are two defining characteristics that gives New Orleans her soul. As I write this blog on my three favorite sandwiches on the Westbank, I'm listening to Kermit Ruffins and the Rebirth Brass Band. Food and music.
Growing up Cuban, a culture with food and music at the center, I feel, gives me a deep appreciation for the sounds and tastes of New Orleans.
I have zero musical talent other than an appreciation for good music. And I'm no food critic, but I'm critical of everything I eat. I do have a good sense of when something is good.
We all have our favorite food spots in New Orleans. Not just favorite food spots, but a favorite place for our favorite dishes. The options are just about endless in our city.
So it's bold to limit my selection to just 3 sandwiches. In fact, my list of favorite sandwiches is quite long. In the end, the top 3 are the ones I eat on a more regular basis.
I really can't believe that not one fried shrimp or roast beef po-boy made my top 3. That doesn't mean there are not some good ones out there. I may need to do a follow up of my 3 favorite roast beef or my 3 favorite fried shrimp po-boys because there are so many to choose from.
When you are ranked amongst the top fried chicken joints in the city of New Orleans, you're doing something right. Put that fried chicken on french bread and you have one of my favorite sandwiches, not just on the Westbank, but in all of New Orleans.
For all you Westbank haters out there, Algiers is New Orleans.
My favorite way to eat it is dressed, no pickles, with ketchup and Crystals hot sauce. Don't forget a side of onion rings. Those onion rings are the best I've ever had.
Vietnamese food has quickly become one of my favorite cuisines and there is no shortage of good Vietnamese eateries on the Westbank. But Tan Dinh, not only in my opinion, but in the opinion of many ethnic Vietnamese in the city and others, is one of the best.
The Banh Mi is the Vietnamese version of the po-boy. In fact, the Banh Mi is a product of French Colonialism in Indochina, hence the french baguette. My favorite is the roast pork. It's loaded with pickled cucumber, carrots, cilantro,and jalapeño. At Tan Dinh they make their own mayonnaise spread. For the less adventurous eater, have them hold the pâté.
You should order a small bowl of Phở to start. Just the broth if you want. It's delicious. Finish off your meal with Vietnamese coffee.
I'm routinely asked about where you can get good Cuban food in the city. My answer rarely changes, "My parent's kitchen." There have been some good Cuban restaurants that come and go. There are non-Cuban places that offer "Cuban dishes" and even Cuban sandwiches. They're good but it's usually not traditional.
Holly's offers some very traditional Cuban dishes including the Cuban sandwich. The key to a good Cuban sandwich is the bread. It's not like traditional french bread. The main difference is Cuban bread is baked with lard which gives it a unique texture. The bread is sliced and lightly buttered. Add a coat of yellow mustard, roast pork, ham, swiss cheese, and pickles. Finally, it's cooked on a sandwich press.
If you visit Holly's and they have Medianoche Bread, order the Medianoche. It's just like the Cuban except its on a yellow-colored egg bread, which is soft and sweet.
Ok, why limit this to 3? Here are some other tasty sandwiches that you should try on the Westbank.
LA 23 in Belle Chasse has some fantastic BBQ. The pulled pork and brisket sandwich are well worth the drive down HWY 23.
I've always enjoyed the Roast Beef on Muffaletta bread from DiMartinos. It helps that its a short walk from my office. The roast beef po-boy at Chateau Orleans Po-boys is in Marrero is every bit as delicious.
When you visit Chubbies for the Chicken breast po-boy, bring a friend and have them order the Shrimp po-boy and y'all share.
Sahara Cafe has some of the best Lebanese food in town, not just on the Westbank, and the Gyro will not disappoint.
Oh the sandwiches! Being limited to 3 just isn't enough. Right? Options are great when it comes to food and options are NECESSARY when it comes to insurance. As an Independent insurance agency, Garcia Insurance Services represents many insurance companies. The benefit of working with an agency that has options for you is essential in ensuring that you get the right policy for you.
Do you live on the Westbank (or anywhere in New Orleans) and feel like you are overpaying for your insurance or maybe not getting the service you deserve? We may not not be experts on sandwiches, but we know our stuff when it comes to insurance. Start your quote today.
Next Post: "Wood" Termite Damage Be Covered By My Home Insurance?


text:
2nd December: Wednesday's Football Accumulator – 11/1
Tom Dunstan in Betting Tips and News, Editorial, Football Accumulators 1 Dec 2020
With an action-packed midweek schedule on the cards, we have a stacked night of fixtures from across Europe and England's lower leagues. On that note, for those of you looking to chuck on a Wednesday acca, we have searched far and wide to find you a couple of helpful tips that are worth keeping an eye out for.
BST 19:00 Shrewsbury Town vs Accrington Stanley
Starting with Wednesday's guests, while Accrington Stanley might have seen Tranmere end their FA Cup adventure before it could really get started last month, the Reds have shocked many across League One so far this season. Stepping up from England's fourth-tier earlier in the year, John Coleman's men were last seen eight days ago picking up an eye-catching 1-0 victory at home against Crewe. With the mood in their camp rightfully at a red-hot high, Accrington find themselves enjoying a five-match unbeaten run across all competitions, winning four of those appearances. Suddenly dreaming of mounting what would be considered shock back-to-back promotion charges, the Lancashire outfit open the midweek fixtures sat just a single point adrift of breaking into the top-seven. Confident of extending on their recent purple patch in midweek, Accrington also have a growing reputation for their continued displays at the back. Recording another clean sheet last time out against Crewe, Wednesday's guests have now gone over 450 minutes without picking the ball out of their own net. On the flip side, while Shrewsbury might have managed to just come past non-league outfit Oxford City in the FA Cup over the weekend, they are in the midst of a really worrying run of form in League One. Already sat four points adrift of safety and appearing to be destined for a real relegation scrap, the Shrews find themselves enduring an eight-match winless run in the third-flight.
Tip: Accrington Stanley win @ 6/4
19:45 Nottingham Forest vs Watford
While Watford would have been disappointed to have had to settle for back-to-back stalemates against QPR and Bristol City in the space of four days last week, the Hornets really laid down a marker over the weekend. Sacrificing their Premier League status over the summer, new boss Vladimir Ivić saw his side pick up a very impressive 4-1 romp at home against Preston on Saturday. With many tipping Watford to make an immediate return to the top-flight after managing to keep hold of the likes of Troy Deeney, Ismaïla Sarr and Étienne Capoue, Wednesday's guests open the midweek fixtures sat third in the table and just a single point adrift of reclaiming their spot in the top-two. Bouncing back from their shock defeat away at Barnsley when drawing a close to October, the one-time Maccabi Tel Aviv boss finds his side enjoying a five-match Championship unbeaten run. With leading marksman Joao Pedro once again finding the net in their romp against Preston over the weekend, the Hornets will travel to the City Ground looking to cash in on Nottingham Forest's woeful end to November. Hith with a 1-0 loss against Swansea on home soil last time out, Wednesday's hosts are in the midst of a three-match losing run and are firmly looking over their shoulder at the drop zone. With Watford picking up back-to-back wins against Forest, we're backing a similar outcome in midweek.
Tip: Watford win @ 7/5
19:45 Luton Town vs Norwich City
Starting with Wednesday's guests, while Norwich would have been left heartbroken to have seen Coventry snatch themselves a last-gasp point at Carrow Road in the dying embers over the weekend, Daniel Farke's men should find the mood in their camp at a high. Opening up the midweek fixtures holding a one-point buffer at the top of the table, they're seen as a leading contender to book an immediate Premier League return. Although that 1-1 draw in East Anglia might have brought an end to their three-match second-tier winning run, Norwich are unbeaten in each of their last 10 Championship contests on the bounce, a run that stems all the way back to October 3rd. A huge part of their recent high-flying purple patch has come thanks to some scintillating performances on the road. Including a 3-2 win at Stoke last time away from Carrow Road, Wednesday's guests have won each of their last three second-tier contests on their travels and have collected a remarkable 13 points from their last five contests outside of East Anglia. With Luton putting in a woeful display over the weekend and appearing to be in the midst of a worrying spell, the Hatters could be in for another tough test in midweek. Hit with a 4-0 drumming at the hands of Cardiff on Saturday and failing to win any of their last four Championship contests, we're backing an away victory in Bedfordshire.
Tip: Norwich City win @ 23/20
Our Wednesday Accumulator:
Shrewsbury Town vs Accrington Stanley – Accrington Stanley win @ 6/4
Nottingham Forest vs Watford – Watford win @ 7/5
Luton Town vs Norwich City – Norwich City win @ 23/20
Place a £10 bet on our accumulator with 888sport and pocket £135.45 if all predictions are correct.
You can also visit our betting promotions section for the latest enhanced odds promos, accumulator bonuses and more.
Categories Betting Tips and News Editorial Football Accumulators
Fints (FIN) Esports v Arukonda (ARU) Esports - Soccer
Bayer 04 (SALAYYY) Esports v Arsenal (Kray) Esports - Soccer
Leicester (Upcake22) Esports v AC Milan (Boulevard_Prospect) Esports - Soccer
West Ham (nikkitta) Esports v Everton (Skromnuy) Esports - Soccer
Leicester (vrico) Esports v Arsenal (orlovsky1) Esports - Soccer

redpajama_set_name: RedPajamaCommonCrawl


There have been multiple changes at Roll Call. Jennifer Koons has been named national security editor, having previously served as acting defense and diplomacy editor. Sarah Chacko will now cover education and labor as a staff writer, having previously covered legislation for the publication. Kevin Whitelaw has been named editor for CQ Weekly. Prior to this position, he worked as the appropriations and budget editor for Congressional Quarterly. For more political news and information, follow Roll Call on Twitter.


text:
Q: changing case for first and last letter C++ i need ThE FirsT AnD LasT letter of every word to be uppercase and the rest lowercase but function convertFirstAndLastLetter only does the first and last of the sentence.
void convertFirstAndLastLetter(char wrd[])
{
    size_t last = strlen(wrd) - 1;
    size_t first = 0;

    wrd[first] = toupper(wrd[first]);
    wrd[last] = toupper(wrd[last]);

    for(int i = first + 1 ; i < last - 1; i++)
    {
        wrd[i] = tolower(wrd[i]);
    }
}

int main ()
{
    float val;
    cout << "ent ";
    cin >> val;

    if (val == 4)
    {
        char wrd[256];
        cin.ignore();
        cin.getline(wrd,256);
        convertFirstAndLastLetter(wrd);
        cout << wrd;

        return 0;
    }
}

A: Right now you're passing a whole line to your function, so the first and last characters are all that is being changed.
To fix that you need to split the line up into words which could be done by reading a word at a time using std::cin >> word, or reading the whole line and then using a std::stringstream to split it up.  Both are about the same, but I used a stringstream.
Next, if I'm reading your statement correctly, you want to have the first and last "letter" of each word uppercase and the rest lowercase.  That means we need to find the first and last letter in case there is punctuation before or after the word.
Once the first and last are determined it's easy to uppercase them and lowercase the rest.
#include <iostream>
#include <string>
#include <sstream>
#include <cctype>

void convertFirstAndLastLetter(std::string& word)
{
    if(!word.empty())
    {
        size_t first = 0;
        size_t last = word.size() - 1;
        //Find first alpha character
        while(first < word.size() && !std::isalpha(word[first]))
        {
            ++first;
        }
        //If the position is valid, uppercase it
        if(first < word.size())
        {
            word[first] = static_cast<char>(std::toupper(word[first]));
        }

        //Find last alpha character
        while(last > first && !std::isalpha(word[last]))
        {
            --last;
        }

        //If the position is valid, uppercase it
        if(last > first)
        {
            word[last] = static_cast<char>(std::toupper(word[last]));
        }

        for(size_t i = first + 1; i < word.size() && i < last; ++i)
        {
            if(std::isalpha(word[i]))
            {
                word[i] = static_cast<char>(std::tolower(word[i]));
            }
        }
    }
}

int main()
{
    float val;
    std::cout << "ent ";
    std::cin >> val;
    std::cin.ignore();

    if(val == 4)
    {
        std::string line;
        if(std::getline(std::cin, line))
        {
            std::string word;
            std::stringstream ss(line);
            while(ss >> word)
            {
                convertFirstAndLastLetter(word);
                std::cout << word << " ";
            }
            std::cout << "\n";
        }
    }
    return 0;
}

Keep in mind this will discard any extra spaces at the beginning and end of each line as well as any extra spaces between words.  The way I am printing them out will also add an extra space at the end of each line.  You didn't mention any concern about those things in your question, so I didn't worry about them.  They are all solvable with a little extra effort.

A: Now with less duplicated code:
#include <algorithm>
#include <iostream>
#include <string>

template<typename It>
void upperFirstAlpha(It begin, It end)
{
  auto first = std::find_if(begin, end, isalpha);
  if (first != end)
    *first = toupper(*first);
}

int main()
{
  for (std::string s; std::cin >> s;) {
    std::transform(s.begin(), s.end(), s.begin(), tolower);

    upperFirstAlpha(s.begin(), s.end());
    upperFirstAlpha(s.rbegin(), s.rend());

    std::cout << s << ' ';
  }
}

As @Retired Ninja pointed out the first version wouldn't work for punctuation, whether this version is what you are looking for depends on what your input looks like.

A: This function
void convertFirstAndLastLetter(char wrd[])
{
    size_t last = strlen(wrd) - 1;
    size_t first = 0;

    wrd[first] = toupper(wrd[first]);
    wrd[last] = toupper(wrd[last]);

    for(int i = first + 1 ; i < last - 1; i++)
    {
        wrd[i] = tolower(wrd[i]);
    }
}

is wrong. For example if character array is empty that is it has only the terminating zero then expression strlen(wrd) - 1 will give you the maximum value for an object of type size_t and in the next statement
    wrd[last] = toupper(wrd[last]);

you will try to change memory beyond the array.
Also if you use standard function strlen then you have to include header <cstring>.
In fact there is no any need to use function strlen. The code can be written simpler
#include <cctype>

//...

void convertFirstAndLastLetter( char wrd[] )
{
    if ( *wrd )
    {
        *wrd = std::toupper( *wrd );

        if ( *++wrd )
        {
            while ( *( wrd + 1 ) )
            {
                *wrd = std::tolower( *wrd );
                ++wrd;
            }
            *wrd = std::toupper( *wrd );
        }
    }
}

A: #include "stdafx.h"
#include <string>
#include <iostream>
using namespace std;

void convertFirstAndLastLetter(char wrd[])
{
    size_t last = strlen(wrd) - 1;
    size_t first = 0;

    wrd[first] = toupper(wrd[first]);
    wrd[last] = toupper(wrd[last]);

    for(int i = first + 1 ; i < last; i++)
    {
        wrd[i] = tolower(wrd[i]);
    }
}

int _tmain(int argc, _TCHAR* argv[])
{
    float val;
    cout << "ent ";
    cin >> val;

    if (val == 4)
    {
       char wrd[256];
       cin.ignore();
       cin.getline(wrd,256);
       convertFirstAndLastLetter(wrd);
       cout << wrd;

       return 0;
    }

}

redpajama_set_name: RedPajamaStackExchange


At one point the caravan increased to 7,000 people, but many of them succumbed to exhaustion, sleep and sickness along the way and chose to stay behind in Mexican towns. Others turned back to their country of origin.
The caravan formed in San Pedro Sula, Honduras, on October 13, nearly seven weeks ago. The 500 migrants who have been in the caravan from the beginning have marched a total of 4,000 blistering km on their way to Tijuana.
Over time the strain on a marital relationship often spills over onto the parent-child relationship, leading to a marked reduction in nurturance, responsiveness to needs and consistency in parenting.
This can contribute to socio-emotional problems in children, such as low self-esteem, depression, drug use and other health problems.
Childhood is already a delicate time for growth and development, even when good enough parenting and a stable, nurturing environment is available. A grueling move to a strange and potentially hostile country obviously feels necessary for these migrant families—or they wouldn't be on the move.


I finally read Enrico Moretti's "The New Geography of Jobs" this week. It was better than I expected - both a good introduction to the topic and interesting details and research results that kept me engaged.
Stylistically, he does an impressive job hewing close to the research results while avoiding jargon and identification strategies. It's a clear, coherent narrative about city growth and decline, with lots of evidence at each step in the argument.
TL;DR: Industry clusters go through a life-cycle. A newborn technology is scattered. It coheres in 3 or 4 clusters, with stars, VCs, or other key factors as coordination points. Rapid employment, productivity, and wage growth follow.
Important news for Rochester Artists!!
Aaaaand so ends the 4.5 years I spent at @girldevelopit. Lost access to my GDI email and Slack today (as planned) and I keep vacillating between excitement for the chance to apply myself to better causes and immense heartbreak, as this is not the way envisioned the end. A thread.
I'm super torn because a.) I've been stewing on this day a longggg time b.) I've recognized that my persistence doesn't always help c.) I'd rather pour my energy into positive, productive things instead. But there's unfinished business and I want to keep poking a bit longer.
The #gdistrike lives on in my eyes because it's possible to hold an org accountable from the outside and I'd like to maintain as much transparency as possible on the inner workings and failures. Members (and potentially future members) deserve to know the risks.


text:
/*
 * This file is part of Nucleus, licensed under the MIT License (MIT). See the LICENSE.txt file
 * at the root of this project for more details.
 */
package io.github.nucleuspowered.nucleus.modules.ban.commands;

import io.github.nucleuspowered.nucleus.core.Util;
import io.github.nucleuspowered.nucleus.modules.ban.BanPermissions;
import io.github.nucleuspowered.nucleus.core.scaffold.command.ICommandContext;
import io.github.nucleuspowered.nucleus.core.scaffold.command.ICommandExecutor;
import io.github.nucleuspowered.nucleus.core.scaffold.command.ICommandResult;
import io.github.nucleuspowered.nucleus.core.scaffold.command.NucleusParameters;
import io.github.nucleuspowered.nucleus.core.scaffold.command.annotation.Command;
import io.github.nucleuspowered.nucleus.core.services.INucleusServiceCollection;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import org.spongepowered.api.Sponge;
import org.spongepowered.api.command.exception.CommandException;
import org.spongepowered.api.command.parameter.Parameter;
import org.spongepowered.api.profile.GameProfile;
import org.spongepowered.api.service.ban.Ban;
import org.spongepowered.api.service.ban.BanService;

import java.util.Optional;

@Command(aliases = "checkban", basePermission = BanPermissions.BASE_CHECKBAN, commandDescriptionKey = "checkban")
public class CheckBanCommand implements ICommandExecutor {

    @Override
    public Parameter[] parameters(final INucleusServiceCollection serviceCollection) {
        return new Parameter[] {
                NucleusParameters.GAME_PROFILE
        };
    }

    @Override
    public ICommandResult execute(final ICommandContext context) throws CommandException {
        final GameProfile profile = context.requireOne(NucleusParameters.GAME_PROFILE);
        final BanService service = Sponge.server().serviceProvider().banService();

        // TODO: Async
        final Optional<Ban.Profile> obp = service.find(profile).join();
        if (!obp.isPresent()) {
            return context.errorResult("command.checkban.notset", Util.getNameOrUnkown(context, profile));
        }

        final Ban.Profile bp = obp.get();

        final Component name;
        if (bp.banSource().isPresent()) {
            name = bp.banSource().get();
        } else {
            name = context.getMessage("standard.unknown");
        }

        if (bp.expirationDate().isPresent()) {
            context.sendMessage("command.checkban.bannedfor", Util.getNameOrUnkown(context, profile), name,
                    context.getTimeToNowString(bp.expirationDate().get()));
        } else {
            context.sendMessage("command.checkban.bannedperm", Util.getNameOrUnkown(context, profile), name);
        }

        context.sendMessage("command.checkban.created", Util.FULL_TIME_FORMATTER.withLocale(context.getLocale())
                .format(bp.creationDate()
        ));
        context.sendMessage("standard.reasoncoloured", LegacyComponentSerializer.legacyAmpersand().serialize(bp.reason()
                        .orElseGet(() -> context.getServiceCollection().messageProvider().getMessageFor(context.audience(), "ban.defaultreason"))));
        return context.successResult();
    }

}


13 Signs you might be an Internet entrepreneur | Jose Mallabo. More or Less.
« You're soooo good lookin'!
This entry was posted on July 24, 2012, 4:30 pm and is filed under Funny, Public Relations, Work. You can follow any responses to this entry through RSS 2.0. You can leave a response, or trackback from your own site.


Background: Paracoccidioidomycosis (PCM) is a systemic mycosis caused by dimorphic fungi Paracoccidioides brasiliensis and Paracoccidioides lutzii. It is prevalent in Latin American, mainly in Brazil. Therefore, PCM has fundamental impact on the Brazilian global economy, especially in public health system, since it is affecting economical active population in different country regions.
Objective: The present study aimed to standardize the Real Time-Polymerase Chain Reaction (rt-PCR) for an efficient and safe PCM diagnosis amplifying the recombinant protein PB27 gene, only expressed by specimens of Paracoccidioides genus.
Methods: To standardize a methodology of rt-PCR using species-specific primers and probe designed for annealing in this specific region of the fungi´s genome, amplifying the recombinant protein PB27 gene, only expressed by specimens of Paracoccidioides genus. Followed by design in silico, experiments were performed in vitro to determine rt-PCR specificity, efficiency and genome detection limit.
Results: The primers and probe sequences were deposited in Brazilian Coordination of Technological Innovation and Transfer (CTIT), under patent reference number BR1020160078830. The present study demonstrated the rt-PCR applicability for support on diagnosis of paracoccidioidomycosis, presenting low cost, which makes it affordable for public health services in developing countries as Brazil. It is noteworthy that it is necessary to validate this methodology using clinical samples before to use as a safe method of diagnosis. A review of all patents related to this topic was performed and it was shown that, to date, there are no records of patent on kits for paracoccidioidomycosis´s diagnostic. Indeed, there is still a lot to go to reach this goal.
Conclusion: The reaction developed was standardized and patented, opening perspectives to molecular diagnosis development for paracoccidioidomycosis, since rt-PCR can be applied to a broad spectrum of infectious diseases. It would need to be tested in biological samples in order to validate this method and then generate a diagnostic kit for Paracoccidioidomycosis.
Keywords: Diagnosis, paracoccidioidomycosis, Paracocciodioides brasiliensis, Paracocciodioides lutzii, Pb 27 protein, real time-PCR.
Keywords:Diagnosis, paracoccidioidomycosis, Paracocciodioides brasiliensis, Paracocciodioides lutzii, Pb 27 protein, real time-PCR.
Abstract:Background: Paracoccidioidomycosis (PCM) is a systemic mycosis caused by dimorphic fungi Paracoccidioides brasiliensis and Paracoccidioides lutzii. It is prevalent in Latin American, mainly in Brazil. Therefore, PCM has fundamental impact on the Brazilian global economy, especially in public health system, since it is affecting economical active population in different country regions.


text:
New York (State), Legislature | Assembly
The organization New York (State), Legislature | Assembly represents an institution, an association, or corporate body that is associated with resources found in Biddle Law Library - University of Pennsylvania Law School.
The Resource New York (State), Legislature | Assembly
19 Items by the Organization New York (State), Legislature | Assembly
The Constitution of the State of New-York, adopted November 3, 1846 : together with marginal notes and a copious index, prepared by I.R. Elwood, Esq., late clerk of the Senate
Communication from Hon. John C. Mather, canal commissioner, in answer to certain charges contained in the report of the select committee, accompanied by a resolution of impeachment
Communication from the governor, transmitting certain proceedings of the Seneca Nation of Indians
A Compilation of cases of contested elections to seats in the Assembly of the state of New York : with the reports of committees on privileges and elections, and the action of the House thereon : from 1777 to 1899, inclusive, prepared and arranged in compliance with a resolution of the Assembly, passed April 28, 1899, under the direction of Archie E. Baxter, clerk
A compilation of cases of breaches of privilege of the House, in the Assembly of the state of New York : with the reports of standing and special committees and the proceedings and judgments thereon, together with full references to all action in each case, from 1777 to 1871, prepared pursuant to a resolution of the Assembly, passed April 18th, 1871, under the supervision of C. W. Armstrong, clerk
Papers and testimony in the matter of the election of William D. Murphy as member of Assembly in the first district of the county of Albany, State of New York, contested by Stephen Springsted
Proceedings in the Court of impeachment in the matter of the impeachment of George G. Barnard, a justice of the Supreme Court of the state of New York
Proceedings of the committee appointed to inquire into the official conduct of William W. Van Ness, Esquire : one of the justices of the Supreme Court of the state of New York : with the whole evidence taken by that body
Report of New York State Indian Commission, by E. A. Everett, Chairman ; transmitted to, and rejected by the New York State Assembly March 17, 1922 ; with Memorandum of C. C. Daniels, Special Assistant to the Attorney General, November 21, 1934
Report of the special committee appointed to investigate the local government of the city and county of New York
Special Committee to investigate the affairs of the Assembly ceiling
Was the Assembly true to its trust? : a fight for the federal Constitution in the New York Assembly of 1918, by Eliot Tuckerman
A compilation of cases of contested elections to seats in the Assembly of the state of New York : with the reports of committees on privileges and elections, and the action of the House thereon, from 1777 to 1871 inclusive ; with an appendix of the election laws of the state of New York, prepared and arranged, in compliance with a resolution of the Assembly, passed April 18th, 1871, under the direction of C.W. Armstrong, clerk
A compilation of cases of contested elections to seats in the Assembly of the state of New York : with the reports of committees on privileges and elections, and the action of the House thereon, from 1777 to 1899 inclusive, prepared and arranged, in compliance with a resolution of the Assembly, passed April 28th, 1899, under the direction of Archie E. Baxter, clerk
A digest of taxation in the states, under three heads : 1. Mode or machinery of taxation; 2. Standard of valuation; 3. Property liable to and exempt from, taxation, [compiled] by Alfred B. Street
Abolition of the death penalty : speech of Hon. Burt Van Horn, of Niagara in favor of abolishing capital punishment in Assembly, March 1860
Assembly ceiling investigation : appropriation or Ainsworth committe
Breach of privilege : the matter of Hon. H. Ray : argument of Hon. Platt Potter : the case of a high breach of privilege of the Honorable the Assembly of the State of New York, and its result
9 Items that are about the Organization New York (State), Legislature | Assembly
Albany, the crisis in government : the history of the suspension, trial and expulsion from the New York State Legislature in 1920 of the five socialist assemblymen by their political opponents, by Louis Waldman ; with an introduction by Seymour Stedman
Journal of the Assembly of the state of New York : reformatted from the original and including, A journal of the votes of the General Assembly of Her Majesties colony of New-York in America
Manual, compiled and prepared for the use of the Assembly : exemplifying particularly the mode of proceeding, conformably to the national and state constitutions, and the rules and orders of the House of Assembly of the state of New-York, by Aaron Clark, Esq
The constituent-engagement effect of small donor public financing : a statistical comparison of City Council (2017) and State Assembly (2018) fundraising in New York City, by Nirali Viras, Chisun Lee, Joanna Zdanys
Context of New York (State), Legislature | Assembly
A compilation of cases of breaches of privilege of the House, in the Assembly of the state of New York : with the reports of standing and special committees and the proceedings and judgments thereon, together with full references to all action in each case, from 1777 to 1871
Was the assembly true to its trust? : a fight for the federal constitution in the New York Assembly of 1918
A digest of taxation in the states, under three heads : 1. Mode or machinery of taxation; 2. Standard of valuation; 3. Property liable to and exempt from, taxation
A Compilation of cases of contested elections to seats in the Assembly of the state of New York : with the reports of committees on privileges and elections, and the action of the House thereon : from 1777 to 1899, inclusive
Report of New York State Indian Commission
The Constitution of the State of New-York, adopted November 3, 1846 : together with marginal notes and a copious index
A compilation of cases of contested elections to seats in the Assembly of the state of New York : with the reports of committees on privileges and elections, and the action of the House thereon, from 1777 to 1871 inclusive ; with an appendix of the election laws of the state of New York
A compilation of cases of contested elections to seats in the Assembly of the state of New York : with the reports of committees on privileges and elections, and the action of the House thereon, from 1777 to 1899 inclusive
New York (State), Legislature | Assembly -- Rules and practice
New York (State), Legislature | Assembly -- Periodicals
New York (State), Legislature | Assembly -- Elections
New York (State), Legislature | Assembly -- Contested elections
Issuing body of
Sponsoring body of

 Data from New York (State), Legislature | Assembly - Biddle Law Library - University of Pennsylvania Law School

Data Citation of the Organization New York (State), Legislature | Assembly


text:
Hymna Nigeru je píseň La Nigérienne (). Hudbu k hymně složili Robert Jacquet a Nicolas Abel François Frionnet, text napsal Maurice Albert Thiriet. Hymna byla přijata v roce 1961, rok po vyhlášení nezávislosti.

21. listopadu 2019 prezident republiky Mahamadou Issoufou oznámil, že se rozhodl změnit nebo dokonce změnit státní hymnu. Výbor, kterému předsedá premiér Birgi Rafini, byl "obviněn z reflexe současné hymny poskytováním oprav" a "pokud je to možné, najde novou hymnu, která odpovídá současnému Nigerskému kontextu". Byl vytvořen v roce 2018 a skládá se z několika členů vlády a asi patnácti "odborníků se zkušenostmi s psaním a hudební skladbou".

Assamana Malam Issa, ministryně kulturní renesance, "Musíme najít hymnu, který dokáže povzbudit obyvatelstvo, být pro nás jakýmsi válečným pláčem, abychom se dotkli našeho vlasteneckého vlákna".

Francouzský text

Odkazy

Související články
 Nigerská vlajka
 Státní znak Nigeru

Niger
Hymna

redpajama_set_name: RedPajamaWikipedia


Are you ready to put fun and excitement into your life? Take the first step — it's easy!
We specialize in social-style and competitive-style ballroom dance. Our instructors specialize in the full gamut of styles including Swing, Latin, Country and Western, and traditional ballroom dances.
Weddings, vacations, business, health, fitness, weight loss, or just fun — we will exceed your expectations.
Our exceptional instructors are dedicated to bringing you the joy of dance and introducing you to a community you're not likely to encounter anywhere else.
No matter your level of experience—you'll find a second home with us.
Ballroom on Broadway specializes in all ballroom dance!
Come learn ballroom dance with private dance lessons for any one ─ at any level of experience. The best way to get started is to attend a group dance class! The first group dance class is free.
One-on-one instruction is the best way to learn how to dance─and that's exactly what you'll get at Ballroom on Broadway!
With the Introductory Private Lessons Special Package, you will receive private lessons with a skilled teacher. Enjoy 3 twenty-five minute dance lessons, and get recommendations for a lesson package tailored to your interests and skill level.


We are real estate wholesalers and we offer properties to you at tremendous discounts. The deals we offer will NOT be found anywhere else. These are our deals and we are looking to assign them for a quick, modest profit and move on.
We are constantly acquiring bargain-priced properties that are perfect for rehabbing...or to add to your rental portfolio. If you'd like to receive instant access to the property we're selling right now and priority e-mail notifications of wholesale deals in the future, please enter your contact information in the box to the right.
Please note, we will use every method to get in contact with you so please provide us complete information so you don't miss out. Typically these deals go within 2 days so you'll have about 2 Days 2 Buy these bargain discounts or you'll miss out for good.
$18,000 Cheap Houses for Sale in York PA - 3 Private Parking Spots!
NEW Lower Price - Only $29,500 for this SOLID 4/5bd Rental.
Rent 2 Own Opportunity in York Suburban Schools - NO Credit OK!
1bdrm "DownTown" Apartment - $535/mnth w/Private Parking. Now Available!


INDUSTRY.co.id - Banda Aceh - Delivery of Mitsubishi Xpander units has begun gradually, including 80 units ordered by buyers in Aceh.Director of Sales & Marketing Division of Mitsubishi Motors Krama Yudha Sales Indonesia (MMKSI) Irwan Kuncoro said that each region takes time vary. The distribution process may take longer in one area that is located further away.
"For Xpander, this week we start shipping to consumers, the previous week the distribution start to the dealership, but the area by area is different," said Irwan after the inauguration of passenger car dealer Arista Sukses Mandiri - Aceh, in Aceh Besar, Wednesday (27/92017 ).
Head of Sales & Marketing Region III MMKSI Ilham Irandra added, the latest Low MPV unit made by Mitsubishi it will be distributed gradually, depending on the type to the color ordered by the buyer.
Especially in Aceh, buyers who order Xpander type Exceed, either manual or automatic, can receive orders in a shorter time.
Budiman Director of PT Arista Sukses Mandiri, who is a partner of MMKSI for dealer Arista Sukses Mandiri - Aceh, explained that it is because the supply of composition for two types more.
Since its launch in the automotive exhibition event GAIKINDO Indonesia International Auto Show (GIIAS) 2017 on August 10 last, orders Mitsubishi Xpander recorded has penetrated the number 15,000 units.


To get your UAV Pilot License (PfCO), then you will have to attend a CAA approved course such as ICARUS (by Aerial Motion Pictures) to do your UAV training.
Ex-RAF Helicopter Instructor Matt Williams designed the ICARUS UAV course in 2015 and had flown Helicopters and UAVs all over the world.
The ICARUS team is supported by Flight Instructors who fly on Film and TV sets as well as being experts in the field of Industrial Inspections.


J3 Healthcare Services proudly and dedicatedly offers you the services of our Physical Therapists.
Are you ready to start your physical therapy treatment? Ask for assistance when you call us at 301-613-8446. A representative from J3 Healthcare Services will be available to respond to your requests and address your questions about Physical Therapy.


Overseas Shipholding Group, Inc. (OSGB)-Financial and Strategic SWOT Analysis Review provides you an in-depth strategic SWOT analysis of the company's businesses and operations. The profile has been compiled by GlobalData to bring to you a clear and an unbiased view of the company's key strengths and weaknesses and the potential opportunities and threats. The profile helps you formulate strategies that augment your business by enabling you to understand your partners, customers and competitors better.
Overseas Shipholding Group, Inc. (OSG) is a tanker company that provides energy transportation services in the US flag markets. It owns and operates a fleet of oceangoing tankers and articulated tug barges (ATB) in the Jones Act industry. The company takes part of Maritime Security Program and Maritime Administration of the US Department of Transportation (MarAd) trading restrictions programs. OSG also transports crude oil for BP in Alaska. It serves independent oil traders, refinery operators, and the US and international government entities. OSG is headquartered in Tampa, Florida, the US.


text:
According to the Resolution of the Government of the Republic of Lithuania No. 697 "On Approval of Retail Trade Rules" 2014 Amendment no. 738, quality goods purchased remotely (via the Internet, telephone) may be returned within 14 days, in accordance with the procedure established in Articles 6.22810 and 6.22811 of the Civil Code.
If you notice that the books are of poor quality after receiving your order, please contact us immediately. We will change a low-quality product to a quality one at our own expense. Partial compensation or a refund of all money paid can only be claimed if the returned goods are in exactly the condition you received - in the original packaging, undamaged, unused and without losing their commercial appearance, or if the goods cannot be replaced.
We guarantee the return of all money paid, including delivery costs. When returning the goods, you pay only the direct costs of returning the goods.
No refunds will be given for goods that have been damaged intentionally or through negligence, or that have been used improperly or improperly.
Bookshop  
Purchase and sale rules
© Akademikai, 2023


text:
Client Value & Strategic Pricing
Firm Blogs
Britt K. Latham
blatham@bassberry.com
https://www.bassberry.com/professionals/latham-britt-k/
Visiting, or interacting with, this website does not constitute an attorney-client relationship. Although we are always interested in hearing from visitors to our website, we cannot accept representation on a new matter from either existing clients or new clients until we know that we do not have a conflict of interest that would prevent us from doing so. Therefore, please do not send us any information about any new matter that may involve a potential legal representation until we have confirmed that a conflict of interest does not exist and we have expressly agreed in writing to the representation. Until there is such an agreement, we will not be deemed to have given you any advice, any information you send may not be deemed privileged and confidential, and we may be able to represent adverse parties.
Until February 2016, Britt served as the chair of the firm's Litigation & Dispute Resolution Practice Group, and he currently serves as co-chair of the firm's Securities & Shareholder Litigation Practice Group. Britt has been involved in numerous high profile cases, including notably the successful representation of a public company involving the breach of a $1.5 billion merger agreement, and in significant federal securities, ERISA, and derivative multi-district litigation related to an investment fund loss in the wake of the financial crisis.
Britt represents public companies, their directors and senior management in complex securities class actions, merger class actions, and other types of business disputes, as well as advising public and private clients involved in internal investigations. He has protected the interests of clients in more than 50 class actions in various states, with billions in potential exposure.
Until February 2016, Britt Latham served as the chair of the firm's Litigation & Dispute Resolution Practice Group, and he currently serves as co-chair of the firm's Securities & Shareholder Litigation Practice Group. Britt has been involved in numerous high profile cases, including notably the successful representation of a public company involving the breach of a $1.5 billion merger agreement, and in significant federal securities, ERISA, and derivative multi-district litigation related to an investment fund loss in the wake of the financial crisis.
Britt represents public companies, their directors and senior management in complex securities class actions, merger class actions, other types of business disputes, and investigations before the Securities & Exchange Commission and other federal agencies. He has protected the interests of clients in more than 50 class actions in various states, with billions in potential exposure.
More specifically, Britt's practice encompasses:
Securities & Shareholder Litigation – Representing corporate defendants in securities and business-related litigation, including class actions, shareholder disputes and derivative actions in state and federal court, in mediation and in pre-litigation work-outs.
Compliance & Government Investigations – Conducting internal investigations for public and private companies; representing companies under civil or administrative investigation from various federal agencies, including the Securities and Exchange Commission, the Office of the Inspector General and the Department of Justice.
Healthcare Litigation – Representing hospitals and health systems and other healthcare-related entities in litigation and in connection with internal investigations and responding to government inquiries.
Prior to joining Bass, Berry & Sims, Britt practiced for 10 years with an international law firm in Dallas, Texas.
Nashville Bar Association — Federal Court Committee
American Health Lawyers Association (AHLA)
Case of First Impression for Morgan Keegan
Successfully argued issue of first impression under the Securities Litigation Uniform Standards Act before the U.S. Court of Appeals for the Sixth Circuit
We successfully argued issue of first impression under the Securities Litigation Uniform Standards Act before the U.S. Court of Appeals...
Client Type: Public Company
Open-End Fund, Closed-End Fund and ERISA Litigation for Morgan Keegan
Served as lead counsel for Morgan Keegan and related entities in Federal securities, ERISA and derivative multi-district litigation related to investment company losses in the wake of the credit crisis
We served as lead counsel for Morgan Keegan and related entities in Federal securities, ERISA and derivative multi-district litigation related...
Successful Defense of SEC Investigation into Accounting and Disclosure Issues
Successful representation of a public company in an 18-month Securities & Exchange Commission (SEC) investigation related to accounting and disclosure issues, resulting in a decision by the SEC to terminate the investigation
We successfully represented a public company in an 18-month Securities & Exchange Commission (SEC) investigation related to accounting and disclosure...
Successful Defense of SEC Investigation into Alleged Improper Accounting Practices
Successfully represented a company in a confidential Securities & Exchange Commission (SEC) investigation arising from a former employee's complaint about allegedly improper accounting practices
We successfully represented a company in a confidential Securities & Exchange Commission (SEC) investigation arising from a former employee's complaint...
Client Type: Private Company
Defense of Ruby Tuesday in Federal Securities Fraud Class Action
Represent Ruby Tuesday and certain named officers in a putative class action alleging violations of Sections 10(b) and 20(a) of the Securities Exchange Act of 1934
We represent Ruby Tuesday and certain named officers in a putative class action alleging violations of Sections 10(b) and 20(a)...
Representation of Hospital Ownership Company: U.S. ex rel. Frazier v. IASIS Healthcare Corp. (D. Ariz.)
Representation of IASIS Healthcare Corporation and its hospitals in DOJ/HHS-OIG investigation into allegations of Anti-Kickback Statute, the Stark Law, and medical necessity of certain medical procedures, resulting in declination of intervention by the government and district court's dismissal of action and sanctioning of relator's counsel
We represented a multi-state hospital ownership company in a multi-year Department of Justice (DOJ) investigation involving hospitals located in Texas,...
Sixth Circuit Affirms Dismissal for Morgan Keegan & Co. in Case of First Impression
Represented Morgan Keegan & Co. in cases brought by investors in certain Morgan Keegan Funds stemming from investment fund company losses
We represented Morgan Keegan & Co. in two cases brought by individual investors in certain Morgan Keegan Funds stemming from...
Texas Pharmacies Seek More Than $15 Million in Prompt Pay Penalties
Assisted in the early and successful resolution of 47 arbitration claims under the Texas Prompt Pay laws brought by pharmacies against a pharmacy benefit manager
We assisted in the early and successful resolution of 47 arbitration claims under the Texas Prompt Pay laws brought by...
U.S. ex rel. Hobbs v. MedQuest Associates
Representation of MedQuest Associates in FCA action involving billing for diagnostic services, resulting in summary judgment on behalf of MedQuest and key Sixth Circuit opinion on FCA issues
We successfully represented MedQuest Associates, Inc., a Georgia-based owner of diagnostic imaging facilities, in FCA litigation against the United States...
J. Alexander's Successfully Defends Activist Campaign by Privet Fund LP
Counseled J. Alexander's Corporation in response to the significant stock accumulation and activist campaign led by Privet Fund LP and its associates during 2012
We counseled J. Alexander's Corporation in response to the significant stock accumulation and activist campaign led by Privet Fund LP...
Delaware Court Provides Guidance for Books and Records Demands to Limit Producing Electronic Data to Stockholders
Don't Let Spoofing Fool You – SEC Says Internal Accounting Controls Should Address Cyber Threats
Shayne Clinton and Britt Latham Discuss Impact of Supreme Court's Decision in Cyan
Compliance & Government Investigations Update
September 13, 2018	| Nashville, Tennessee
Bass, Berry & Sims
Methods for Resolution of Indemnification Disputes
April 28, 2017	| Nashville, Tennessee
Business Law Forum 2017
Settlement Best Practices
Media Mentions & Firm News
Chambers USA 2019 Recognizes 45 Firm Attorneys; Healthcare Practice Ranked Nationally for Fourth Straight Year
Britt Latham Discusses Newest Development in Ongoing Conflict Between SEC and Elon Musk
Britt Latham Comments on Elon Musk's Response to SEC's Claims of Social Media Violation
Chambers USA — Litigation: General Commercial (2016-2019)
Best Lawyers in America® — Commercial Litigation (2013-2019)
Mid-South Super Lawyers (2014-2018)
Benchmark Litigation — Local Litigation Star: Tennessee (2019); Future Star: Tennessee (2010-2018)
Martindale-Hubbell — AV Preeminent® Peer Review Rated
Compliance & Government Investigations
Securities & Shareholder Litigation
Securities Enforcement & Compliance
Healthcare Fraud & Abuse
Duke University School of Law - J.D., 1993
with honors
Centre College - B.A., 1990
Tennessee, 2003
Texas (inactive), 1993
U.S. Supreme Court, 2014
U.S. District Court, Western District of Tennessee, 2011
U.S. District Court, Eastern District of Tennessee, 2004
U.S. District Court, Middle District of Tennessee, 2004
U.S. Court of Appeals, Fifth Circuit, 2002
U.S. District Court, Western District of Texas, 1999
U.S. District Court, Eastern District of Texas, 1995
U.S. District Court, Southern District of Texas, 1994
U.S. District Court, Northern District of Texas, 1994
"Co-chair of the firm's securities and shareholder litigation group Britt Latham routinely represents clients in civil litigation, including M&A disputes and class actions. Sources describe him as a 'very good lawyer' who 'can handle complex disputes.'"
From Chambers USA 2019
Healthcare Disputes
Regulatory & Administrative Proceedings
Sports & Media
Lex Mundi
SCG Legal
Copyright © 2019 Bass, Berry & Sims PLC.
@BassBerrySims
@BassBerryHealth
@BassBerryHRLaw


Were you there for the whole Grand Theft Auto V rollercoaster? Back when Online was first released last year, and was a horrifying buggy shitstorm that crashed and burned because the whole effing world was trying to play the same tutorial level simultaneously?
Then you'll feel the pain of the GTA extremists. The renegade band of no-goodniks who broke into Rockstar HQ at 4am and shat on the desks because where are our damn heists?
They were among the biggest new features of the fifth game. An entirely new, multi-faceted sort of mission, offering payouts beyond anything the series has offered so far. For many of us, heists were one of the main draws of Grand Theft Auto Online. These are real criminal-mastermind-y tactical jobs, and the chance to try them out in co-op was what we all signed up for.
And now, finally, they're close enough to smell. Still TBA (early 2015), sure, but there's a trailer now. Trailers, as we know, mean effing business. Check it out below, courtesy of IGN.


text:
Q: ¿Cómo generar una clausula para una función de agregación SUM()? Me pasa que tengo que realizar un ejercicio en el cual debo generar dos columnas basadas en una función de agregación (sum) y cada una es según un código que comparten en común esta tabla y otra en la cual sólo hay dos registros (1 que correspondería a "Abono" y 2 a "Rescates")
SELECT
      UPPER(TO_CHAR(CLI.NUMRUN,'09G999G999') || '-' || CLI.DVRUN) AS "RUN CLIENTE",
      INITCAP(CLI.PNOMBRE || ' ' || CLI.SNOMBRE || ' ' || CLI.APPATERNO || ' ' || CLI.APMATERNO) AS "NOMBRE CLIENTE",
      SUM(MO.MONTO_MOVIMIENTO) AS "ABONOS",
      SUM(MO.MONTO_MOVIMIENTO) AS "RESCATES"
FROM
      CLIENTE CLI JOIN MOVIMIENTO MO
      ON (CLI.NRO_CLIENTE = MO.NRO_CLIENTE)
GROUP BY
      CLI.NUMRUN,
      CLI.DVRUN,
      CLI.PNOMBRE,
      CLI.SNOMBRE,
      CLI.APPATERNO,
      CLI.APMATERNO;

Lo que busco realizar es colocar una clausula WHERE para "ABONOS" Y "RESCATES" donde una sume sólo las del código X mientras que la otra sólo las del código Y.

A: Te serviría usar el case...when:
select upper(to_char(cli.numrun, '09G999G999')
             || '-'
             || cli.dvrun)       as "RUN CLIENTE",
       initcap(cli.pnombre
               || ' '
               || cli.snombre
               || ' '
               || cli.appaterno
               || ' '
               || cli.apmaterno) as "NOMBRE CLIENTE",
       sum(case
             when tucodigo = 'x' then mo.monto_movimiento
             else 0
           end)                  as "ABONOS",
       sum(case
             when tucodigo = 'y' then mo.monto_movimiento
             else 0
           end)                  as "RESCATES"
from   cliente cli
       join movimiento mo
         on ( cli.nro_cliente = mo.nro_cliente )
group  by cli.numrun,
          cli.dvrun,
          cli.pnombre,
          cli.snombre,
          cli.appaterno,
          cli.apmaterno;


American Apparel Cotton Spandex crop top this is a very comfortable crop top, it can be worn as a sports bra to give extra support or as a top to be worn in the gym or for leisure. It is made from 95% cotton/spandex jersey and 5% elastane. It has the following features a scooped front and back neckline and double needle stitching throughout. Colour wise, there is black and white available and sizes start at extra-small and go up to large.


text:
About 60 support group occupying Coco Palms after police issue trespass notices
By Alden Alayvilla - The Garden Island | Saturday, May 13, 2017, 2 a.m.
WAILUA — A day after a group of people occupying Coco Palms were issued trespassing notices, about 60 people gathered to show support.
"We don't know what to expect right now. They came here yesterday like bullies. KPD has done jobs that were good, but right now this was not some place they should be. There's worse things going on," said Kimberly Souza, one of 15 people issued notices on Thursday. "Now we're standing up for what is right. Living here has made me peaceful and it's given me an understanding of life and full circle — spirituality."
According to Kauai County spokeswoman Sarah Blane, a Coco Palms property owner filed a complaint, prompting police to issue the notices. No arrests were made nor was anyone escorted off property, she said.
Kamuela Kapule O Kamehameha, who said he is a descendant of Queen Deborah Kapule, said the notice gave the group 24 hours to vacate.
Police, however, didn't show up Friday afternoon.
Joseph Kekauliki Kamai was surprised when police gave out notices around midday Thursday.
"We're not rich like the guy who has the hotel. These guys can pay for whatever they need. They should understand that the land rightfully belong to our families. We are the heirs to the throne," he said. "We have the right to claim what belongs to our families. They're going to push the issue to get everybody out. We've invested our blood and our sweat to this land to help and clean and take care of our iwi kupuna."
Other recent trespass complaints at Coco Palms were reported to KPD on Feb. 11 and March 11, Blane said.
State officials said the state land is leased to Coco Palms.
Tyler Greene, co-owner of Coco Palms Hui, said the county recognizes Coco Palms Hui as the owners of the land. He did not respond to requests for comment Friday. He previously told The Garden Island there were trespassers at Coco Palms and he was working with the county prosecutor's office on the matter.
Kapule O Kamehameha said he and his ohana have a royal patent called Palapala Sila Nui, which they say gives their family the rights to the land in perpetuity.
The group of about 25 of his formerly homeless family members continue to live on 17 acres of land on Coco Palms property.
Since taking up residence on the property, Kapule O Kamehameha said the group has been farming, fishing and clearing brush.
"It's weird how our people are homeless in our own home," he said. "All the kalo and all the cleanup is all by our hard work, by hand, our sweat. The kalo is to feed our society, our people, our community."
Kapule O Kamehameha said it's his kuleana to restore and perpetuate the culture.
"We're doing all cultural practices which is legal, like restoring our fishponds that we have here by my grandma Queen Deborah Kapule," he said.
Greene and his partner, Chad Waters, have been trying to restore Coco Palms since 2012. The resort closed in 1992 after it was damaged by Hurricane Iniki.
During public hearings on the Coco Palms restoration project, and decades prior as it sat shuttered, no one claimed land ownership.
The $3.5 million selective demolition process began in June. By spring 2018 crews are expected to start Phase II, renovation and reconstruction, of Coco Palms.
The $175 million project will boast 350 rooms, 12,000 square feet of retail space, three restaurants, leisure areas and a four-acre cultural center.
Kamai, who resides on the property, said it will be hard to let go if evicted.
"It's not right for them to be doing what they're doing," he said. "We're trying to grow our medicine, growing food for our people and we're taking care of the iwi kupuna. What have we done wrong? We're doing what we're supposed to do."
Kalamaok'aina Niheu supported the group on Friday.
"All the land in Hawaii are under contest. There's certain places like this. You look at the raw material struggles and trauma our people are going through right now," she said. "When the people stand up and create their own systems of healing, their own strategies of moving forward, they always crack down on us, oppress us, rip us off of these solutions."
Kapule O Kamehameha hopes to solve the matter in civil court.
"Give us the fighting chance in court that we're in. On May 17, we're going to see what happens," he said. "If the alternative happens, we will get off."
Council reduces budget by $2 million
KIUC sponsors energy conservation workshops