text:
Q: PLS-00323 error in oracle I am creating a procedure in a package. I have updated the specification of the package and then when i am updating the body of the package it shows me the following error.

[Error] PLS-00323 (314: 13): PLS-00323: subprogram or cursor 'INSERT_CUSTOMER_ADDRESS' is declared in a package specification and must be defined in the package body

N.B.: INSERT_CUSTOMER_ADDRESS is my procedure name.

A: If you create a procedure in the package specification it must be created\implemented in the package body. Consider your package specification as an interface and the package body as its implementation.

A: Always the declaration on the pkg spec and the pkg body should be same.
Which means the procedure / function declared in pkg spec ( includes name of the procedure / function , Parameter type ) should be exactly same.
Note : when oracle compiles the pkg for above error case, it won't give you the exact line no.

A: Specification :  FUNCTION ITEM_ACTIVE(SKU_NUM IN NUMBER) RETURN BOOLEAN;
Body : FUNCTION ITEM_ACTIVE(P_SKU_NUM IN NUMBER) RETURN BOOLEAN;
Change either specification or body to match exact.
HTH!

A: Because somebody's old errors are always news to me, I'll add my 3 cents:
Someone deleted their spec, but still had the body (No, I don't know how) and they "didn't want to have to type all that back in".
So I showed them how to generate the spec from the body:

*

*Copy the body into a worksheet.

*Insert an empty header above the body with the name of the package.

*Compile.

*[Whether you get an error or not,] Right click on the package body in the Packages tree, and select "Synchronize Specification and Body".

*Select which objects to expose in the spec and click OK.

*"magic happens"

Only magic didn't happen -- and everything went red...  with PLS-00323 errors.
SQL Developer populates the package spec by pulling the procedure and function headers from the code itself, so you shouldn't have to worry about things liek pselling.  It presents a list of objects to add to the package/spec, and you choose which ones to add.
We selected the correct procedures and functions, but it compiled with errors.  Again.  And, again.
It turns out that the functions that threw errors were defined in the package body with DETERMINISTIC -- when SQL Dev's editor did the synchronization, it left out the word.  That's pretty significant.
Anyway, reviewed, pasted DETERMINISTIC in the specific functions before the semi-colon, saved (recompiled), and then it was magic again.
You would expect SQL Developer to do the full job, instead of a half-... job.


text:
Q: Ruby: add new fields to YAML file I've been searching around for a bit and couldn't find anything that really helped me. Especially because sometimes things don't seem to be consistant.
I have the following YAML that I use to store data/ configuration stuff:
---
global:
  name: Core Config
  cfg_version: 0.0.1
  databases:
    main_database:
      name: Main
      path: ~/Documents/main.reevault
      read_only: false

    ...

I know how to update fields with:
cfg = YAML.load_file("test.yml")
cfg['global']['name'] = 'New Name'
File.open("test.yml", "w"){ |f| YAML.dump(cfg, f) }

And that's essentially everybody on the internet talks about. However here is my problem: I want to dynamically be able to add new fields to that file. e.g. under the "databases" section have a "secondary_db" field with it's own name, path and read_only boolean. I would have expected to do that by just adding stuff to the hash:
cfg['global']['databases']['second_db'] = nil
cfg['global']['databases']['second_db']['name'] = "Secondary Database"
cfg['global']['databases']['second_db']['path'] = "http://someurl.remote/blob/db.reevault"
cfg['global']['databases']['second_db']['read_only'] = "true"
File.open("test.yml", "w"){ |f| YAML.dump(cfg, f) }

But I get this error:
`<main>': undefined method `[]=' for nil:NilClass (NoMethodError)

My question now is: how do I do this? Is there a way with the YAML interface? Or do I have to write stuff into the file manually? I would prefer something via the YAML module as it takes care of formatting/ indentation for me.
Hope someone can help me.

A: Yo have to initialize cfg['global']['database']['second_db'] to be a hash not nil. Try this cfg['global']['database']['second_db'] = {}

redpajama_set_name: RedPajamaStackExchange


text:
Q: Need to create abundance values using two columns from different sized data frames based on a common variable in the two data frames I have two data frames "Phylum.MYS" (68 x 5) and "Benthic" (13 x 5)
My goal is to make an "abundance" column in "Phylum.MYS" --> "Phylum.MYS$abundace"
This column would hold the abundance values of each variable in "Phylum.MYS$Phylum" by doing --> "Phylum.MYS$count" / "Benthic$Count" based on if "Phlyum$Month_year" == "Benthic$Month_Year.y"
Appreciate the help!
> head(Phylum.MYS)
  Month_Year     Phylum Count Salinity     Date
1    2000-06   Nemertea     6 18.27130 Jun-2000
2    2000-06  Phoronida     2 18.27130 Jun-2000
3    2000-06   Annelida    45 18.27130 Jun-2000
4    2000-06 Arthropoda     9 18.27130 Jun-2000
5    2000-06   Mollusca     2 18.27130 Jun-2000
6    2000-09   Nemertea     2 20.72727 Sep-2000
> head(Benthic)
      Date Month_Year.x Salinity Month_Year.y Count
1 Jun-2000      2000-06 18.27130      2000-06    66
2 Sep-2000      2000-09 20.72727      2000-09    61
3 Jun-2001      2001-06 18.33818      2001-06    62
4 Sep-2001      2001-09 20.95091      2001-09   115
5 Jun-2002      2002-06 20.74917      2002-06    65
6 Jun-2003      2003-06 15.62000      2003-06    81

A: Is this what you are looking for?
library(data.table)
Phylum.MYS <- data.table(Month_Year = c('2000-06','2000-06','2000-06','2000-06','2000-06','2000-09'),
                         Phylum = c('Nemertea','Phoronida','Annelida','Arthropoda','Mollusca','Nemertea'),
                         Count = c(6,2,45,9,2,2))

Benthic <- data.table(Month_Year.y = c('2000-06','2000-09','2001-06','2001-09','2002-06','2003-06'),
                      Count = c(66,61,62,115,65,81))

Phylum.MYS <- merge(Phylum.MYS, Benthic, by.x = 'Month_Year', by.y = 'Month_Year.y',all = TRUE)

Phylum.MYS[, abundance := (Count.x/Count.y)]
Phylum.MYS


text:
Q: Adsense Host Api start associated Session redirect to main page I try to make authorization with adsesnse Host Api and I have working code to generate url to authorization which redirect to login/register in adsense but after login/register i am redirecting to main page of my site I want to redirect to custom address to make verify. How can I set redirect url after register process?
I use Google Host api library for google Adsense Host Api

A: If you are using a client_secrets.json file the redirectUrl is probably set there. It can also be set directly in the code.
Be sure you change/add the new redirect location using console.developers.google.com before you change it locally - it can take a while (tens of minutes) for changes here to take effect.
Edit: OK - wrong redirect sorry.  For that one you will need to contact Adsense and ask them to update your landing page url.


text:
Q: Avoid rebuilding index through jdbc-river on elasticsearch I am using the following:

ElasticSearch – v0.90.9
JDBC connector for MySQL – v5.1.28
ElasticSearch River – v2.3.1

I am able to build and query the indexed data using ElasticSearch. The above mentioned versions are installed on Ubuntu 12.04 LTS virtual machine and ElasticSearch runs as a service which starts automatically after a system reboot.
Let us say that when there are no indices and I use ElasticSearch River to build a new index and issue a PUT command to build index, the index is built and everything works fine. Now, the issue is this index is rebuilt again when I shutdown the virtual machine and restart it again. I find this annoying and is there a way to prevent automatic rebuild of index?
Is there something with ElasticSearch River or ElasticSearch settings that I should be aware of to prevent automatic index rebuild? In my case this is causing duplicates.
Thanks in advance.

A: The only way I have found to stop it re-indexing is to delete the river document after it has run.
However, if the issue you have is that documents are duplicated, what you would need to do is identify an id field. There are two ways to do this, either import the data with a field labeled "_id" or by identifying an id field when you create the mapping for that index which identifies the id field like the example below.
PUT my_index
{
    "settings": {
        "number_of_shards": 1,
        "number_of_replicas": 3
    },
    "mappings": {
        "my_type": {
            "properties":{
                "field1": { "type": "string", "analyzer": "keyword" }
        },
        "_id": { "path": "field1" }
    }
}


text:
Q: How to make an Ubuntu installation on external HDD boot on any system? When installing Ubuntu 12.04 to an external HDD using Ubiquity, it installs GRUB2 to that HDD. Such installation works fine on the machine on which it was created, but on any other machine everything just hangs up after loading the initial ramdisk. The machine shows black screen and no disk activity goes on.
I suspect this is caused by some configs being dependent on "global" device enumeration which is different on different machines, or something else gets machine-dependent. How do I avoid that? Shall I generate a more generic initial ramdisk somehow? Or perhaps using syslinux instead of GRUB2 will help?

A: *

*If you installed ubuntu and grub in external HDD,
just open up the bios and choose externel HDD as primary boot device. It will boot.

*If you have installed ubuntu in external HDD and GRUB in internal HDD,
you need to install grub in external HDD and follow whatever I said above.

A: While installing Ubuntu on external HDD, please select grub location to external HDD mostly /dev/sdb..
I am running Ubuntu 12.04 500GB USB HDD. I have tested running Ubuntu on different NB & it is running successfully. Note: Need to select first boot device as external HDD, when you connect this on other machines.


text:
Q: IntelliJ IDEA SSH configuration : Sessionfactory cannot be create successfully When I try to use the Persistence tool to generate Java classes and persistence metadata for the database schema, an error message shows up:

"Please choose persistence  unit"

But in the spring-config.xml, <bean id="sessionFactory"/> has been created by the tool. I don't know what is wrong.
A picture of this error:


text:
Q: Carregando post do subdominio no domínio principal? Tenho uma instalação do Wordpress MU. Alguém poderia me dizer como eu faço pra carregar posts de um blog no subdominio no meu domínio principal?

A: É só questão de usar a função switch_to_blog() e alternar para o blog desejado, fazer uma query de consulta dos blog posts e usar a mesma função para alternar de volta ao blog original.
Crie um plugin Must Use (sempre ativo e disponível em toda a rede) e coloque o seguinte código:
if( !function_exists('get_blog_posts') )
{
    function get_blog_posts( $blog_id, $args = array() )
    {
        $current_blog_id = get_current_blog_id();
        switch_to_blog( $blog_id );

        $posts = get_posts( $args );
        switch_to_blog( $current_blog_id ); // get_posts já foi feito, podemos restaurar

        if( $posts )
            return $posts;

        return false;
    }
}

Depois, no template do theme ou em alguma função dentro de functions.php, use o seguinte, ajustando o $blog_id_consultar e os $parametros. Note que echo print_r() é só para verificação, faça um loop de $posts_do_blog para imprimir o HTML:
<?php
if( function_exists('get_blog_posts') ) {
    $blog_id_consultar = '3';
    $parametros = array(); // VIDE http://codex.wordpress.org/Function_Reference/get_posts
    $posts_do_blog = get_blog_posts( $blog_id_consultar, $parametros );
    if( $posts_do_blog ) {
        echo '
' . print_r( $posts_do_blog, true ) . '
';
    }
}
?>

A: <?php
query_posts('showposts=4'); //Query WordPress para listar os últimos 4 posts
?>
<?php while (have_posts ()): the_post(); ?>

        <a href="<?php the_permalink(); ?>"><?php the_title(); ?>

<?php the_author(); ?> | <?php the_date(); ?>
<?php the_post_thumbnail('thumbnail', array('class' => 'alignleft')); ?>
    <?php the_excerpt(); ?>
<?php endwhile; ?>

Estou usando este código, quero que ele carregue os posts  de outro blog do WordPress.


text:
Q: InnerHtml and InnerText ASPX doesn work I have a aspx file wich contain:
<form id="form1" runat="server">

bla bla
..

The data in table is introduced using Javascript  and/or JScript.
In C# code, when I try to mail this data using :
a = ".." + idex.InnerHtml.ToString() + "..";

b = "-" + idex.InnerText.ToString() + "-";

a is always "...." and b is always "--". The assignation is done in click method of a button, so after all elements of table/span have some content. How can I get the content? and where to place code?
Solutin
Content generated with Javascript can be taken just if for display are used input fields.

A: InnerHtml will get inner html of the tag and in your question you are getting InnerHtml of span  but there is nothing inside the tag so thats why it will return nothing. let suppose i want   and inner html of table so i will do something

bla bla	asdfasdf

i used div because you cannot get innerhtml of table so in code behind
var html= idex.InnerHtml;

now it will return everything in div

A: As per my understanding from question you are trying to access span tag value in your code behind. you can get span tag text from both "InnerHtml" and "InnerText".
Here is tested code of .aspx and its .cs file for same.
Default.aspx:
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html>

    <title></title>

    <form id="form1" runat="server">

	my content

        Inner Html= <asp:Label ID="lblSpanInnerHtml" runat="server"></asp:Label>

        Inner Text= <asp:Label ID="lblSpanInnerText" runat="server"></asp:Label>

    </form>

Default.aspx.cs:
using System;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if(!IsPostBack)
        {
            lblSpanInnerHtml.Text = idex.InnerHtml;
            lblSpanInnerText.Text = idex.InnerText;
        }
    }
}

A: Your problem extends from a misunderstanding of the request-response process. Only form elements are posted back to the server. Asp.net webforms get fancy and maintains some state info in a hidden form field called ViewState.
Anything dynamically added to non-form elements via javascript are essentially invisible to the server side code. You need another way to transfer that data back to the server. The easiest way to do this is to also populate that data into a hidden form element and retrieve that value server side.
E.g.

    my content
    <input type="hidden" id="hdnIdx" value="my content">

Then you populate the hidden field by modifying your existing javascript.
Then serverside get the value
lblSpanInnerText.Text = idex.Value;


text:
Q: Access 2010 - Providing the FE to Users I have an Access database I split into backend and front end.  I want to share the Front End with users; however, I don't want them to have all the queries I use (not useful to them).  Can I hide my queries from them? Or will I need to save the Front End four different ways, one for each of my users?

A: The front end is a separate database file that links to your back-end database tables.
Create a front-end with the items you want users to have access to and save it. There is no reason to create a file for each user. They can each have a copy of the same FE file.
What I did was copy the FE file I already had and stripped out all the objects I didn't want the users to have access to, removed menu selections and saved the file.
On a side note, you can also create a unique FE file for yourself with different content. I have done this with several databases in order for various user levels to have different FE files so they can only access what they need. My files as all the objects, where another has only a few forms the users needs to input data.


text:
Q: Pandas group by consecutive numbers I'm dealing with a DataFrame like this:
n_days    probability
 0            0.01
 17           0.1
 18           0.11
 19           0.12
 40           0.2
 41           0.21

I want to group consecutive numbers and get the mean probability of each group, like this:
n_days     mean_probability
  0           0.01
 17-19        0.11
 40-41        0.205

Formatting on the n_days isn't too relevant.
I tried something like:
df['diff_days'] = df.n_days - df.n_days.shift()

And then:
df.diff_days.eq(1)

Which brings this boolean:
n_days    probability   bool_eq
 0            0.01       False
 17           0.1        False
 18           0.11       True
 19           0.12       True
 40           0.2        False
 41           0.21       True

Which seems to be a step forward, but I'm not sure how to follow up. Each False would be the start of each group, but how would I catch the whole group?
Any help would be appreciated. Thanks.

A: You could use pd.cut + DataFrame.groupby:
mean_probability=df.groupby(pd.cut(df.n_days,len(df)//2)).probability.mean()

n_days
(-0.041, 13.667]    0.010
(13.667, 27.333]    0.110
(27.333, 41.0]      0.205
Name: probability, dtype: float64

A: You can group on pd.cut bins.  Note that each bin is from but excluding the first value to and including the last value, e.g. (16-19] is equivalent to [17-19] where the column consists of integers.
bins = [-1, 0, 16, 19, 39, 41]
>>> df.groupby(
        pd.cut(df['n_days'], bins))['probability'].mean().dropna()
n_days
(-1, 0]     0.010
(16, 19]    0.110
(39, 41]    0.205
Name: probability, dtype: float64


text:
Q: How to create the dropdwon side navbar? when I click the next button, how to activate/open the next dropdown in the side navbar. if I click the previous button, how to open the previous dropdown in the side navbar.

A:

            <button class="dropbtn">Dropdown

        </button>

            Link 1
                Link 2
            Link 3

body {
  font-family: Arial, Helvetica, sans-serif;
}

.navbar {
  overflow: hidden;
  background-color: #333;
}

.navbar a {
  float: left;
  font-size: 16px;
  color: white;
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
}

.dropdown {
  float: left;
  overflow: hidden;
}

.dropdown .dropbtn {
  font-size: 16px;
  border: none;
  outline: none;
  color: white;
  padding: 14px 16px;
  background-color: inherit;
  font-family: inherit;
  margin: 0;
}

.navbar a:hover, .dropdown:hover .dropbtn {
  background-color: red;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: #f9f9f9;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  z-index: 1;
}

.dropdown-content a {
  float: none;
  color: black;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  text-align: left;
}

.dropdown-content a:hover {
  background-color: #ddd;
}

.dropdown:hover .dropdown-content {
  display: block;
}


text:
Q: Deleting the document from Firebase with unique id The below is the useEffect and the function which adds a comment (document) to the firebase
const postComment = (event) => {
            event.preventDefault()
            db.collection("posts").doc(postId).collection("comments").add({
            caption: comment,
            header: signInUser.displayName,
            timestamp: firebase.firestore.FieldValue.serverTimestamp()
        });
        setComment('');
    }
    useEffect(() => {
        let unsubscribe;
        if(postId){
            unsubscribe = db
            .collection("posts")
            .doc(postId)
            .collection('comments')
            .orderBy('timestamp', 'asc')
            .onSnapshot((snapshot)=>{
                setComments(snapshot.docs.map((doc) =>{
                    return{
                    commentIdTest : doc.id,
                    commentTest: doc.data()
                    }}
                ));
            });
        }
        return () => {
            unsubscribe();
        }
    }, [postId]);

Below is the react return function where I am mapping through the list of Comments
{comments.map((comment)=>(

                        {comment.commentTest.header} {comment.commentTest.caption}

<Button onClick={deletingComment}>X</Button>

            ))}

I want to delete the comment from firebase on click of the button which I have made above and the function for deleting the comment is below**
const deletingComment =(e, commentIdTest) =>{
        e.stopPropagation();
        db.collection("posts").doc(postId).collection('comments').orderBy('timestamp').get()
         .then((querySnapshot)=>{
            querySnapshot.forEach(function (doc){
                 doc.ref.delete();
            })
         });
    }

with the above function it is deleting the whole collection when I only want to delete the comment which is clicked.

A: You need to specify the id of the comment you want to delete and change the code to something like this:
const deletingComment = (e, commentId) => {
  e.stopPropagation();
  db.collection("posts")
    .doc(postId)
    .collection("comments")
    .doc(commentId)
    .delete();
};


text:
Q: What is overclocking the system? I have heard this term many time and would like to know what does it exactly means?

A:
Overclocking is the process of running
  a computer component at a higher clock
  rate (more clock cycles per second)
  than it was designed for or was
  specified by the manufacturer, usually
  practiced by enthusiasts seeking an
  increase in the performance of their
  computers. Some of them purchase
  low-end computer components which they
  then overclock to higher speeds, or
  overclock high-end components to
  attain levels of performance beyond
  the specified values. Others overclock
  outdated components to keep pace with
  new system requirements, rather than
  purchasing new hardware.

http://en.wikipedia.org/wiki/Overclocking
Overclocking any component comes with inherent risks. Generally running anything faster will cause the heat to be greater, which can lead to a much higher failure rate. This is why most people will not tackle overclocking unless they are certain that their components are tolerant enough of the changes (and even then will only up the speeds in small increments) and will have good cooling systems in place to help mitigate the problem of heat.

A: In addition to what TheTXI posted...
You are running the hardware beyond its rated limits. It can void warranties and damage hardware. You can see weird errors depending on the issues. It varies from each combination of hardware. It is mainly for the hobbiest or someone who wants to take the risk to get that little extra performance out of their machine.

A: It basically means that people will alter the settings for their CPU (processor) to go faster than it was designed to do so. By increasing the CPU frequency, you're also obligated to change speed settings for RAM, the system bus and so on. So if you have an Intel or AMD processor that say runs at 2.0GHz, you can overclock that processor (depending on a few variables) to run at 2.3GHz or 2.4GHz.
Pros

*

*The good thing about overclocking is you can get better performance out of your computer without paying extra for a higher model. Most people who overclock are gamers, but I'm sure there are other uses for overclocking in computation and such.

Cons

*

*Heat - Faster CPU means more electricity which means more heat. Heat can kill computer systems. Improperly cooled and overclocked CPUs can die a lot faster than you think.

*Cost - In order to increase the speed, better cooling is necessary to dissipate the heat. From water coolers to fancy heatsink/fan solutions, you should put forth some money to address the heating problem.

*Possible Damage - People forget that by overclocking, you're going out of bounds for the manufacturer's specification. The extra work, electricity, heat can (over a period of time) damage your CPU. If you deal with heating properly your odds of damage decrease, but it's always a risk.

Personally, I don't overclock. It's a risk with little to no benefit that I can see. Others may feel differently, but I hope this answers your question.

A: Overclocking means running a component faster than the maker of your system intended. This can mean excessive heat and cooking things, or it can be no big deal. For example, 11 years ago, Intel stoped making the mobile Pentium 75 that Toshiba used in their Libretto 50ct micro laptop, so Toshiba substituted the P120, and just undercloked it. If you had one of those, going to 120mhz would not be a big deal, and many could be overclocked to as much as 200mhz.
Often a manufacture will want, say , 1/3 at the highest speed, 1/3 middle, and 1/3 slow. Each will be tested only to meed the needed spec (though they may route the chips from the center of the wafer to the high speed group, for instance). This doesn't mean the slower stuff would not have qualified for the higher speeds, or that with a better heat sink they would have.
You can overclock with software (often this can be done for video cards), bios (your cpu/mb/ram), jumpers (old school for that), or hardware mods (cutting or replacing wires, changing clock chips, etc).


text:
Q: class prototype in c++ related query how to give a prototype for class in c++ if i want to declare after main()?
i wrote the following code fragment. i have refered to material available on cplusplus.com, i tried googling it but could not find anything useful.i by mistake the declared the class below main , but then i realised that i had not given a prototype for it and thus my program could not run.
#include<iostream.h>
#include<conio.h>

void main()
{
    student s;
    s.show();

    getch();
}

class student
{
    int age;
    public:
    void show();
};

void student::show()
{
    age = 5;
    cout << age;
}

A: You can't. student must be a complete type if you write student s;. A forward declaration is therefore not sufficient.
The obvious solution is to write the class declaration in a file called student.h and #include that at the top of the file that defines main().


text:
Q: Delay on redirect (Javascript) My JS wont cooperate and redirect... Can anyone see my problem? Tried all day, it's like nothing works :(
function validate(form) {
    if (form.username.value==="admin") {
        if (form.password.value==="1") {
            $('#loginLock').css({opacity: 0});
            $('#loginUnlock').css({opacity: 1});
            document.cookie="username=Admin";
            setTimeout(function(){ window.location.replace = 'vault.php';}, 1500);
        } else {
            alert("Forkert brugernavn eller password");
        }
    } else {
        alert("Forkert brugernavn eller password");
    }
}

A: You can use window.location.href
 setTimeout(function(){ window.location.href= 'vault.php';}, 1500);

instead of
setTimeout(function(){ window.location.replace = 'vault.php';}, 1500);

A: Use javascript's setTimeout method:
// redirect to google after 5 seconds
window.setTimeout(function() {
    window.location.href = 'http://www.google.com';
}, 5000);

A: Why are using window.location.replace? Maybe tha'ts the problem!
**assign(url):** Load the document at the provided URL.
**replace(url):** Replace the current document with the one at the provided URL. The difference from the  assign() method is that after using  replace() the current page will not be saved in session history, meaning the user won't be able to use the Back button to navigate to it.

Try using just windows.location.url = ""; And about usin jQuery, just use setTimeOut JS method. Don't mix if not necessary jQuery and Javascript


text:
Q: Why does this VBA code not make any changes to my excel sheet? I want this to code for where if I put yes into a rowJ,"brain?" beside rowG for gene(s) in sheet C  then it finds that gene in sheet B and puts yes in rowJ in sheet B.

A: Examining your Excel file on GitHub, I believe you are referring to method inbrain() in module Module3
(in the future, please include that info in your question).
I believe your typo resides on the cell.Offset(0, 3).Value = brainB line of this code block
    Dim mmc2 As Workbook: Set mmc2 = ThisWorkbook
    Dim shB As Worksheet
    Set shB = mmc2.Sheets("(B) Mouse thymocytes RAG1")
    Dim shC As Worksheet
    Set shC = mmc2.Sheets("(C) Mouse preB RAG1")

    Dim colG As Range
    Set colG = shC.Range("G3:G3388")

    For Each cell In colG
        Dim brain As String
        brain = cell.Offset(0, 3).Value

        Dim brainB As String

        If brain = "yes" Then
            Dim found As Range
            Set found = shB.Range("G3:G3537").Find(What:=cell.Value)

            If Not found Is Nothing Then
                brainB = "yes"
            End If
            cell.Offset(0, 3).Value = brainB
        End If
    Next cell

It should instead be cell.Offset(0, 4).Value = brainB
I would also expand the If statement to clear the cell if there is not a match, like this:
        If brain = "yes" Then
            Dim found As Range
            Set found = shB.Range("G3:G3537").Find(What:=cell.Value)

            If Not found Is Nothing Then
                brainB = "yes"
            End If
            cell.Offset(0, 4).Value = brainB
        Else
            cell.Offset(0, 4).Value = ""
        End If

A: The code that I wrote was putting "yes" where in sheet C where there was already a "yes."
To put "yes" in sheet B where value was found I used

found.Offset(0,3).Value

instead of

cell. Offset(0,3). Value


text:
Q: Rellich-Kondrachov variant for compact manifold with piecewise $C^1$ boundary? In this Wikipedia article, the Rellich-Kondrachov theorem says that whenever $M\subset\mathbb{R}^n$ is a compact manifold with $C^1$ boundary then
$W^{k,p}(M)$ embeds compactly in $W^{\ell,q}(M)$ if $k>\ell$ and $k-n/p>\ell-n/q$. Does a similar result follow for manifolds with piecewise $C^1$ boundary such as a rectangle?

A: I quote the following remark from "Aubin, Nonlinear Analysis on Manifolds. Monge-Ampère Equations":

2.35 Remark. We have given only the main results concerning the theorems of Sobolev and Kondrakov. These theorems are proved for the compact manifolds with Lipschitzian boundary in Aubin [17]..

[17] Aubin T.-Espaces de Sobolev sur les varietes Riemanniennes. Bull. Sc. Math. 100,
(1976) 149-173.


text:
Q: how to get src attribute from an image using requests and beautifulsoup in python I am trying to get src attributes of images from a website. The problem is that it returns some encoded text instead of the src. The encoded text is:
data:image/gif;base64,R0lGODdhFQAXAPAAANba3wAAACwAAAAAFQAXAAACFISPqcvtD6OctNqLs968+w+GolUAADs=

The website is here.
My code is:
import requests
from bs4 import BeautifulSoup as bs

url = 'https://www.redbubble.com/shop/shower-curtains?page={}'
count = 0

for page in range(1,205):
    response = requests.get(url.format(page))
    if response.ok:
        contents = bs(response.text , 'lxml')

        curtains = contents.find_all('a' , class_='styles__link--2sYi3')
        for curtain in curtains:

            count += 1
            name = curtain.find('span' , class_='styles__text--NLf2i styles__display6--uq_8G styles__block--3OueG').text.strip()
            price = curtain.find('span' , class_='styles__text--NLf2i styles__body--3bpp7 styles__block--3OueG').text.strip()

            image_url = curtain.find('img' , class_='styles__image--2CwxX styles__productImage--3ZNPD styles__rounded--1lyoH styles__fluid--3dxe-').get('src')

            print('*'*20 , count , '*'*20)
            print('Name: {}'.format(name))
            print('Price: {}'.format(price))
            print('Image Url: {}'.format(image_url))

How can i get the src attribute from an image, like this one:
https://ih1.redbubble.net/image.887440492.3733/ur,shower_curtain_closed,square,600x600.1u2.jpg

Every page contains above 100 images of products. The first 16 returns valid src link, while the rest return encoded text like the above one.

A: import requests
from bs4 import BeautifulSoup
import re
from prettytable import PrettyTable

site = "https://ih1.redbubble.net/image.{}/ur,shower_curtain_closed,square,600x600.1.jpg"

p = PrettyTable()
p.field_names = ["Name", "Price", "Url"]

def main(url):
    r = requests.get(url)
    soup = BeautifulSoup(r.content, 'html.parser')
    target = soup.select("img[class*=styles__rounded--1lyoH]")
    imgs = [img.group(1) for img in re.finditer(r'\.(\d+\.\d{4})', r.text)]
    goal = list(dict.fromkeys(imgs))
    for tar, go in zip(target, goal):
        p.add_row([tar['alt'], tar.find_all_next(
            "span")[3].text, site.format(go)])
    print(p)

main("https://www.redbubble.com/shop/shower-curtains/")

Output:
+----------------------------------------------------------------------------------------------------------------------------------------------+---------+-----------------------------------------------------------------------------------------------+
|                                                                     Name                                                                     |  Price  |                                              Url                                              |
+----------------------------------------------------------------------------------------------------------------------------------------------+---------+-----------------------------------------------------------------------------------------------+
|                                                              SOS Shower Curtain                                                              |  $54.49 | https://ih1.redbubble.net/image.1163488491.7606/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                       RETRO geometry 10 Shower Curtain                                                       |  $54.49 | https://ih1.redbubble.net/image.1157791579.0857/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                    Sphynx cat door knocker Shower Curtain                                                    |  $54.49 | https://ih1.redbubble.net/image.1164112971.2614/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                              VHS Shower Curtain                                                              |  $56.76 | https://ih1.redbubble.net/image.1166469289.0717/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                             Excuse Me, I'm Lost // Laid Back Edit Shower Curtain                                             |  $52.22 |  https://ih1.redbubble.net/image.659833984.4609/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                          Easy Tiger Shower Curtain                                                           |  $54.49 | https://ih1.redbubble.net/image.1094007186.3556/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                       MANEKI WASH BLUE Shower Curtain                                                        |  $59.03 |  https://ih1.redbubble.net/image.867564975.4912/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                        The Heart Of My Heart // So Far From Home Edit Shower Curtain                                         |  $52.22 |  https://ih1.redbubble.net/image.439063572.6873/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                       Blue Ocean Waves  Shower Curtain                                                       |  $54.49 |  https://ih1.redbubble.net/image.525733200.2528/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                           Candy Sky Shower Curtain                                                           |  $54.49 |  https://ih1.redbubble.net/image.906197994.7386/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                     The Great Wave of Pug Shower Curtain                                                     |  $54.49 |  https://ih1.redbubble.net/image.418461538.4822/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                          Cowboy Cats Shower Curtain                                                          |  $52.22 |  https://ih1.redbubble.net/image.966660248.9573/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                       Nine of Pentacles Shower Curtain                                                       | $113.53 |  https://ih1.redbubble.net/image.880070297.7728/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                        Moon River Lady Shower Curtain                                                        |  $54.49 |  https://ih1.redbubble.net/image.51953218.0964/ur,shower_curtain_closed,square,600x600.1.jpg  |
|                                                       Calming Mountain Shower Curtain                                                        |  $59.03 |  https://ih1.redbubble.net/image.353536208.3857/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                       Greympressionism Shower Curtain                                                        |  $54.49 |  https://ih1.redbubble.net/image.402792160.6730/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                          The Birches Shower Curtain                                                          |  $54.49 |  https://ih1.redbubble.net/image.887440492.3733/ur,shower_curtain_closed,square,600x600.1.jpg |
|              Preppy brushstroke free polka dots black and white spots dots dalmation animal spots design minimal Shower Curtain              |  $54.49 |  https://ih1.redbubble.net/image.60325696.5649/ur,shower_curtain_closed,square,600x600.1.jpg  |
|                                                      FANTASTIC BOTANICAL Shower Curtain                                                      |  $56.76 |  https://ih1.redbubble.net/image.431602480.0359/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                       Geometric Compilation in Rose Gold and Blush Pink Shower Curtain                                       |  $54.49 | https://ih1.redbubble.net/image.1115530718.0994/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                            Octopus Shower Curtain                                                            |  $54.49 |  https://ih1.redbubble.net/image.854031637.1962/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                        Suspicious Cats Shower Curtain                                                        |  $54.49 |  https://ih1.redbubble.net/image.815755503.6406/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                          Cuttlefish Shower Curtain                                                           |  $54.49 |  https://ih1.redbubble.net/image.843986335.8355/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                Aurora borealis over mountains Shower Curtain                                                 |  $54.49 | https://ih1.redbubble.net/image.1023977170.6148/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                    A Wilderness Somewhere Shower Curtain                                                     |  $52.22 |  https://ih1.redbubble.net/image.659807212.6173/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                     A Dreamful Existence Shower Curtain                                                      |  $54.49 |  https://ih1.redbubble.net/image.850078450.1026/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                         BANANA - JADE Shower Curtain                                                         |  $54.49 |  https://ih1.redbubble.net/image.485723302.7026/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                            Louisa Shower Curtain                                                             |  $58.12 |  https://ih1.redbubble.net/image.714003984.1120/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                      Hookipa Surf Sunset Shower Curtain                                                      |  $54.49 |  https://ih1.redbubble.net/image.499375997.7022/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                             Bison Shower Curtain                                                             |  $55.85 |  https://ih1.redbubble.net/image.42365114.0077/ur,shower_curtain_closed,square,600x600.1.jpg  |
|                                                  Pigeons Doing Pigeon Things Shower Curtain                                                  |  $61.30 |  https://ih1.redbubble.net/image.458114091.1359/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                              Wolves of the World (Green pattern) Shower Curtain                                              |  $53.58 |  https://ih1.redbubble.net/image.841240259.3936/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                     The Birches (in Blue) Shower Curtain                                                     |  $54.49 |  https://ih1.redbubble.net/image.364684526.2726/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                            Sapphire & Jade Stained Glass Mandalas Shower Curtain                                             |  $54.49 |  https://ih1.redbubble.net/image.855827011.8684/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                    The Ricks Must Be Crazy Shower Curtain                                                    |  $54.49 |  https://ih1.redbubble.net/image.843212193.9827/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                               Retro Eames-Era Atomic Inspired 3 Shower Curtain                                               |  $54.49 |  https://ih1.redbubble.net/image.378399040.6864/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                           Retro Color Block Popsicle Sticks Orange  Shower Curtain                                           |  $54.49 |  https://ih1.redbubble.net/image.923368972.5303/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                     Blue Zoomies pattern Shower Curtain                                                      |  $54.49 |  https://ih1.redbubble.net/image.843634928.4840/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                       MANEKI WASH GREEN Shower Curtain                                                       |  $59.03 |  https://ih1.redbubble.net/image.867566785.4956/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                   Soft Blue Gradient Cubes Shower Curtain                                                    |  $54.49 |  https://ih1.redbubble.net/image.444412654.7790/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                          Ocean Crash Shower Curtain                                                          |  $54.49 | https://ih1.redbubble.net/image.1168238045.2369/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                        Birds Of Jungle Shower Curtain                                                        |  $59.03 |  https://ih1.redbubble.net/image.847435442.1963/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                     A Fox in the Wild... Shower Curtain                                                      |  $54.49 | https://ih1.redbubble.net/image.1165884463.6125/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                       Gold palm leaves Shower Curtain                                                        |  $54.49 |  https://ih1.redbubble.net/image.409101292.3761/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                        Octopsychedelia Shower Curtain                                                        |  $54.49 |  https://ih1.redbubble.net/image.53004778.7977/ur,shower_curtain_closed,square,600x600.1.jpg  |
|                                                        Skeletor's Cat Shower Curtain                                                         |  $54.49 |  https://ih1.redbubble.net/image.895512143.8793/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                Palm Leaves In Black And White Shower Curtain                                                 |  $59.03 |  https://ih1.redbubble.net/image.519484923.2210/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                           Star Lake Shower Curtain                                                           |  $54.49 |  https://ih1.redbubble.net/image.871944713.8979/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                         Sloth Stripe Shower Curtain                                                          |  $54.49 |  https://ih1.redbubble.net/image.205710146.7038/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                   Aurelia Goldfish Mermaid Shower Curtain                                                    |  $54.49 |  https://ih1.redbubble.net/image.865016799.8085/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                           The Beast Shower Curtain                                                           |  $54.95 |  https://ih1.redbubble.net/image.362724938.7654/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                            Leopard Print - Silver Gray and White  Shower Curtain                                             |  $56.76 |  https://ih1.redbubble.net/image.793900103.0668/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                    Blue Valmalenco, Italy Shower Curtain                                                     |  $56.76 |  https://ih1.redbubble.net/image.742174200.0519/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                         Hanging Orbs Shower Curtain                                                          |  $54.49 |  https://ih1.redbubble.net/image.259468032.1028/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                     Vintage Mermaid Paris Shower Curtain                                                     |  $90.82 |  https://ih1.redbubble.net/image.841953455.5675/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                     Construction Trucks  Shower Curtain                                                      |  $54.49 |  https://ih1.redbubble.net/image.849779994.3406/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                   Cut + Paste Lemon Pattern Shower Curtain                                                   |  $54.49 | https://ih1.redbubble.net/image.1010390743.9556/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                             Sloth Shower Curtain                                                             |  $54.49 |  https://ih1.redbubble.net/image.956486764.4016/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                             Abstract Multi Color Cubizm Painting Shower Curtain                                              |  $54.49 |  https://ih1.redbubble.net/image.461755006.7432/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                          Jelly beans Shower Curtain                                                          |  $56.76 |  https://ih1.redbubble.net/image.724354274.0522/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                         Lost in Space Shower Curtain                                                         |  $54.95 |  https://ih1.redbubble.net/image.876423644.5372/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                       When Legends Meet Shower Curtain                                                       |  $54.49 | https://ih1.redbubble.net/image.1118539670.1106/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                  Selfie Giraffe in New York Shower Curtain                                                   |  $54.49 |  https://ih1.redbubble.net/image.858065257.9299/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                          Biology 101 Shower Curtain                                                          |  $56.76 |  https://ih1.redbubble.net/image.669396941.9765/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                            Popoki Shower Curtain                                                             |  $54.49 |  https://ih1.redbubble.net/image.385662285.0930/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                           Be Pride Shower Curtain                                                            |  $55.40 | https://ih1.redbubble.net/image.1152655614.6796/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                    Each Moment of the Year Shower Curtain                                                    |  $54.49 |  https://ih1.redbubble.net/image.809122096.7854/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                         The Immortal Shower Curtain                                                          |  $54.49 |  https://ih1.redbubble.net/image.914928995.9187/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                 Pink And Grey Gradient Cubes Shower Curtain                                                  |  $54.49 |  https://ih1.redbubble.net/image.382851966.5829/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                             It Seemed To Chase the Darkness Away Shower Curtain                                              |  $54.49 |  https://ih1.redbubble.net/image.809110090.7036/ur,shower_curtain_closed,square,600x600.1.jpg |
|                          Morty "I Do As The Crystal Guides" quote from Rick and Morty™ Death Crystal Shower Curtain                          |  $52.45 |  https://ih1.redbubble.net/image.966553275.3415/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                          Eames Era Starbursts and Globes 3 (bkgrnd) Shower Curtain                                           |  $54.49 |  https://ih1.redbubble.net/image.375387600.7328/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                     Boho Flowers Pattern Shower Curtain                                                      |  $54.49 |  https://ih1.redbubble.net/image.935336830.2227/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                Henri Matisse - Blue Nude 1952 - Original Artwork Reproduction Shower Curtain                                 |  $56.76 |  https://ih1.redbubble.net/image.672148845.0063/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                 Gold Indigo Malachite Marble Shower Curtain                                                  |  $65.84 |  https://ih1.redbubble.net/image.862235612.8174/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                  Death Head Moth Witch Board Shower Curtain                                                  |  $54.49 |  https://ih1.redbubble.net/image.959173541.8347/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                               Leopard Gray and Light Gray Print Shower Curtain                                               |  $54.49 |  https://ih1.redbubble.net/image.851441807.9725/ur,shower_curtain_closed,square,600x600.1.jpg |
| The Dunder Office Mifflin Inc. Design, T-Shirt, tshirt, tee, jersey, poster, Original Funny Gift Idea, Dwight Best Quote From Shower Curtain |  $56.76 |  https://ih1.redbubble.net/image.636556380.5281/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                Vintage Solar System Map (1883) Shower Curtain                                                |  $54.49 |  https://ih1.redbubble.net/image.854873138.6748/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                         Flower Field Shower Curtain                                                          |  $54.49 |  https://ih1.redbubble.net/image.843342485.3106/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                      Terrazzo Sun Light Shower Curtain                                                       |  $54.49 |  https://ih1.redbubble.net/image.863871946.0983/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                       Stylish Gold Diamond Shapes Doodles White Pattern Shower Curtain                                       |  $54.49 |  https://ih1.redbubble.net/image.954706178.4364/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                       Brown Sideways Stripes - Mudcloth Tribal Pattern Shower Curtain                                        |  $50.50 | https://ih1.redbubble.net/image.1103752861.2180/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                       Rainbow Pineapple Shower Curtain                                                       |  $54.49 |  https://ih1.redbubble.net/image.860968450.0931/ur,shower_curtain_closed,square,600x600.1.jpg |
|                Joan Miro The Sun (El Sol) 1949 Painting Artwork For Prints Posters Tshirts Bags Women Men Kids Shower Curtain                |  $56.76 |  https://ih1.redbubble.net/image.845987820.3095/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                  Rose gold copper honeycomb Shower Curtain                                                   |  $74.93 |  https://ih1.redbubble.net/image.407963990.2008/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                            Burlap Shower Curtain                                                             |  $58.12 |  https://ih1.redbubble.net/image.864516329.6111/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                    Vintage poster - Japan Shower Curtain                                                     |  $54.49 |  https://ih1.redbubble.net/image.435051155.2108/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                  Wolf Howling At The Moon / Wolf Moon Night Sky Stars Space Shower Curtain                                   |  $56.76 |  https://ih1.redbubble.net/image.933994845.0668/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                   Sea angel & sea butterfly Shower Curtain                                                   |  $54.49 |  https://ih1.redbubble.net/image.716190832.3677/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                        Terrazzo matrix Shower Curtain                                                        |  $56.76 |  https://ih1.redbubble.net/image.866500337.9787/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                        Spring Skull 2 Shower Curtain                                                         |  $54.49 |  https://ih1.redbubble.net/image.910650710.4621/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                          Rainy Days Shower Curtain                                                           |  $77.20 |  https://ih1.redbubble.net/image.928689192.5441/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                  geometric shapes abstract 2 Shower Curtain                                                  |  $54.49 |  https://ih1.redbubble.net/image.944849646.3366/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                     Having meals together Shower Curtain                                                     |  $59.03 |  https://ih1.redbubble.net/image.944958024.7422/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                    Bookworm Antique books Shower Curtain                                                     |  $56.76 |  https://ih1.redbubble.net/image.975316466.8634/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                               Tyrannosaurus Rex in Cat Jammies Shower Curtain                                                |  $54.49 | https://ih1.redbubble.net/image.1151176630.8339/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                   Le ballet des carpes koi Shower Curtain                                                    |  $59.03 |  https://ih1.redbubble.net/image.437377350.5294/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                       Hammerhead Shark Shower Curtain                                                        |  $54.49 |  https://ih1.redbubble.net/image.981964804.1345/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                         Rose Garden V Shower Curtain                                                         |  $54.49 | https://ih1.redbubble.net/image.1062192717.5743/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                        shibes in cream Shower Curtain                                                        |  $54.49 |  https://ih1.redbubble.net/image.372197220.3650/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                    La Boheme Teal Floral  Shower Curtain                                                     |  $56.76 |  https://ih1.redbubble.net/image.855648772.5890/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                          Eucalyptus Shower Curtain                                                           |  $54.49 | https://ih1.redbubble.net/image.1077181042.7318/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                      Blue Iris Blossoms Shower Curtain                                                       |  $54.49 |  https://ih1.redbubble.net/image.817250422.7343/ur,shower_curtain_closed,square,600x600.1.jpg |
|                            Jurassic Portal | Retro Rainbow Palette | Dinosaur Science Fiction Art Shower Curtain                             |  $54.49 |  https://ih1.redbubble.net/image.932524721.5266/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                           Forelsket Shower Curtain                                                           |  $56.76 | https://ih1.redbubble.net/image.1077768659.7113/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                          Hamnoy Hut Shower Curtain                                                           |  $56.76 | https://ih1.redbubble.net/image.1011615092.6091/ur,shower_curtain_closed,square,600x600.1.jpg |
|                                                By The Shore By Colleen Ranney Shower Curtain                                                 |  $54.49 |  https://ih1.redbubble.net/image.992576471.2172/ur,shower_curtain_closed,square,600x600.1.jpg |
+----------------------------------------------------------------------------------------------------------------------------------------------+---------+-----------------------------------------------------------------------------------------------+


text:
Q: Calculate sum of auto filled input using javascript/JQuery I currently have three input fields with auto filled / auto calculated values. The values are derived from other input fields.
total_p1 = sum of input1 and input2  |||
total_p2 = sum of input3 and input4
total = total_p1 + total_p2

I need to add the values of total_p1 and total_p2. Problem is it won't calculate unless I manually add or change the value of either input boxes. Hoping for an effective solution for auto fill. Thanks!
EDIT:
code for total_p1:
$('#input2').keyup(function(){
    var input1;
    var input2;

    input1 = parseFloat($('#input1').val());
    input2=  parseFloat($('#input2').val());

    var result = (input1 + input2);
    $("#total_p1").val(result);
});

code for total_p2:
$('#input4').keyup(function(){
    var input3;
    var input4;

    input3 = parseFloat($('#input3').val());
    input4=  parseFloat($('#input4').val());

    var result = (input3 + input4);
    $("#total_p2").val(result);
});

Code for total:
total:
code for total_p1:
$('#total_p2').keyup(function(){
    var total_p1;
    var total_p2;

    total_p1= parseFloat($('#total_p1').val());
    total_p2=  parseFloat($('#total_p2').val());

    var result = (total_p+ total_p2);
    $("#total").val(result);
});

A: Add class input-fields-to-sum to your source input fields, then:
$(document).ready(function() {
   calculateTotals();

    $(".input-fields-to-sum").on('input', function() {
        calculateTotals();
    });
});

function calculateTotals() {
   // walk on input fields with class, calculate sum and put it in total field
   // input can contain invalid numbers, handle errors when parsing
}

function parseNumber(str, defaultValue) {
    if (str !== undefined && str.length) {
        var parsed = parseFloat(str.replace(',','.').replace(/\s/g,'').replace(/\&nbsp\;/g,''));
        if (isNaN(parsed)) return defaultValue;
        return parsed;
    }
    return defaultValue;
}


text:
Q: query to find all the elements in array in mongoose dynamically query to find all the elements in the array in mongoose dynamically
below is the object
var res1= {
    "category":["travel","cafe"],
    "amount":"300"
}

There could be more elements in the category but I want to create the query which automatically finds all the elements in the database just like forEach works

A: The $in operator should to the trick. $in will look for documents where the provided field matches any of the values in the array. the query would look like this:
   Detail.find({
     category: { $in: ["travel", "cafe"] },
     amount: 300
  })

assuming the filters are coming in dynamically on the request, and that req.body.categories is an array of desired categories:
   Detail.find({
     category: { $in: req.body.categories },
     amount: req.body.amount
  })


text:
Q: Software architecture issue I am having an architecture issue, and I hope someone can point me in the right direction. My problem is: handling DTOs with one-to-many or many-to-many relationships.
I have 5 projects and they should mostly depending to the next one respectively.

*

*Service Layer : connect domain layer to outside world

*Domain : Entity, Value Object and so on, Heart of the sw

*DTO : Mapper - convert database row to domain object

*Repository : CRUD operations

*DAL : Using EF Code first approach to create database tables

But i cannot figure out how they should be referred with each other. I have tried few approach and end up with circular reference. Any suggestions are welcome.

A: Here is what I would do with what you've described:
                      Common (shared logic, utility)
                                    |
                      Model (Business objects, pocos)
                                    |
     DAL (Entity Framework -- DbContext definition of Model, migrations etc)
                                    |
            Repository (CRUD implementation using DAL context(s))
                                    |
     Service Layer (Implementation of business logic, using repositories)
DTO Mappers (Translation of business objects to client consumables using repos)
                                    |
          Any API or outward facing interface (webapi, signalr, wcf, mvc)

Usually you use DI to manage these dependencies with some sort of lifetime scope (http request): API -> Service -> Mappers -> Repositories -> DAL.
In my experience I've used the "service" layer to perform unit-of-work operations -- eg. Using the Repository's methods that implement complex and simple queries -> Do business logic -> End UoW -> Return mapped business objects as dto.
Your entity model should be shared throughout. Here are a few resources that might help you develop the architecture right for your application(s)
link &
link
Hope this helps!

A: The Domain layer is at the core of your system, as a general rule it shouldn't depend on other modules - i.e. it should be unaware of how domain entities are persisted, presented to the user, communicated to external systems, etc.
The Onion Architecture is a good starting place for a DDD approach.
When faced with a circular reference problem, ask yourself which module is closer to the center of the onion - which one is essential to your domain and which one is a peripheral detail. If module A has to use something in module B which is further away from the center, make it depend on an abstraction of it instead. Declare the abstraction in module A but implement it in module B and inject it at runtime (see Dependency Inversion principle).
Events can also be used to achieve dependency inversion and help a great deal in decoupling your modules.


text:
Q: Не выводится изображение PyQt Есть две одинаковые по содержанию переменные, но разные по способу получения. С одной переменной изображение выводится, а с другой - нет.
        name2 = self.face_im_name
        print(name)
        print(name2)
        print(name == name2)  # проверка, что переменные одинаковые
        pixmap = QPixmap(name2)
        self.mainlabel_face.setPixmap(pixmap)

вывод следующий:

imgs\sface2.jpg
imgs\sface2.jpg

False

нахождение name2:

self.face_im_name = self.my_counter.definition(self.num_face)

    def definition(self, num): # параметр num исправно выводится
        self.data = open('data.txt', encoding='utf-8')
        self.image_name = None
        for row in self.data:
            row_l = row.split('*')
            number = row_l[0]
            if int(number) == num:
                self.image_name = row_l[1]
        self.data.close()
        return self.image_name

A: Вам надо убрать \n - разрыв строки.
Метод strip() возвращает копию строки, удаляя как начальные, так и конечные символы
(в зависимости от переданного строкового аргумента).
Попробуйте так:
def definition(self, num): # параметр num исправно выводится
    self.data = open('data.txt', encoding='utf-8')
    self.image_name = None
    for row in self.data:
        row_l = row.split('*')
        number = row_l[0]
        if int(number) == num:
            self.image_name = row_l[1].strip()             # <---- + .strip()
    self.data.close()
    return self.image_name


text:
Q: javascript map and join on an array d = [
    ["a", "Adobe"]
    ["b", "Boston"]
    ["c", "Cars"]
    ["d", "Dominos"]
    ["e", "Microsoft"]
]
const asString = d.map(function(x){
        x[0],'=',x[1]
    }).join('&');
  console.log(asString);

I'm trying to generate a query string from the above array, but seem to be getting only &&&&. The original solution used Template Literals and was like this:
const asString = d
      .map(x => `${encodeURIComponent(x[0])}=${encodeURIComponent(x[1])}`)
      .join('&');
  console.log(asString);

This works fine, but I don't want to use Template Literals.
The end result is a querystring like this: a=Adobe&b=Boston&c=Cars&d=Dominos&e=Microsoft

A: You could take the key and value and return the new strings.

const
    d = [["a", "Adobe Photoshop"], ["b", "Boston"], ["c", "Cars"], ["d", "Dominos"], ["e", "Microsoft"]],
    asString = d.map(([key, value]) => key + '=' + encodeURIComponent(value)).join('&');

console.log(asString);

A: You're not returning any values from your map callback:
d.map(function(x){
        x[0],'=',x[1]
    }).join('&');

should be:
d.map(function(x){
        return x[0] + '=' + x[1]
    }).join('&');

"Classic" style functions don't return values in the same way as lambda (arrow) functions do, so you need to explicitly return the value.

A: Just using map and join:

const d = [
    ["a", "Adobe"],
    ["b", "Boston"],
    ["c", "Cars"],
    ["d", "Dominos"],
    ["e", "Microsoft"]
]
let queryString = d.map(x=>x.map(encodeURIComponent).join("=")).join("&")
console.log(queryString)

// Without arrow function
queryString = d.map(function(x){
  return x.map(encodeURIComponent).join("=")
}).join("&");

console.log(queryString)

A: Using reduce

d = [
    ["a", "Adobe"],
    ["b", "Boston"],
    ["c", "Cars"],
    ["d", "Dominos"],
    ["e", "Microsoft"]
]
 let join = d.reduce((acc, elem)=>{
    return acc + elem.join("=") + '&'
 },"");

 console.log(join.slice(0, -1))


text:
Q: How to find out the minimum and maximum usable CPU and memory space left on a kubernetes node I'm trying to deploy Magento on a GCE n1-standard-1 machine, but I keep getting the following error message.
pod (magento-magento-1486272877-zd34d) failed to fit in any node fit failure summary on nodes : Insufficient cpu (1)

I'm using the official Magento helm chart, and I've configured the values.yml file to contain very low CPU requests: cpu: 25m
When I look at the node details on the kubernetes dashboard, I see that my CPU is already spinning at 0.728 (72.80%) while it's not even doing anything besides the system containers. Also see image below:

Does this mean I have 1 - 0.728 = 0.272m left for container requests? Then why is kubernetes still telling me that it has insufficient CPU when specifying 0.25m?
Thanks for your help.

A: I didn't see that the CPU limits were 0.248 according to the picture in my post, so I put cpu: 20m and it worked.

A: There is a nifty kubectl command to get information about your nodes resources...
kubectl top nodes
And pods...
kubectl top pods
Pods with containers
kubectl top pods --containers=true


text:
Q: Data Manipulation in multiple columns in pandas dataframe I need to make a function, which takes input as dataframe, and dictionary{"Col_2":% change,"Col_3":% change} and it should make the changes to the dataframe.
I Have data frame like this

Date
col_1
col_2
col_3

01/01/2022
90
100
300

01/02/2022
80
110
310

01/03/2022
92
120
400

01/04/2022
96
130
300

01/05/2022
99
150
500

01/06/2022
105
155
600

Now I pass the dictionary  say,
{"col_2":-10,"col_3":10}
Then my desired out would look like this

Date
col_1
col_2
col_3

01/01/2022
90
90
330

01/02/2022
80
99
341

01/03/2022
92
108
440

01/04/2022
96
113
330

01/05/2022
99
135
550

01/06/2022
105
139.5
660

I followed this code(but didn't get my desired result)
def per_change(df,col,per):
    m = 1+per/100
    df['col_2'] *= m
    return df

A: You can specify columns names for processing in list and first divide values by 100, multiple by Series from dictionary and add to original DataFrame by DataFrame.add:
def per_change(df,cols,d):
    df[cols] = df[cols].add(df[cols].div(100).mul(pd.Series(d)), fill_value=0)
    return df

d =  {"col_2":-10,"col_3":10}
print (per_change(df,['col_1','col_2','col_3'],d))
         Date  col_1  col_2  col_3
0  01/01/2022   90.0   90.0  330.0
1  01/02/2022   80.0   99.0  341.0
2  01/03/2022   92.0  108.0  440.0
3  01/04/2022   96.0  117.0  330.0
4  01/05/2022   99.0  135.0  550.0
5  01/06/2022  105.0  139.5  660.0

A: You can use a Series of the dictionary with mul. By default the missing columns will be NaN, and you fill in the original data with combine_first.
The advantage of this solution is that you do not need to care about the existing columns, if will only multiply the ones present in the dictionary.
Numeric/string columns only:
(df+df.mul(pd.Series(d)/100)).combine_first(df)

Or to handle dataframes with non-numeric types:
(df+df.select_dtypes(include='number').mul(pd.Series(d)/100)).combine_first(df)

output:
         Date  col_1  col_2  col_3
0  01/01/2022   90.0   90.0  330.0
1  01/02/2022   80.0   99.0  341.0
2  01/03/2022   92.0  108.0  440.0
3  01/04/2022   96.0  117.0  330.0
4  01/05/2022   99.0  135.0  550.0
5  01/06/2022  105.0  139.5  660.0

input:
df = pd.DataFrame({'Date': ['01/01/2022', '01/02/2022', '01/03/2022', '01/04/2022', '01/05/2022', '01/06/2022'], 'col_1': [90, 80, 92, 96, 99, 105],
                   'col_2': [100, 110, 120, 130, 150, 155],
                   'col_3': [300, 310, 400, 300, 500, 600]})

d = {"col_2":-10,"col_3":10}

A: Function:
def changer(df, change_dic):
   new_df=df.copy()
   for col in change_dic.keys():
      new_df[col] += change_dic[col]*new_df[col]
   return new_df

and your edited version:
def per_change(df,col,per):
   m = 1+per/100
   df[col] *= m
   return df


text:
Q: Spring JTA transaction manager with Bitronix jndi lookup failures I have a spring JTA transaction manager configured for Bitronix running on Tomcat 7. The transaction manager starts properly and the application works fine. I however get a lot of debug messages stating that
No JTA TransactionManager found at fallback JNDI location [java:comp/TransactionManager]
No JTA TransactionManager found at fallback JNDI location [java:pm/TransactionManager]
No JTA TransactionManager found at fallback JNDI location [java:appserver/TransactionManager]
etc..
I understand that this is the JtaTransactionManager scanning known jndi locations and this is not an error but a debug exception. The following is my transaction manager configuration
<bean id="BitronixTransactionManager" factory-method="getTransactionManager" class="bitronix.tm.TransactionManagerServices"
     destroy-method="shutdown" />

and the jta transaction manager
<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="autodetectTransactionManager" value="false"/>
<property name="transactionManager" ref="BitronixTransactionManager" />
<property name="userTransaction" ref="BitronixTransactionManager" />

I thought that setting the autodetectTransactionManager value to false would prevent this scanning and the resulting debug exceptions but it seems this setting has no effect.
I also tried with the following properties for the transactionManager to set the jndi location.
<property name="transactionManagerName" value="java:comp/TransactionManager"/>
<property name="userTransactionName" value="java:comp/UserTransaction"/>

I am using jta 1.1 and also get the same lookup message for the TransactionSynchronizationRegistry:
DEBUG [main] JtaTransactionManager.findTransactionSynchronizationRegistry(146) | No JTA TransactionSynchronizationRegistry found at default JNDI location [java:comp/TransactionSynchronizationRegistry]
I would really like to understand this and not merely filter this out with my Log4J

A: Probably the problem is that in Tomcat the default jndi locations are in in java:comp/env. So you should do
<property name="transactionManagerName" value="java:comp/env/TransactionManager"/>
<property name="transactionSynchronizationRegistryName" value="java:comp/env/TransactionSynchronizationRegistry"/>
<property name="userTransactionName" value="java:comp/env/UserTransaction"/>


text:
Q: video storage for an video based Android app I'm not sure how to approach the next problem.
I'm developing a video based app which has to play different short video clips estimated at around 300 MBs.
Packaging the clips locally will probably cause less people to download it, and in the Apple App Store I don't think it's even possible due to the 100MB limit.(?)
How do I tackle the problem if I'm interested in downloading the clips to the user's device (while he uses the app) from a storage server?
What are my options?


text:
Q: Simple AJAX form failing to submit I've written a simple form & AJAX function that should post the data of the form.
Can anyone help me determine why this is failing to post?
Fiddle: https://jsfiddle.net/onyeLp4d/2/
HTML

  <form method="POST">

        First Name <input id="your_first_name" name="your_first_name" type="text" />
        Last Name <input id="your_last_name" name="your_last_name" type="text" />
        Company Name <input id="your_company_name" name="your_company_name" type="text" />
        Email Address <input id="your_work_email" name="your_work_email" type="text" />

        Referrals First Name <input id="your_referrals_first_name" name="your_referrals_first_name" type="text" />
        Referrals Last Name <input id="your_referrals_last_name" name="your_referrals_last_name" type="text" />
        Referrals Company Name <input id="your_referrals_company_name" name="your_referrals_company_name" type="text" />
        Referrals Email Address <input id="your_referrals_email_address" name="your_referrals_email_address" type="text" />
        Referrals Phone Number <input id="your_referrals_phone_number" name="your_referrals_phone_number" type="text" />
        How did you hear about us? <input id="how_did_you_hear_about_electrics_referral_program" name="how_did_you_hear_about_electrics_referral_program" type="text" />

      <button type="submit">
      Submit
      </button>

  </form>

jQuery
jQuery(document).ready(function () {

  jQuery("form").submit(function (e) {

    e.preventDefault();

    var form = jQuery(this);

    var formData = {
      your_first_name: jQuery("#your_first_name").val(),
      your_last_name: jQuery("#your_last_name").val(),
      your_company_name: jQuery("#your_company_name").val(),
      your_work_email: jQuery("#your_work_email").val(),
      your_referrals_first_name: jQuery("#your_referrals_first_name").val(),
      your_referrals_last_name: jQuery("#your_referrals_last_name").val(),
      your_referrals_company_name: jQuery("#your_referrals_company_name").val(),
      your_referrals_email_address: jQuery("#your_referrals_email_address").val(),
      your_referrals_phone_Number: jQuery("#your_referrals_phone_number").val(),
      how_did_you_hear_about_electrics_referral_program: jQuery("#how_did_you_hear_about_electrics_referral_program").val()
    }

    console.log(formData);

    $.ajax ({
        type: form.attr('method'),
      data: formData,
      dataType: 'json',
      success: function (data) {
        console.log("Success!");
        console.log(data);
      },
      error: function (data) {
        console.log("An error has occured!");
        console.log(data);
      }
    });

  });
});

It seems quite simple:

*

*Prevent form from submitting as normal

*Get form data (saving to variable so I can remap some of it eventually)

*Post the form data via AJAX so that the page does not reload

I am expecting the form to submit successfully using AJAX. I have tried numerous alterations of my code but it is quite simple so I must be missing something small or silly.

A: In your code you are specifying that the URL where you will make the post request is defined in the action attribute of your form, but in your html code, your form tag does not have this attribute.


text:
Q: Is this a valid way to determine JavaScript variable types? Any developer writing JS sooner or later encounters this, rather infuriating behaviour:
typeof []; // 'object'

While there are workarounds such as instanceof and accessing a variable's .constructor property, this just came to my mind:
Array.prototype.TYPE = 'Array';
String.prototype.TYPE = 'String';
Boolean.prototype.TYPE = 'Boolean';
Object.prototype.TYPE = 'Object';
RegExp.prototype.TYPE = 'RegExp';
Number.prototype.TYPE = 'Number';

// and therefore:
[1,2,'bar', {baz: 'foo'}].TYPE === 'Array'; // true
"But life itself, my wife, and all the world / Are not with me esteemed above thy life".TYPE // 'String'
(42).TYPE === 'Number'; // true
// and so on

I know it is generally frowned upon to modify native prototypes, That said, is there any other issue with this "pattern"?
UPDATE:
Some comments offer alternative solutions like usage of Object.prototype.toString and more. These are certainly all valid approaches that have their use cases. But still, what I'm primarily interestest in, is whether there might be some case in which adding a property to native constructor prototypes would actually cause a problem :)
UPDATE:
A safer way?
Array.prototype.getType = function() {return 'Array'};
String.prototype.getType = function() {return 'String'};
Boolean.prototype.getType = function() {return 'Boolean'};
Object.prototype.getType = function() {return 'Object'};
RegExp.prototype.getType = function() {return 'RegExp'};
Number.prototype.getType = function() {return 'Number'};

A: Douglas Crockford recommends writing your own typeOf function for exactly this reason:

... The new typeOf global function is intended to replace the defective typeof operator. It produces the same result as typeof, except that it returns 'null' for null and 'array' for arrays.

He implements it thusly:
function typeOf(value) {
    var s = typeof value;
    if (s === 'object') {
        if (value) {
            if (typeof value.length === 'number' &&
                    !(value.propertyIsEnumerable('length')) &&
                    typeof value.splice === 'function') {
                s = 'array';
            }
        } else {
            s = 'null';
        }
    }
    return s;
}

typeOf({}) //=> "object"

typeOf([]) //=> "array"


text:
Q: Is that possible to get facial expression information like animojis via CoreML or ARkit? As Apple shown yesterday, the Animoji is amazingly retarget human facial movement to emojis,
so is it possible for us to use something like the picture below via CoreML or ARkit?


text:
Q: Inkscape .pdf_tex help - alignment and scaling of objects Started learning Inkscape for thesis figure generation. I've got a few questions about alignment and scaling of objects.
Files:
svg, pdf, pdf_tex, mwe.pdf.
Images if you don't want to download the files:
https://imgur.com/a/Ut9Cymd. Img 1 is within Inkscape, img 2 is in mwe.pdf
I have a MWE.tex for testing this which I use:
\begin{figure}
\input{<figure_name>.pdf_tex}
\end{figure}

My figure is present in mwe.pdf however it's pushed very far to the right, even adding in \centering before the input command doesn't seem to fix it.
Edit: The image being off center was solved by changing Output page size to Use exported objects size.
I'm also having alignment issues with the text and the scale bars. What I want to happen is for the text to be aligned with the right of the scale bar, as seen in the svg/inkscape image C and D. I use the align tool to align them both relative to one another but this doesn't seem to work. I believe I somehow need to change the anchor point of the text box, ideally to the bottom right. Edit: Went to V0.92 and found the text align button. Unsure where it's hidden in V1.0. that solved the issue.
The scale of the figure labels, A-F, is also different. This is expected as the text size conforms to the tex document. How do I configure it so the white box scales with the text?
Thanks for the help!
Edit: changed file hosting location


text:
Q: Nvidia GT750M driver Ubuntu14.04 I configured my graphic card with the nvidia driver-331 by terminal with the command explained in this guide.
http://www.linuxveda.com/2014/06/13/howto-install-nvidia-331-bumblebee-optimus-cards-ubuntu/
However my graphic card not works, and it is not visible from Ubuntu.
After typing:
    lspci -v | less

it answer:
    01:00.0 3D controller: NVIDIA Corporation GK107M [GeForce GT 750M] (rev ff) (prog-if ff)
    !!!Unknown header type 7f

Can anyone help me?!?!
Thanks alot!

A: Try this. To install Nvidia Drivers, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the commands below:
sudo apt-add-repository ppa:ubuntu-x-swat/x-updates
sudo apt-get update
sudo apt-get install nvidia-current

If that doesn't work, you can download the 32bit or 64bit drivers from Nvidia.

A: DO NOT. I REPEAT DO NOT INSTALL THE DRIVERS FROM NVIDIA!!!
I did that and i just had to reinstall my whole system. spend two days trying to fix my Xserver and gave up. they do something to prevent xserver from starting. in my case they changed a bunch of permissions and ownership of xserver files, as well as prevented X from finding a screen.


text:
Q: I keep getting (Cannot read property 'Date' of undefined) My aim is to move backwards through the array of data, checking that as long as the date/month eg '02' stays the same, I will only take the first case (e.g data.Cases: 1234) I get for that month.
Here I'm stating (i) to hold the max length of the array.
cases and date to carry max number of cases and the month value at position i.
    let data = 'https://api.covid19api.com/total/country/south-africa/status/confirmed?from=2020-03-01T00:00:00Z&to=2020-04-01T00:00:00Z';

    let i = (data.length -1);
    let cases = data[i].Cases; // Total sum
    let date = (data[i].Date).slice(6,7);
    let getCase = [];
    let getDate = [];
    let theMonths = [];

    do {
        // Check if the date matches first date.
        // Push that date to getDate array.
        // Push that case to getCase array.
        // Continue loop

        if (date === (data[i].Date).slice(6,7)) {
            i--;
        }

Then this statement should trigger when the month value changes and change the date variable that the loop had used initially to the new one that triggered this statement. Therefore I can push new values to my array and repeat the whole loop with the next date value.
            // If the date has changed
        if (date !== (data[i].Date).slice(6,7)) {
            // Change to current Date

            //ERROR HERE (Does not update date with new date)

            if (data[i].Date){
                date = (data[i].Date).slice(6,7);
                getDate.push(date);
                getCase.push(data[i].Cases);
            }
        }

        if (date === '1') {
            break;
        }

    }

    while (
        cases >= data[i].Cases
    );

A: getCasesPerMonth(data) {

    // Loop backwards through array, storing the first date in temp variable and case amount in array, compare next
    // iteration date with prev variable, if true replace var with current date and proceed loop.
    // if false, push new case to array and prev date variable to array and proceed loop.

    let i = data.length -1;

    // This needs to be updated when the date changes
    let currentDate = data[i].Date.slice(6,7)

    let addDates = [currentDate];
    let addCases = [data[i].Cases];

    while(i > 0) {

        if ((data[i].Date).slice(6,7) !== currentDate) {

            addDates.push((data[i].Date).slice(6,7));
            addCases.push(data[i].Cases);

            currentDate = (data[i].Date).slice(6,7);
        }

        i--;

    }

    let orderedDates = [];
    let orderedCases = [];

    this.flipAndPush(addDates, orderedDates);
    this.flipAndPush(addCases, orderedCases);

    let writtenMonths = [];

    orderedDates.forEach((date) => {
        writtenMonths.push(this.findMonth(date));
    });

    this.setState({splitMonths: writtenMonths, splitCases: orderedCases});
}


text:
Q: Weird Compiler Errors in Go When I run the following code (it's supposed to reverse the contents of a string), I get strange errors from the compiler.
package main
import "fmt"
func main(){

    argString := "I am a string"
    arrayPointer := len(argString)
    outputString := "string"

    for arrayPointer >= 0 ; arrayPointer-- {
        outputString := fmt.Sprintf("%s%s", outputString, argString[arrayPointer])
    }
}

It throws the following errors:
prog.go:9: syntax error: missing { after for clause
prog.go:12: syntax error: unexpected }
[process exited with non-zero status]

I've used this syntax before (unless I'm missing something), and I've never seen errors from it. What am I missing?

A: From the spec, there are three forms for a for statement:

*

*a single conditional expression

*the three statement version giving an init statement, condition and post statement

*a range clause.

Your statement doesn't match any of these.  Most likely the compiler has decided that you are using (1), and errors out when there isn't a { after arrayPointer >= 0.  You can fix this by changing to case (2):
for ; arrayPointer >= 0 ; arrayPointer-- {

(or using the arrayPointer initialisation statement as the first part of the for statement).

A: This code has a few errors besides the malformed for statement (e.g., your arrayPointer is initialized to len(argString) rather than len(argString)-1, so you'll hit an out-of-bounds violation right away).
Anyway, I think this an optimized, idiomatic version of what you're attempting:
http://play.golang.org/p/fFCf3L8ov9
package main

import "fmt"

func main() {
    inString := "I am a string"

    // use an output buffer because (1) strings are immutable and
    // (2) appending to strings creates a new string from the existing
    // string and its new appendix. This method allocates
    // all the necessary memory 1 time. len(inString) allocations
    // vs 1 allocation.
    outBuffer := make([]uint8, len(inString))
    for i := 0; i < len(outBuffer); i++ {
        // copy the i-th character from the end of the string
        // into the i-th position of outBuffer
        outBuffer[i] = inString[len(inString)-i-1]
    }

    fmt.Println(string(outBuffer))
}


text:
Q: Django REST Framework view permissions not called I am trying to create a custom permission for my view that allow read and write permissions to the owner of the model in the QuerySet but do not allow any permission/request to other users or un-authenticated ones.

Source: https://www.django-rest-framework.org/tutorial/4-authentication-and-permissions/

View:
class My_classListCreateAPIView(generics.ListCreateAPIView):
    queryset = Model.objects.all()
    serializer_class = ModelSerializer
    permission_classes = [IsModelOwner]

Permission:
class IsModelOwner(permissions.BasePermission):

    def has_object_permission(self, request, view, obj):
        # Permissions are only allowed to the owner of the model and admins.
        if request.user.is_staff == True:
            return True
        return obj.owner == request.user

unfortunately it seems that my view is not even calling my custom permission class. (I imported it etc.) If instead of my custom permission class, I use a default one like permissions.isAuthenticatedOrReadOnly that works instead. What am I missing here?
Thanks.

A: The has_object_permission method is only called on objects, not on querysets, what this means is that on a list request it won't be called.
Your view only has list and create endpoints, neither of those use the object_permissions, use has_permission instead.
However i believe what you want to do is actually use the isAuthenticated permission combined with a modified get_queryset in your view
class My_classListCreateAPIView(generics.ListCreateAPIView):
    queryset = Model.objects.all()
    serializer_class = ModelSerializer
    permission_classes = [isAuthenticated]

    def get_queryset(self):
        return Model.objects.filter(owner=self.request.user)


text:
Q: Convertir tipo de dato varhcar a datetime en SQL Server 2012 Me están compartiendo información la cual tengo que agregar a una tabla, el problema es que la fecha me la envían en este formato 11012019 que seria 11/01/2019
No se si es posible realizar este proceso pero, esto es como me imagino que puede ser:
SELECT
CONVERT(DATETIME,'11012019',103) AS FECHA
FROM ORIGINA

A: Reemplaza DATETIME por VARCHAR(255)
SELECT CONVERT (VARCHAR(255),'11012019',103) AS FECHA

Con DATETIME sería así:
SELECT CONVERT (DATETIME,'11/01/2019',103) AS FECHA

Y con DATE:
SELECT CONVERT (DATE,'11/01/2019',103) AS FECHA

Ahora que si necesitas utilizar forzosamente en ese orden la cadena recibida, te funcionará de la siguiente manera:

DECLARE @date VARCHAR(8);
DECLARE @year VARCHAR(4);
DECLARE @month VARCHAR(2);
DECLARE @day VARCHAR(2);

SET @date = '11012019';
SET @day = (SELECT SUBSTRING(@date,0,3));
SET @month = (SELECT SUBSTRING(@date,3,2));
SET @year = (SELECT SUBSTRING(@date,5,5));
SET @date = @year + @month + @day;

SELECT CONVERT(DATE,@date,103) AS FECHA

Para obtener 11/01/2019 cómo lo indicas en tú último comentario:

SELECT CONVERT(VARCHAR(10),CONVERT(DATE,@date),103) AS FECHA

A: El problema está en que el valor de la fecha la obtienes sin ningún delimitador, y hasta donde tengo entendido no hay manera de que eso sea interpretado como una fecha, al menos que tenga el siguiente formato YYYYMMDD el cual también es un formato estándar, el ISO 8601.
En tu caso lo mas que se me ocurre es fraccionar ese valor y convertirlo en un formato estándar YYYYMMDD.
Te dejo un ejemplo utilizando substring:
SELECT
CONVERT(
  DATE,
  SUBSTRING('11012019',5,4) + SUBSTRING('11012019',3,2) + SUBSTRING('11012019',1,2)
);

Y acá otro ejemplo utilizando stuff:
SELECT
CONVERT(
  DATE,
  STUFF(STUFF('11012019', 5, 0, '/'), 3, 0, '/'),
  103  -- DD/MM/YYYY
);

SUBSTRING: La función SUBSTRING le permiten extraer una subcadena
  de una cadena (Devuelve parte de una expresión de caracteres).
STUFF: La función STUFF inserta una cadena en otra. Elimina una
  longitud determinada de caracteres de la primera cadena a partir de la
  posición de inicio y, a continuación, inserta la segunda cadena en la
  primera, en la posición de inicio.


text:
Q: How to create JavaScript object outside of a window object? Is it possible to create a js object that is not under the window object? If yes, then how?
There is a different ongoing discussion when I'm trying to understand the location of _internalRoot object created by ReactRoot() constructor. Good people say that most probably it's not under the window object.
I was sure that we could not create an object outside of a window object.

A: Just create the object in a local variable:
function example() {
    var demo = {};
}
example();

Even if example is a global variable and somehow tied to window, the demo variable is not.

A: the easiest way is, create an immediately executing function(IIFE) and create your object in it.
(function() {
  var yourObject = {};
})();

more details on IIFE is here https://developer.mozilla.org/en-US/docs/Glossary/IIFE


text:
Q: Why is this if statement always true when it shouldn't be? I'm making a game where the goal is to get pairs of 4 using a normal card deck. When I prompt for which card value the player wants to ask another player, the else if (playerArray[turn].cards.indexOf(card) == -1) ALWAYS evaluates to true, even when the card variable contains a value of the cards array. This makes no sense to me at all and I'm stuck on how to fix this. Any suggestions is greatly appreciated.
var playerArray = [];       //Holds the player objects
var turn = 0;               //Keeps track of whose turn it is
var wrongCard = true;
var card = askCard(player); //Prompt to get a card value

function askCard(player) {

    var whichCard = prompt('The deck has: ' + deck.length + ' cards left in it.\n'
    + 'Your current cards are: ' + playerArray[turn].cards.join(' - ') + '\n'
    + player + ', all your:');

    return whichCard;
}

    while (wrongCard) { //Run as long as the card input is wrong

        if (card < 1 || card > 13) { //If card value is not between 1-13
            card = askCard(player);
        }

        //If the asked card doesn't exist in the current player's cards array
        else if (playerArray[turn].cards.indexOf(card) == -1) { //ALWAYS TRUE, WHY?
            card = prompt('The deck has: ' + deck.length + ' cards left in it.\n' +
                          'Your current cards are: ' + playerArray[turn].cards.join(' - ')
                          + '\n' + player + ', all your:');
        }

        else {
            wrongCard = false; //Jump out of loop
        }
    }

A: Use
playerArray[turn].cards.indexOf(parseInt(card,10)) == -1)


text:
Q: How to do short form for number sequence using php I got confused how to make short form for sequence number
i have an array elements like
$a = [2,3,4,7,8,9,10,11,13,15]

But i need output like
2-4, 7-11, 13, 15

Can you any body suggest how to do it in PHP?. Thank you

A: function group_nums($array) {
   $ret  = array();
   $temp = array();
   foreach($array as $val) {
      if(next($array) == ($val + 1))
         $temp[] = $val;
      else
         if(count($temp) > 0) {
            $temp[] = $val;
            $ret[]  = $temp[0].'-'.end($temp);
            $temp   = array();
         }
         else
            $ret[] = $val;
   }
   return $ret;
}

Test


text:
Q: LaTeX lstlisting's style for character literals As we all know, we can specify the style for string literals in lstlisting by using stringstyle= But in some parts of my code, I have character literals (i.e. when I .Split() some string). And those are not interpreted as strings (that's actually good). So I want to color them. Let's say strings are green, so I want to color those character literals in red/orange (kinda like in Visual Studio).
So my question here is: Is there a way to color those character literals in lstlisting, so i.e. this line:
var foo = bar.Split(')');

would get its ')' part in color?

A: I assume you are working with C language, therefore the code below might do the work
\documentclass{article}
\usepackage{listings}
\lstset{breaklines = true, frame = trBL, tabsize = 4, basicstyle = \small \ttfamily, keywordstyle = \color{blue}, stringstyle = \color{red}, rulecolor = \color{black}}
\usepackage[usenames, dvipsnames]{color}

\begin{document}

\begin{lstlisting}[language = C]
var foo = bar.Split(')');
\end{lstlisting}

\end{document}

which would produce

A: listings only supports a single stringstyle value, even if different string types have been defined. If you want to define a new string type with a different style, you can use the optional argument of the morestring option:
\documentclass{article}
\usepackage{listings}
\usepackage{xcolor}

\lstset{
    string = [d]{"},
    stringstyle = {\color{blue}},
    morestring = [d][\color{orange}]{'}
}

\begin{document}
\begin{lstlisting}
var bar = "foo(bar)baz";
var foo = bar.Split(')');
\end{lstlisting}
\end{document}

outputs

[d] here defines a string where the opening and closing delimiter is the same ('), and [\color{orange}] is the style to be applied to the new string type.