text:
Q: How to pass input value from multipart/form-data in jsp to servlet? I know that maybe it can be a duplicated question, i read similar post on internet, but i cannot send my input value from jsp to servlet.
I can upload file but i need to send an input value.
Servlet:
try {
                FileItemIterator iterator = upload.getItemIterator(req);
                while (iterator.hasNext()) {
                    FileItemStream item = iterator.next();
                    InputStream in = item.openStream();

                        if (item.isFormField()) {
                            out.println("Got a form field: " + item.getFieldName());

                            } else {
                                String fieldName = item.getFieldName();
                                String fileName = item.getName();
                                String contentType = item.getContentType();
                                String fileNameWithOutExt = FilenameUtils.removeExtension(fileName);

                                out.println("--------------");
                                out.println("fileName = " + fileName);
                                out.println("Kind = " + fileNameWithOutExt);
                                out.println("field name = " + fieldName);
                                out.println("contentType = " + contentType);

                                String fileContents = null;
                                try {

                                    fileContents = IOUtils.toString(in);
                                    out.println("lenght: " + fileContents.length());

                                    String[] content = fileContents.split("\n");

                                    String[] property = content[0].split(",");

                                    out.println("lunghezza " + property.length);
                                    for (String propr : property) {
                                         out.println("prop: " + propr);
                                     }
                                    //out.println(Arrays.toString(property));
                                    //out.println(fileContents);
                                } finally {
                                    IOUtils.closeQuietly(in);
                                            }

                                    }
                                            }
                } catch (SizeLimitExceededException e) {
                    out.println("You exceeded the maximu size ("
                            + e.getPermittedSize() + ") of the file ("
                            + e.getActualSize() + ")");
                                                    }
            } catch (Exception ex) {

                throw new ServletException(ex);
                                }
                                                            }

And that's my jsp
    <form action="/upload_kind" method="post"  enctype="multipart/form-data" >
<input type="file" name="file" size="50" />
<input type="text" name="namespace" id="namespace">
<br />
<input type="submit" value="Upload File" />
</form>

I read about a "item.getString()" method but it's in DiskFileItem class and not in FileItemStream, so i can see that "namespace" is sent, but i cannot see its value.
Thx and sorry for my bad english

A: Following the duplicated link, i was able to resolve my problem. I used this code:
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    try {
        List<FileItem> items = new ServletFileUpload(new DiskFileItemFactory()).parseRequest(request);
        for (FileItem item : items) {
            if (item.isFormField()) {
                // Process regular form field (input type="text|radio|checkbox|etc", select, etc).
                String fieldName = item.getFieldName();
                String fieldValue = item.getString();
                // ... (do your job here)
            } else {
                // Process form file field (input type="file").
                String fieldName = item.getFieldName();
                String fileName = FilenameUtils.getName(item.getName());
                InputStream fileContent = item.getInputStream();
                // ... (do your job here)
            }
        }
    } catch (FileUploadException e) {
        throw new ServletException("Cannot parse multipart request.", e);
    }

    // ...
}


text:
Q: "Related Items" in Ruby How can I implement a 'related items' feature for posts in a blog? I would like to return a list of similar posts based on analysis of post titles.
My own ideas for doing this seem very inefficient and I wonder if there are tools that already support this functionality. I didn't find any help via google, ruby toolbox, and I looked at sunspot api. How would you achieve this in your blog application/content site?
Update
For those interested in this functionality, I decided to go with sunspot which allows me to use this in my show action:
@find_related = Post.search do
  fulltext params[:title]
end

This returns an array of related posts:
@related = @find_related.results

Thanks for all the feedback and this railscast was a big help

A: Sure there are some good and efficient tools for that! Technically, what you want is a full text search on an indexed database of post titles/other data. We have tools that run external database that handles all the searching and indexing. Those backends are universal and not in ruby, you only use client logic in your app. That's very efficient, as you probably won't be able to implement any other algorithms than existing ones. I would recommend the following:

*

*ThinkingSphinx - wrapper for Sphinx

*elastic search - wrapper for Lucene

*sunspot - wrapper for Solr

These libraries provide client logic for data exchange with above mentioned search engines (all are from Apache foundation)

A: I am not sure if your requirements allow this, however blog posts generally have tags.
You could use the tags in your blog posts as a way of filtering other related posts, because posts with similar tags should be related somehow. You can then sort by count of matched tags and latest date published.

A: There are a few ways to do this, both with different pros and cons.
The easy way would involve tagging your posts with key words and then using those to pull other articles that have matching tags and then sorting those results by the number of identical tags. As long as the tags you place on the content represent it well then this produces good results without many false positives. And as far as I know this is how many blogging platforms implement the feature.
The more complex method would involve using NLP to parse the titles of each post and calculate the fitness to another post. This would involve writing more code and may produce false positives. However you wouldn't have to tag posts by hand and you can tweak the methods used to find posts if you want to weight certain words or phrases. Take a look at Treat, the Text Retrieval, Extraction and Annotation Toolkit it seems like a good starting point for Ruby NLP.

A: If you are going by the words in the title, this crude simplistic solution might give you a stepping stone for something production ready:
#assume titles is an array of arrays of the words of titles and title is the one we are trying to mach with
HOW_MANY_RELATED_WORDS=3
titleWords=title.split(' ').sort
related=[]
trues=0
titles.each do |t|
  t.each do |word|
    true+=1 if titleWords.include?(word)
  end
  related<<t.join(' ') if(trues>=HOW_MANY_RELATED_WORDS)
end

redpajama_set_name: RedPajamaStackExchange


text:
Q: How to Put validation in dynamic display column I have <mat-select> with ngFor which displays a list of rows from the table. I need to put validation in column type that I should be able to select only 1 key and then, the user should not be able to select key in type dropdown.
// Code for html(Angular 7)
<!-- Column for Type-->
<ng-container matColumnDef="type">Type
<mat-header-cell *matHeaderCellDef mat-sort-header>Type</mat-header-cell>
<mat-cell *matCellDef="let element">
  <mat-select placeholder="Select Type" [(ngModel)]="element.type" (selectionChange)="checkTypeValidation(element,element.type)">
    <mat-option *ngFor="let type of typeColumn" [value]="type">
      {{ type }}
      <div *ngIf = "element.type === "></div>
    </mat-option>
  </mat-select>
</mat-cell>
</ng-container>

This is the code which displays the type of row. It's a mat-select with 6 options. However, for now, there is no validation. You can choose every row as key, time, segment.
I want to put a validation that only one row can be of type key:
// Code for Typescript
  typeColumn = [
    'None',
    'Time',
    'Segment',
    'Key',
    'Input',
    'Quantile'
  ];

This typescript code gives you the option to choose the option in mat-dropdown for Type column. I should be able to select only one row as key.

A: I set the option as disabled whenever selected and enabled it again when changed:
<mat-select placeholder="Type" (selectionChange)="changed($event)">

  changed(event){
    if(event.value.type == 'Key'){
       //when there was a value previously, allow it again
       if(this.previous[event.source.id] != undefined){
         this.typeColumn[this.previous[event.source.id]].allowed = true;
       }
       this.previous[event.source.id] = event.value.index;
       //disable the selected option
       this.typeColumn[event.value.index].allowed = false;
    }
  }

See the Demo for detailed code.
I'm sure you can build a solution from this:
Full Demo


text:
Q: storing sections of text file into multiple dictionary entries based on location Extreme beginner to python (somewhat new to coding). Searched around, got some helpful hints, but my particular case is a little more complicated than other related stackoverflow posts (that I could find at least).
I have a text file of results. Theres a particular part of the file where "Summary" is written and that's overall section I want to focus collection on. After the
Summary:

line, there are 5 subsections, which have their own data, that I want to store as keys in the dictionary. The subsections will be called, level1, level2,-->level5.
The beginning of each subsection has a line with only that subsection's name, i.e.
level1:

So, to summarize:
 Create a dictionary with 5 keys (labeled level1-->level5) that each have contain the line data from that subsection, but make sure that once the subsequent level is reached, to stop saving the data for the previous keys.
Here is what I have so far (WARNING: the following is extremely sloppy code and it might cause pain for more experienced coders):
results = sys.argv[1]
seen_start = False
seen_1 = False
seen_2 = False
seen_3 = False
seen_4 = False
seen_5 = False
results_matrix = {}
j = 'level1'
k = 'level2'
l = 'level3'
m = 'level4'
n = 'level5'

with open(results, "r") as f:

    for line in f:
        if line.find("Summary:") ==0:
            seen_start = True
            continue

        if seen_start:

            if line.find(j) ==0:
                seen_1 = True
                continue

            elif line.find(k) ==0:
                seen_1 = False
                seen_2 = True
                continue
            elif line.find(l) ==0:
                seen_2 = False
                seen_3 = True
                continue
            elif line.find(m) ==0:
                seen_3 = False
                seen_4 = True
                continue
            elif line.find(l) ==0:
                seen_4 = False
                seen_5 = True
                continue

        if seen_1 and line <> '\n':
            results_matrix[j] = (line.rstrip('\n'))
            if line.find(k) ==0:
                seen_1 = False
                seen_2 = True
                continue

        if seen_2 and line <> '\n' :
            results_matrix[k] = (line.rstrip('\n'))
            if line.find(l) ==0:
                seen_2 = False
                seen_3 = True
                continue
            print results_matrix[k]

Believe it or not, the code actually saves the latest subsection correctly, but saves the previous entries as the last line for that subsection. i.e. results_matrix[k] will work in this instance but results_matrix[j] has entries of only the last line for that section

Thank you very much for your input!

A: results_matrix[j] = (line.rstrip('\n')) rewrites results_matrix[j] on every line, so only the last line is seen. Try adding:
results_matrix[j] = ""
before the for loop then:
results_matrix[j] = results_matrix[j] + line
Using the rstrip will run all your lines together.


text:
Q: Header not fixing in firefox My website header not fixing in the top in firefox. https://www.ruralserver.com, its header bottom is not working fine. It's working fine on Chrome.
I have already tried this code:
.site-header .bottom {
    background-attachment: scroll;
    background-clip: border-box;
    background-color: #434d54;
    background-image: none;
    background-origin: padding-box;
    background-position: 0 0;
    background-repeat: repeat;
    background-size: auto auto;
    height: 75px;
    margin-bottom: 0;
    margin-left: auto;
    margin-right: auto;
    margin-top: 0;
    padding-bottom: 0;
    padding-left: 20px;
    padding-right: 20px;
    padding-top: 0;
    position: relative;
    width: 100%;
}

It is working on all other browser without making any changes. but not working on Firefox. so please help on this. open website link on chrome and than in Firefox to show different.

A: You can use position:fixed
.top {
  position: fixed;
  top:0px;
  width: 100%;
  margin: 0 auto;
  height: 40px;
  background: #374147;
  padding: 8px 20px;
  -webkit-transform-origin: 50% 100%;
  -moz-transform-origin: 50% 100%;
  transform-origin: 50% 100%;
}


text:
Q: Extracting data using regex in python I have a string variable whose data looks something like this:
a:15:{s:6:"status";s:6:"Active";s:9:"checkdate";s:8:"20130807";s:11:"companyname";s:4:"test";s:11:"validdomain";s:19:"test";s:7:"md5hash";s:32:"501yd361fe10644ea1184412c3e89dce";s:7:"regdate";s:10:"2013-08-06";s:14:"registeredname";s:10:"TestName";s:9:"serviceid";s:1:"8";s:11:"nextduedate";s:10:"0000-00-00";s:12:"billingcycle";s:8:"OneTime";s:7:"validip";s:15:"xxx.xxx.xxx.xxx";s:14:"validdirectory";s:5:"/root";s:11:"productname";s:20:"SomeProduct";s:5:"email";s:19:"testmail@test.com";s:9:"productid";s:1:"1";}

I am trying to extract the quoted data into a dictionary as a key-value pair like so:
{"status":"Active","checkdate":20130807,.............}

I tried extracting it using the following:
tempkeyresults = re.findall('"(.*?)"([^"]+)</\\1>', localdata, flags=re.IGNORECASE)

I'm quite new to regex and I assume what I am trying to query translates to "find and extract all data between " and " and extract it before the next "..." However, this returns and empty string([]). Could someone tell me where I am wrong?
Thanks in advance

A: How about this?
>>> import re
>>> s = 'a:15:{s:6:"status";s:6:"Active";s:9:"checkdate";s:8:"20130807";s:11:"companyname";s:4:"test";s:11:"validdomain";s:19:"test";s:7:"md5hash";s:32:"501yd361fe10644ea1184412c3e89dce";s:7:"regdate";s:10:"2013-08-06";s:14:"registeredname";s:10:"TestName";s:9:"serviceid";s:1:"8";s:11:"nextduedate";s:10:"0000-00-00";s:12:"billingcycle";s:8:"OneTime";s:7:"validip";s:15:"xxx.xxx.xxx.xxx";s:14:"validdirectory";s:5:"/root";s:11:"productname";s:20:"SomeProduct";s:5:"email";s:19:"testmail@test.com";s:9:"productid";s:1:"1";}'
>>> results = re.findall('"(\w+)"', s)
>>> dict(zip(*[iter(results)] * 2))
{'status': 'Active', 'companyname': 'test', 'validdomain': 'test', 'md5hash': '501yd361fe10644ea1184412c3e89dce', 'regdate': 'registeredname', 'TestName': 'serviceid', 'email': 'productid', 'billingcycle': 'OneTime', 'validip': 'validdirectory', '8': 'nextduedate', 'productname': 'SomeProduct', 'checkdate': '20130807'}

*

*\w means "any word character" (letters, numbers, regardless of case, and underscore (_))

*+ means 1 or more.

*dict(zip(*[iter(results)] * 2)) is very well explained in this answer

A: This one, find all the words surrounding by quotes and then slices the list to mapping:
>>> res = re.findall('"(\w+)"', s)
>>> i = iter(res)
>>> dict(zip(*[i]*2))
{'status': 'Active', 'companyname': 'test', 'validdomain': 'test', 'md5hash': '501yd361fe10644ea1184412c3e89dce', 'regdate': 'registeredname', 'TestName': 'serviceid', 'email': 'productid', 'billingcycle': 'OneTime', 'validip': 'validdirectory', '8': 'nextduedate', 'productname': 'SomeProduct', 'checkdate': '20130807'}

Or use this one. This will use regex to find all the pairs(adjacent two):
>>> res = re.findall('"(\w+)"(?:.*?)"(\w+)"', s)
>>> res
[('status', 'Active'), ('checkdate', '20130807'), ('companyname', 'test'), ('validdomain', 'test'), ('md5hash', '501yd361fe10644ea1184412c3e89dce'), ('regdate', 'registeredname'), ('TestName', 'serviceid'), ('8', 'nextduedate'), ('billingcycle', 'OneTime'), ('validip', 'validdirectory'), ('productname', 'SomeProduct'), ('email', 'productid')]
>>> dict(res)
{'status': 'Active', 'companyname': 'test', 'validdomain': 'test', 'md5hash': '501yd361fe10644ea1184412c3e89dce', 'regdate': 'registeredname', 'TestName': 'serviceid', 'email': 'productid', 'billingcycle': 'OneTime', 'validip': 'validdirectory', '8': 'nextduedate', 'productname': 'SomeProduct', 'checkdate': '20130807'}

A: You can do it without regular expressions.
parts = s.split('"')[1::2] # get all quoted text in a list
keys, values = parts[::2], parts[1::2] # take even and odd items (keys, values)
results = dict(zip(keys, values)) # turn it into a dict

results:
{'status': 'Active', 'companyname': 'test', 'validdomain': 'test', 'productid': '1', 'md5hash': '501yd361fe10644ea1184412c3e89dce', 'regdate': '2013-08-06', 'registeredname': 'TestName', 'email': 'testmail@test.com', 'serviceid': '8', 'nextduedate': '0000-00-00', 'billingcycle': 'OneTime', 'validip': 'xxx.xxx.xxx.xxx', 'productname': 'SomeProduct', 'checkdate': '20130807', 'validdirectory': '/root'}


text:
Q: How to mix High-Z and Low-Z audio signals? (Sum should be High-Z) I'm trying to inject additional sound into a phone call. Therefore i modified a basic cable headset to use audio from my iPod.
This is my current prototype circuit:

That circuit is already working, but has some disadvantages due to the very basic passive mixing. When i turn up the iPod's volume it get louder and louder, but it also starts to decrease the mic volume.
Basically I'd like to be able to increase the iPod's volume without affecting the microphone level.
I think it has something to do with the iPod being a low impedance device (around 32Ω i think) and the electret mic being a high-Z device (around 1.5 k – 10 kΩ). Maybe there's also a problem with the power? The mic will only produce several millivolts, where as the iPod can supply more than 1 volts?
How could i improve my circuit, but still keet the headset recognized as a high impedance device. (if it's low-Z, the phone won't detect it properly).
Thanks in advance & bye!
Hans

A: You could do something like this if you're not afraid of op amps. The microphone gets its high impedance, and if it needs higher impedance, increase R1. I have the iPod a 330 Ohm load because I seem to remember reading somewhere that's a good starting point. The output impedance is 10k, and can be increased if necessary. This circuit has a gain of 2, so if you need less, decrease R6, and if you need less than 1, switch it to an inverting configuration. Trying to sum these inputs passively is going to require a matching network.


text:
Q: Websockets for client/server communication in chrome packaged app I have thoroughly looked at the Chrome packaged app website and sample apps but I couldn't find any example related to websockets implementation in an app. I was wondering if there is any example or sample app that uses Websocket for client/server communication in Chrome app? If not then is there any guide? Is it even possible to use WebSocket? I am using Apache HTTP as my server which is in Python.

A: I'm assuming you're asking about implementing a WebSocket server, because the browser natively supports the client. (Though if you wanted, you could definitely implement the WebSocket client because you have access to the raw TCP interface.)
The Chrome Apps has published a sample WebSocket chat server that servers HTTP requests to load the chat client and uses WebSockets to send messages between clients.
If you look through the implementation, you see it uses the older chrome.socket API to listen to a TCP socket and respond with the correct WebSocket HTTP headers. It does all the bit manipulation to send and receive frames of data as required by the WebSocket spec.


text:
Q: Query has no destination in a plpgsql function? I have this function and its giving an error:

query has no destination for result data

Function:
CREATE OR REPLACE FUNCTION "alarmEventList"(sampleid integer
                            , starttime timestamp without time zone
                            , stoptime timestamp without time zone)
RETURNS text[] AS
$BODY$BEGIN
select array_agg(result::text)
from (
    select to_char("Timestamp", 'YYYY-MM-DD HH24:MI:SS')
    ,"AlertLevel"
    ,"Timestamp" - lag("Timestamp") over (order by "Timestamp")
           from "Judgements"
           WHERE "SampleID" = sampleid
           and "Timestamp" >= starttime
           and "Timestamp" <= stoptime
         ) result
    where "AlertLevel" > 0;
return result;
END
$BODY$
LANGUAGE plpgsql VOLATILE

After I try to run this:
CREATE OR REPLACE FUNCTION alarm_event_list(sampleid integer
                           , starttime timestamp without time zone
                           , stoptime timestamp without time zone)
  RETURNS text[] AS $$
 select array_agg(result::text)
from (
    select to_char("Timestamp", 'YYYY-MM-DD HH24:MI:SS')
    ,"AlertLevel"
    ,"Timestamp" - lag("Timestamp") over (order by "Timestamp")
           from "Judgements"
           WHERE "SampleID" = sampleid
           and "Timestamp" >= starttime
           and "Timestamp" <= stoptime
         ) result
    where "AlertLevel" > 0;
$$ LANGUAGE SQL;

gives me an error saying "sampleid" does not exist even though is just a declare parameter.
I don't know why since I'm placing everything in the result.

A: Result of any embedded query should be saved to some result (or you have to use a PERFORM statement) in plpgsql language.
you can write a function:
CREATE OR REPLACE FUNCTION foo(..)
RETURNS text[] AS $$
DECLARE result text[];
BEGIN
  result := (SELECT array_agg(...) FROM sometable);
  RETURN result;
END; $$
LANGUAGE plpgsql;

or
CREATE OR REPLACE FUNCTION foo(..)
RETURNS text[] AS $$
DECLARE result text[];
BEGIN
  SELECT INTO result array_agg(...) FROM sometable;
  RETURN result;
END; $$
LANGUAGE plpgsql;

A: In addition, I would simplify the function with an OUT parameter:
CREATE OR REPLACE FUNCTION foo(.., OUT result text[]) AS
$func$
BEGIN
  SELECT INTO result array_agg(...) FROM sometable;
END
$func$ LANGUAGE plpgsql;
This way, the OUT parameter defines the return type as well as the variable to hold the result from the query.
You can skip the RETURNS clause, the DECLARE section and the variable declaration as well as the RETURN statement. The function does the same.
You could also just use an SQL function:
CREATE OR REPLACE FUNCTION foo(..)
  RETURNS text[] AS
$func$
SELECT array_agg(...) AS result FROM sometable;
$func$ LANGUAGE sql;


text:
Q: Lifting action to the sphere Consider the free action of $\mathbb{Z}_2$ on $\mathbb{C}P^n$( $n$ is odd ) by $$[z_0,\dots, z_n]\rightarrow [-\overline z_1,\overline z_0,\dots,-\overline z_{n-1},\overline z_n].$$ Consider the orbit space $\mathbb{C}P^n/\mathbb{Z}_2$. My question is it possible to define a free group action by some group $G$ on $S^{2n+1}$ such that $S^{2n+1}/G$ is homeomorphic to  $\mathbb{C}P^n/\mathbb{Z}_2$? Obviously $G$ cannot be a finite group.
Thanks in advance.


text:
Q: Is there a differentiable surjective map from $\mathbb{Q}^m$ to $\mathbb{Q}^n$ where $n>m$? I want to know if there can exist a map of $n$ polynomials in $m$ variables, over the Rational numbers, $\mathbb{Q}^m$, such that if each polynomial corresponded to a coordinate in n dimensional Rational space, the map would be surjective.
If we were working over the Real numbers (or any smooth manifold), then we could use Sard's mini theorem to show that this type of map can't exist (because any such map would have measure $0$).
If we can show that a continuous differentiable map from $\mathbb{R}^m$ to $\mathbb{R}^n$, that maps all of the Rational values in $\mathbb{R}^m$ to the Rational values in $\mathbb{R}^n$ either

*

*can not have measure zero,

*must be closed,

*must contain some ball of nonzero radius,

then my question will be answered.
Intuitively, I think that if such a map exists over the Rationals then it could be extended to a surjective map over the Reals, so I think that such a map can't exist, but I have been unable to prove it.
Any comments or ideas are appreciated.

A: There is such a smooth map. Let $S$ be any countable subset in $\mathbb{R}^n$, consisting of points $s_i$. To build a surjective smooth map from $\mathbb{Q}$ to $A$ just send  $[2i, 2i+1]$ to $s_i$ and interpolate smoothly (using bump functions) on $[2i+1, 2i+2]$. Of course if you want a map from $\mathbb{Q}^m$ you can just project to $\mathbb{Q}$ first.
Polynomial maps is another kettle of fish entirely.
You can see that there is no such polynomial map from $\mathbb{Q}$ to any $\mathbb{Q}^n$ ($n>1$) by arguing along the lines outlined in your answer, because single-variable polynomial maps are proper. Any proper, continuous, surjective map $\mathbb{Q} \to \mathbb{Q}^n$ has a continuous, proper extension to a map $\mathbb{R} \to \mathbb{R}^n$ which will also be surjective (approximate $p\in \mathbb{R}^n$ by points  $p_i$ in $\mathbb{Q}^n$; pick a sequence of their preimages; it will lie in some compact, and so subconverge to some $s$; that $s$ is sent to $p$).
In fact there is never a polynomial map of the kind you ask about for very general reasons: Surjective morphism of affine varieties and dimension, Surjective Morphism of affine algebraic variety etc.


text:
Q: Question about the order of a Stationary subset of $ \kappa$ Greets
I'm trying to prove one part of exercise 8.14 of Jech's "Set Theory", namely that if $o(k)\geq k$, then $k$ is weakly inaccessible, where $\kappa$ is regular; $o(\kappa)$ is defined as follows:
For any stationary subsets $S,T$ we define $S<T$ iff $S\cap \alpha$ is stationary in $\alpha$ for almost all $\alpha\in T$, Jech proves that $<$ is a well-founded relation, and thus he defines for any stationary $X$, $o(X)=\operatorname{sup}\{o(Y)+1: Y<X\}$, and $o(\kappa)=\operatorname{sup}\{o(Y)+1: Y$ is a stationary subset of $\kappa\}$.
Some preliminaries to this exercise are :

*

*The set of closed unbounded subsets fo $\kappa$ is closed under intersections of less than $\kappa$ elements, and it is also closed under diagonal intersections.

*If $\lambda<\kappa$ is the $\alpha$th regular cardinal, then $o(E_{\lambda}^{\kappa})=\alpha$.

To prove this part of the exercise I need only to show that if $X,Y,Z$ are stationary subsets of $\kappa$ such that $X<Y$ and $o(Y)=o(Z)$, then $X<Z$, I don't know whether this property is true or not, if it is true, I would like to see a proof of it, or a hint to solve Jech's exercise.
Thanks

A: I will give an answer to Jech's exercise.
Let $F:\mathrm{Ord}\to\mathrm{Card}$ be the enumeration of the regular cardinals.
First of all observe that if $A<B$ and $C\subseteq B$ (and $C$ is stationary) then $A<C$. This follows almost immediately: If $D$ is a club set such that for all $\alpha\in B\cap D$ we have that $A\cap\alpha$ is stationary, then the same club gives that for all $\alpha\in C\cap D$ that $A\cap\alpha$ is stationary. From this follows that if $C\subseteq B$ then $o(C)\geq o(B)$.

Claim 1: If $A$ is stationary on $\kappa$, then almost all elements of $A$ have cofinality less that $\kappa$.

Proof:
If $\kappa$ is regular this is trivial. If $\kappa$ is not regular then take $f:\mathrm{cf}(\kappa)\to\kappa$ a normal and unbounded function. $f_{-1}(A)$ is stationary on $\mathrm{cf}(\kappa)$. Notice that $\mathrm{cf}(\kappa)>\mathrm{cf}(\beta)\geq\mathrm{cf}(f(\beta))$ for all $\beta\in\mathrm{cf}(\kappa)$. Also notice that $f[\mathrm{cf}(\kappa)]$ is club in $\kappa$. Hence $A\setminus f[\mathrm{cf}(\kappa)]$ the set of potential elements whose cofinality may be greater than or equal to $\kappa$ is non-stationary on $\kappa$.

Claim 2: If $A$ is a stationary subset of $\kappa$ whose elements have cofinality $\lambda$, then $o(A)=F^{-1}(\lambda)$.

Proof:
The proof is by induction on $F^{-1}(\lambda)$. For $0$ we have that all elements of $A$ have cofinality $\omega$, and hence its order is $0$ be definition.
Assume it is true for all $\beta<\alpha$ and let $A$ be a stationary subset of $\kappa$ such that all the elements of $A$ have cofinality $F(\alpha)$. First of all $o(A)\geq \alpha$ since $E^\kappa_{F(\beta)}<A$ for all $\beta<\alpha$.
Take $B<A$. Let $C$ be a club such that for all $\xi\in A\cap C$, $B\cap\xi$ is stationary. I claim that $B'=B\cap\{\xi\in\kappa : \mathrm{cf}(\xi)<F(\alpha)\}$ is stationary. Indeed if not, there is a club $H$ such that $B'\cap H=\varnothing$. Then for $\xi\in A\cap C\cap H$, we have that $H\cap\xi$ is a club subset of $\xi$ and $B'\cap H\cap\xi=\varnothing$, contradicting Claim 1, that almost all elements of $B\cap\xi$ have cofinality less than $F(\alpha)$.
Define the function  $g:B'\setminus(F(\alpha)+1)\to\kappa$ as $g(\gamma)=\mathrm{cf}(\gamma)$. Notice that $g$ is regressive and thus by Fodor's Theorem $g$ is constant on a stationary set $B''\subseteq B'$. Then all elements of $B''$ have cofinality $F(\beta)$, where $\beta<\alpha$, and by the induction hypothesis $o(B'')=\beta$. By the observation above $o(B'')\geq o(B')\geq o(B)$. Hence for all $B<A$ we have $o(B)<\alpha$ and thus $o(A)\leq\alpha$. This completes the proof of Claim 2.

Claim 3: If $\kappa$ is a regular cardinal and $F^{-1}(\kappa)<\kappa$ then $o(\kappa)<\kappa$.

Proof:
Take $A$ a stationary subset of $\kappa$. Since $F^{-1}(\kappa)<\kappa$, the set of regular cardinals below $\kappa$ is bounded in $\kappa$. Hence almost all elements of $A$ are singular cardinals, so let's assume that $A'\subseteq A$ is a stationary subset of $\kappa$ that contains only singular cardinals. Then as in Claim 2, define a map that sends all elements of $A'$ to their cofinality. By Fodor's Theorem there is a stationary set $A''\subseteq A'$ such that all its elements have cofinality $\lambda<\kappa$. Then $o(A'')=F^{-1}(\lambda)<F^{-1}(\kappa)<\kappa$. From the observation in the beginning we have that $o(A)\leq o(A'')$. Thus $o(A)<F^{-1}(\kappa)$, hence $o(\kappa)\leq F^{-1}(\kappa)$.

Claim 3 is enough to show the contrapositive of what you want, since if $\kappa$ is a regular successor then $F^{-1}(\kappa)<\kappa$.


text:
Q: LM393 comparator is not working I have shown output image description here in my Lm 393 comparator, my output is not coming proper square wave.picture is shown below.i have described my circuit. practically
I am using voltage comparator LM393 for comparing two signals, one signal is my reference signal which is a triangle wave, with voltages 2.08 volt generated by 555 timers above 200kHZ giving to the input terminal of inverting side of LM393 and input signal or modulating signal which voltage is less than 2.08 giving from function generator as a sinusoidal signal in the range of 1 Hz to 20kHz in the noninverting side of LM393. My question is when I am providing two signals it should be compared and give a square wave, but LM393 only taking triangle wave, sin wave is not going? why I don't understand. please give suggestion to the above points. In this picture below, I am referring to this circuit, please tell me what 's wrong in this circuit, when I am taking triangle wave from 555 timer ad providing into the comparator and another signal providing from the generator.

A: Okay, so you appear to have a time constant of about 2 microseconds on the output.
If  your pullup is actually 10K, that implies a capacitance of about 200pF, which seems a bit high even including your scope probe (use the x10 probe setting to minimize loading).
Check that the resistor is actually 10K and not, say, 100K.
Edit: It is very hard to read the pin names on  your schematic. It appears you have COM connected to Vss but not grounded!
Also, this is not causing your problem, but you should not let the inputs float on the CMOS hex inverter.


text:
Q: How to create a moq unit test when grouping by class This is my code:
var data = context.GetAll<UserRole>()
   .GroupBy(x => new RoleGroup { RoleId = x.RoleId, AccessEnum = x.AccessEnum })
   .Where(x => x.Count() > 1);

This is the data mock:
var userRoles = new List<UserRole>
{
    new UserRole { Id = 1, RoleId = 1, AccessEnum = AccessEnum.Full },
    new UserRole { Id = 2, RoleId = 1, AccessEnum = AccessEnum.Full },
    new UserRole { Id = 3, RoleId = 2, AccessEnum = AccessEnum.ReadOnly },
    new UserRole { Id = 4, RoleId = 2, AccessEnum = AccessEnum.Full },
    new UserRole { Id = 5, RoleId = 2, AccessEnum = AccessEnum.ReadOnly }
};
mockContext.Setup(x => x.GetAll<UserRole>()).Returns(userRoles.AsQuerable());

The GroupBy works fine when using the system. However when I run a unit test it returns each record individually. If I change the GroupBy to an anonymous object, it does work:
.GroupBy(x => new { x.RoleId, x.AccessEnum })

But I need to pass the list into another method. So I need to define the key as a RoleGroup.
Is there a way to get this working by keeping the class in the GroupBy?


text:
Q: A group of order 28 with a normal Sylow 2-subgroup is abelian How to prove that the group of order 28 which have normal subgroup of order 4 is Abelian group?

A: Let $G$ be the group of order $28$, $N$ the normal subgroup of order $4$, and let $K = G/N$ be the quotient group, which has order $7$ and is therefore cyclic.  By the Schur-Zassenhaus Theorem, $G$ is a semidirect product of $N$ and $K$.  It will be abelian iff the semidirect product is actually direct.
In order to give a nontrivial semidirect product here, it is necessary and sufficient to find a nontrivial homomorphism from
$K$ into the automorphism group $\operatorname{Aut}(N)$ of $N$, or equivalently an element of order $7$ in $\operatorname{Aut}(N)$.  But $N$ is either cyclic of order $4$ -- in which case $\operatorname{Aut}(N)$ has order $2$ -- or is the Klein group $C_2 \times C_2$, in which case $\operatorname{Aut}(N)$ has order $6$.  Either way there is no element of order $7$.
Alternately, consider what Sylow theory has to say about the Sylow $7$-subgroups.

Note: of course the second method, which is only hinted at, is probably what is intended.  But the two methods interact in an interesting way with regard to the following more general problem.

Suppose $G$ is a finite group of order $np$ with $p$
  a prime number which does not divide $n$, and that there is an abelian normal subgroup $N$ of order $n$.  Under what conditions on $N$ and $p$ is $G$ necessarily abelian?

If you use Sylow theory, you get that it is enough for $p$ to be sufficiently large compared to $n$.  (One can be explicit; I don't want to be yet to give the OP some time to think about his particular problem.)  Now comparing to the approach of showing that any semidirect product of $N$ with the cyclic group of order $p$ is necessarily direct one gets information about the largest prime $p$ which divides the order of
the automorphism group $\operatorname{Aut}(N)$.  It could be fun to explore this further.  (More fun than proving something about groups of order $28$, anyway.  This type of overly specific question tends to bore me.)

A:
This was an answer to a merged question.

No, any group of order $28$ which contains a normal subgroup of order $4$ is necessarily abelian.
The number of $7$-Sylow subgroups must be a divisor of $4$, and also congruent to $1$ modulo $7$, hence there is a unique $7$-Sylow subgroup which is necessarily normal. If $G$ contains a normal subgroup of order $4$, then the $2$-Sylow subgroup is normal.
So since all the Sylow subgroups are normal, $G$ is isomorphic to the direct product of its Sylow subgroups,
$$
G\simeq P_7\times P_2
$$
where $P_7$ is the Sylow $7$-subgroup, and $P_2$ is the $2$-Sylow subgroup. Thus $G$ is abelian.


text:
Q: How do you use blank lines in your code? There has been a few remarks about white space already in discussion about curly braces placements.
I myself tend to sprinkle my code with blank lines in an attempt to segregate things that go together in "logical" groups and hopefully make it easier for the next person to come by to read the code I just produced.
In fact, I would say I structure my code like I write: I make paragraphs, no longer than a few lines (definitely shorter than 10), and try to make each paragraph self-contained.
For example:

*

*in a class, I will group methods that go together, while separating them by a blank line from the next group.

*if I need to write a comment I'll usually put a blank line before the comment

*in a method, I make one paragraph per step of the process

All in all, I rarely have more than 4/5 lines clustered together, meaning a very sparse code.
I don't consider all this white space a waste because I actually use it to structure the code (as I use the indentation in fact), and therefore I feel it worth the screen estate it takes.
For example:
for (int i = 0; i < 10; ++i)
{
    if (i % 3 == 0) continue;

    array[i] += 2;
}

I consider than the two statements have clear distinct purposes and thus deserve to be separated to make it obvious.
So, how do you actually use (or not) blank lines in code ?

A: Always
Whitespace is crucial to clean readable code. A blank line (or two) help visually separate out logical blocks of code.
For example, from Steve McConnell's Code Complete, Second Edition chapter on Layout and Style:

Subjects scored 20 to 30 percent higher on a test of comprehension when programs had a two-to-four-spaces indentation scheme than they did when programs had no indentation at all. The same study found that it was important to neither under-emphasize nor over emphasize a program's logical structure. The lowest comprehension scores were achieved on programs that were not indented at all. The second lowest were achieved on programs that used six-space indentation. The study concluded that two-to-four-space indentation was optimal. Interestingly, many subjects in the experiment felt that the six-space indentation was easier to use than the smaller indentations, even though their scores were lower. That's probably because six space indentation looks pleasing. But regardless of how pretty it looks, six-space indentation turns out to be less readable. This is an example of a collision be tween aesthetic appeal and readability.

A: I get criticized a lot for writing my code this way. I don't understand why anyone would not do it this way.
Readability it so important when you come back to a project after an extended period of time and I've heard a saying "Always write code if the next guy who is reading it is a Psychopath who knows your location".

A: I don't always write software, but when I do, I use blank lines for clarity.

A: I'm all for making code as clear as possible, and whitespace is often a useful tool in that endeavor. But let's not forget refactoring:

*

*in a class, I will group methods that go together, while separating them by a blank line from the next group.

Since you have several related members, they are a candidate for a new class.

*

*if I need to write a comment I'll usually put a blank line before the comment

Whenever code is unclear enough to want a comment, I ask if I can refactor to make the code clear enough to not need the comment.

*

*in a method, I make one paragraph per step of the process

Why not make one method for each "paragraph"?
If you end up with a bunch of methods in your class, see my note above about extracting a new class.

A: Yes. It makes it easier to visually scan a file. Among other things, it makes it clearer which line a comment goes with.
Some code here
// Which line does this comment go with?
More code here

// It's pretty clear which line this comment goes with
More code here

Still more code here

A: I use blank lines sparingly and consistently, and consistently is more important than sparingly.  However:

*

*If every line of code is separated from the next by a blank line, there are too many blank lines.

*If there is neither rhyme nor reason readily discernible for where blank lines are placed, then they are a distraction and there are usually too many of them.

*If a function is so big that it needs many blank lines, it is too big.

*If a block of code needs more than one blank line before or after it, there is something seriously astray.

*If you have more than two blank lines between functions, you probably have too many blank lines.

Most of that is not dreadfully controversial; what follows might be.  I note that K&R notation with the open braces at the end of line is depressingly often followed by a blank line.  I personally dislike the braces at the end of the line and mixing that with a blank line after the brace makes a nonsense of the notation (IMNSHO).  Put the open brace on the next line, on its own, and you have a mostly blank line (and, IMNSHO, more readable code).  If you must use K&R brace at the end of the line, don't squander the vertical space saving with extraneous blank lines.
// I don't like this
if (something == anotherthing) {
    print ...
    update ...
}

// I much prefer this
if (something == anotherthing)
{
    print ...
    update ...
}

// I loathe this - not least for its inconsistent spacing
if (something == anotherthing) {

    print ...
    update ...
}

// I loathe this too, for its absurd waste of vertical space
if (something == anotherthing) {

    print ...
    update ...

}

A: Write that which is most legible and least surprising.
function validEmail($addr) {
    $regex = "/.../";
    return preg_match($regex, $addr);
}

This function doesn't need 12 lines of doc comments.
In fact, it doesn't need any comments.
Or blank lines.
They would detract from its essence.

A: Inside the function? Rarely
If I have a clear different block it is refactoring to a new function. If few cases don't worth it.
For me blanks lines inside the function is one of most wrong "best practices".

A: Yes for clarity.
Just like I did in this answer.

A: Often
Use it for logical blocks of code that are processed similarly.  Once you add a comment to show that you're doing a different step - it's time to Extract Method.
Good Whitespace
{
    int x = computeX();
    x += ADJUSTMENT_FACTOR_X;

    int y = computeY();
    y += ADJUSTMENT_FACTORY_Y;

    setPosition(x, y);
}

Bad Whitespace
{
    //Open a connection
    String serverAddress = lookupAddress();
    Connection connection = openConnection(serverAddress);
    connection.login(user, password);

    //Go get stuff from the server
    item1 = connection.get(1);
    item2 = connection.get(2);

    //Close connection
    connection.close();

    //log data
    log(item1);
    log(item2);

    //Update client
    gui.updateView(item1, item2);
}

vs
{
    Connection connection = openConnection();
    updateData(connection);
    closeConnection(connection);
    logUpdate();
    updateGui();
}

vs
{
     updateDataFromServer();
     logUpdate();
     updateGui();
}

A: Not only do i use whitespace, i use braces for clarity.
Braces i use to say these can potentially be functions.
code
{
    code
    code
    code
    code
}
{
    code
    code=code
    code
    code

    code()
    code()
}

A: At one time, I'd sprinkle blank lines liberally throughout my code.  Nowadays, I tend to be more sparing.  I think that this is part of what Steve Yegge was talking about here:

Hopefully the scene I've painted so
far helps you understand why sometimes
you look at code and you just hate it
immediately. If you're a n00b, you'll
look at experienced code and say it's
impenetrable, undisciplined crap
written by someone who never learned
the essentials of modern software
engineering. If you're a veteran,
you'll look at n00b code and say it's
over-commented, ornamental fluff that
an intern could have written in a
single night of heavy drinking.
The sticking point is
compression-tolerance. As you write
code through your career, especially
if it's code spanning very different
languages and problem domains, your
tolerance for code compression
increases. It's no different from the
progression from reading children's
books with giant text to increasingly
complex novels with smaller text and
bigger words.
...
A programmer with a high tolerance
for compression is actually hindered
by a screenful of storytelling. Why?
Because in order to understand a code
base you need to be able to pack as
much of it as possible into your head.
If it's a complicated algorithm, a
veteran programmer wants to see the
whole thing on the screen, which means
reducing the number of blank lines and
inline comments – especially comments
that simply reiterate what the code is
doing. This is exactly the opposite of
what a n00b programmer wants. n00bs
want to focus on one statement or
expression at a time, moving all the
code around it out of view so they can
concentrate, fer cryin' out loud.

I fundamentally agree with him.  It's much better to compress the code so you can get as much of it as possible on one screen than to space it out too much.  That's not to say that you should never use blank lines.  It's just that I think unless the grouping you're trying to create doesn't increase readability immensely, it does more harm than good.

A: A Professor Emeritus Gave Two Great Pieces of Advice

*

*Whitespace is Free

*Don't use the staples that poke back up through the front of the paper, or I'll fail you.

A: I do but I make sure I document it by putting
(This line intentionally left blank.)
on the line

A: Yes, but I don't abuse it.
I've seen code where every line of code inside a method is separated by a blank line, and two blank lines are used where a logical separation occurs. That just makes it even less readable in my opinion. I've also seen whitespace used to make crazy alignments, such as this:
//Prot.   Return type                    Name                 Arg1        Arg2
//=====   ============================== ==================== =========== ========

private   int                            AMethodWithALongName(string s,   object o)
{
    ...
}

private   IDictionary<MyLongObject, int> SomethingCrazy      (string s)
{
    ...
}

protected void                           Foo                 (string str, object o)
{
    ...
}

The same misuse of horizontal whitespace can be applied to vertical whitespace. Like any tool, use it wisely.

A: My rules of thumb are these:

*

*If I have trouble reading the code I wrote yesterday, I probably need to extract a method or three.

*If my class definition is too long to read easily, I probably need to extract a module/interface/object.

*Method definitions: add a line

*Module/Class definitions: add two lines

A: I like to think of whitespaces the same way as paragraphing. You group together lines that contribute to one idea.
If you're starting a new idea or a new facet of the same idea, you start a new paragraph -- like this.
In imperative code, I group together tasks that perform one cohesive task; in declarative code, I group together code that describes one cohesive statement of an idea.
You clearly have no trouble doing that in English (some people are horrible with paragraphing), so with a little practice, applying the same skill to code should be no stretch at all.

A: Blank lines are a must in my opinion. I use them to separate different logical blocks of code. Makes the code readable. Readable code is good code ;)
My ideal code piece would be each logical block being separated by a blank line and a comment on top of each block that has a major logic.
Of course, if people over do it by adding multiple blank lines everywhere, I find it very irritating :(

A: I only use whitespaces within a function/method to separate declarations and code.
If you feel the need to have some lines to separate sub-blocks of code implementing some logic, then they should be but in another function/private method. It's up to your compiler to not make that too big an overhead.
typically, in peusdo-code:
def function(arg1, argn, ...)
    INITIALIZERS

    CODE
    BLOCK_START
        INITIALIZERS

        CODE
    BLOCK_END
    CODE
end

If I see useless whitespace, I usually cringe.

A: White space is extremely valuable.
Here's the deal... nerds that write complicated code like E=MC2 are great at showing off thier programming skills.
Now let's jump ahead six months, and it's 2:00 AM in the morning and the system that hasn't been looked at in six months has broken on the very line of E=MC2. This is nearly impossible to debug... everyone is freaking out.
Suppose the code looked more like this...
See Dick
See Jane
See Dick and Jan

If it's 2:00 AM and the code is broken. A quick glance will show you that line three should have been
See Dick and Jane

Problem solved.
Bottom Line... use whitespace.

A: As many others have stated, blank lines make for easier reading of code. However, there are some languages that enforce this standard. One that I can think of off the top of my head (not so much about blank lines but proper indentation) is Python.

A: I agree, I use whitespace the same way. However, if I find myself using whitespace to break a method into too many parts, it's a sign I might need to refactor that code into multiple methods. Too many logical sections in a method might signal that the method will be harder to test.

A: I use them to seperate code into logical units. I've seen very few code samples that did not use blank lines, of course obfuscation is excepted.

A: The Psychopath answer is the best, but I would replace that with assuming that the next person is an idiot, and that they will assume that you are, and you will want to prove them wrong.
Just as important to readability is the use of comments. I open each function or subroutine with a comment block, explaining in clear text, what it is, what it does, what the arguments are, and what the expected outcomes are (including a list of error conditions). Then there is no question of what it is intended and/or designed to do. What it achieves may vary, but that is further down the track.
I think way too many coders either assume that it will be they, themselves that will be doing "repairs" on code, or simply don't care.

A: Blank lines are important. However, wasting a whole blank line on the opening brace reduces the amount of code you can see in a screenful. Should be:
for (int i; i < 10; ++i)
{  if (i % 3 == 0) continue;

   array[i] += 2;
}

(Don't get me started on putting the brace '{' on the same line as the 'for'... that's meshuggah).

A: Yes. For readability.
Sometimes I even put blank lines in code that I did not write.
I find it easier to understand code when they have logical grouping via blank lines - like u can "speed-read" through it.

A: We should use blank lines between codeblocks as we do when we are writting a letter.
For example, between functions, or inside a function when we finish a loop...
People will thank you a clean code if they have to do maintenance on it ;)

A: We use the whitespacing recommended by Microsoft StyleCop. Aside from readability and consistency I've found that (together with small class sizes) properly laid out code makes it much easier to manage merges when various people in a team happen to be working on the same areas.
I'm not sure if it's just my imagination but diffing tools seem to do a better job of recognising where equivalent code starts and finishes when merging when it's laid out neatly. Nicely laid out code is a joy to merge. Ok, that was a lie - but at least the pain is kept to manageable levels.

A: Never a blank line, not in the whole file. That is not to say there are not breaks in the code:
 code;
 //
 morecode;

Blank lines are for opening sections of the code to work on, you have a couple hotkeys in your editor to take you to the prev/next blank line.


text:
Q: Gitlab job not pulling Docker image Running a Gitlab project that uses a Docker image I created.
Problem: Gitlab job execution log shows that image is not being pulled.

Here is the .gitlab-ci.yml file, with the company stuff removed:
default:
  image:
    name: guythedocker/jmeter-mssql-windows:latest
    entrypoint: [""]

api test:
  stage: test
  script:
    - get-variable
    - $env:path -split ";"
    - echo $WORKDIR
    - Get-ChildItem  -Path / -File
    - entrypoint.ps1 --version
    - |
      /entrypoint.ps1 -n -t ./JMeter/xxx.jmx -l ./xxx.log -e -o ./testresults/xxx-Jthreads=$xx-Jrampup=$xxx -JtestCases=$xxx -Jhost=xxx.com -f

  retry: 2

  only:
    - schedules
  artifacts:
    paths:
      - testresults
  tags:
   - win2019

Here is the Dockerfile, which is essentially copied from QAInsights' Dockerfile:
# Dockerfile for Apache JMeter for Windows
# Indicates that the windowsservercore along with OpenJDK will be used as the base image.
# Based on work by NaveenKumar Namachivayam
FROM openjdk:8-windowsservercore

ARG JMETER_VERSION="5.4.3"
ENV JMETER_HOME /apache-jmeter-$JMETER_VERSION/apache-jmeter-$JMETER_VERSION/

# Metadata indicating an image maintainer.
LABEL maintainer="Guy L."

# Downloads JMeter from one of the mirrors, if you prefer to change, you can change the URL
RUN Invoke-WebRequest -URI https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-$env:JMETER_VERSION.zip \
-UseBasicParsing -Outfile /apache-jmeter-$env:JMETER_VERSION.zip

# Extract the downloaded zip file
RUN Expand-Archive /apache-jmeter-$env:JMETER_VERSION.zip -DestinationPath /apache-jmeter-$env:JMETER_VERSION

# For JDBC
RUN Invoke-WebRequest -URI https://repo1.maven.org/maven2/com/microsoft/sqlserver/mssql-jdbc/9.4.1.jre8/mssql-jdbc-9.4.1.jre8.jar -Outfile mssql-jdbc-9.4.1.jre8.jar
RUN Invoke-WebRequest -URI https://repo1.maven.org/maven2/com/microsoft/sqlserver/mssql-jdbc_auth/9.4.1.x86/mssql-jdbc_auth-9.4.1.x86.dll -Outfile mssql-jdbc_auth-9.4.1.x86.dll

COPY ./mssql-jdbc-9.4.1.jre8.jar ${JMETER_HOME}/lib/
COPY ./mssql-jdbc_auth-9.4.1.x86.dll ${JMETER_HOME}/lib/

# Copies the entrypoint.ps1
COPY /entrypoint.ps1 /entrypoint.ps1
COPY /jmeter-plugins-install.ps1 /jmeter-plugins-install.ps1

RUN ["powershell.exe","/jmeter-plugins-install.ps1"]
# Sets the Working directory
WORKDIR ${JMETER_HOME}/bin

# Sets a command or process that will run each time a container is run from the new image. For detailed instruction, go to entrypoint.ps1 file.
ENTRYPOINT ["powershell.exe", "/entrypoint.ps1"]

The image was successfully published.
So why is my Gitlab project not pulling this image?
It is a Windows runner (since I'm using the -tag, and as I can see in the Job history).

A: Your runner is configured to use shell executor (as you can see line 3 of your printscreen) but to run Docker image, you have to use docker or docker-windows executor (depending of if container you want to run is Linux or Windows based).


text:
Q: UITableView editing style may not show delete button Occasionally, when UITableView is in editing style and when you trigger the delete button, this button may not show. It seldom happen, but did anybody get the same issue too?
Post some code:
In viewDidLoad,
[[self tableView] setEditing:YES animated:YES];

table view delegate:
    - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
    return YES;
}

- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
{
    return YES;
}

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (editingStyle == UITableViewCellEditingStyleDelete)
    {
        //do sth.
    }
}


text:
Q: What is the ".." syntax inside a struct literal in Rust? From the std::default::Default docs:
#[derive(Default)]
struct SomeOptions {
    foo: i32,
    bar: f32,
}

fn main() {
    let options = SomeOptions { foo: 42, ..Default::default() };
}

What is the .. prefix doing to the returned value of Default::default() and why is it necessary here? It almost seems like it's acting as a spread operator, but I'm not sure. I understand what ..Default::default() is doing -- filling in the remaining struct parameters with the default values of SomeOptions, but not how .. works. What is the name of this operator?

A: This is the struct update syntax. It is "needed" only to have a succinct way of moving / copying all of the members of a struct to a new one, potentially with some small modifications.
The "long" way of writing this would be:
let a = SomeOptions::default();
let options = SomeOptions { foo: 42, bar: a.bar };

You could indeed think of it similar to the JavaScript "spread" operator, but Rust's nuances of ownership and strong typing still come into play, so it's not as widely used. For example, you can't use this syntax to go between values of different types.


text:
Q: Using jQuery method chaining to initialize TypeScript static property results in TS2448: Block-scoped variable used before its declaration I upgraded an existing project from TypeScript 2.1.6 to 2.2.1 tonight and started getting TS2448 errors that I'm having a tough time understanding.
Here's a minimal example:
// Environment Summary:  Visual Studio Code 1.9.1 with the following installed:
//
//    > npm list
//    test@0.0.1 C:\Users\abrown\src\test
//    +-- @types/jquery@2.0.40
//    +-- jquery@3.1.1
//    `-- typescript@2.2.1
//
namespace TestNamespace {
    export class TestClass {
        // Contrived, just to support showing a minimal example:
        private static getTemplate(): JQuery { return $(document); }

        // TypeScript error:
        // test.ts(7,53): error TS2448: Block-scoped variable 'find' used before its declaration.
        private static jq = TestClass.getTemplate().find("whatever");

        // But OK here:
        private static test() {
            var jq = TestClass.getTemplate().find("whatever");
        }
    }
}

I can't figure out what it is about the initialization of my static property that makes it illegal TypeScript.
Both TestClass.getTemplate() and JQuery.find() return a value of type JQuery.  If I strip the chained call to .find() from the line where I'm initializing jq, it compiles without error.  I can't see what it is about adding the chained call to .find() makes it illegal in the context of static property initialization.
Finally, I'll quickly note that with the jQuery type definitions in place, I get Intellisense/auto-completion on the call to .find() that causes the compiler error.


text:
Q: Output sound through speaker when not logged in I have a program written in Delphi XE that plays a WAV file using TMediaPlayer. The program runs in the system tray on a Windows 7 computer. The program waits for an event to trigger playing the wav file. If I am logged in on the computer itself, the wav plays fine. But if I lock the computer terminal (or log in through Remote Desktop), the wav file does not play through the computer speaker. I know the event is being triggered because all the other code in the event handler works just fine; it's just that you can't hear the wav file. I have hard-coded the volume to the maximum level so I know it's not a volume problem. Does Windows 7 have something that prevents sounds coming through the speaker if no one is currently logged in to the computer? If that limitation exists, is there a way around it?

A: As Brad suggests, use PlaySound() instead of TMediaPlayer. It works fine when the the machine is 'locked'. Not sure about it working over a remote desktop connection though.
To confirm this, I created a new app, put a TTimer on the form, set the Interval property to 20000 and put this code in the OnTimer event:
procedure TForm13.Timer1Timer(Sender: TObject);
begin
  PlaySound('c:\windows\media\tada.wav', 0, SND_ASYNC or SND_FILENAME);
end;

Then I ran it, locked the console (with Windows L), and waited 20 seconds. The sound played successfully.


text:
Q: Slow and smooth drawing lines python matplotlib I'm using matplotlib for drawing graphs such as smooth lines. it is not problem to draw for me, but I have problems with animations.
import numpy as np
import random as random
from matplotlib import pyplot as plt
from matplotlib import animation

So, i have array, such as:
a = [0,1,2,4,5,8,9,12,14,18,22,17,30,37,29,45]

And I need to draw it smooth point-to-point.
Now I have this strings:
for i in range(len(a)-1):
    desty = np.append(desty,np.linspace(a[i],a[i+1],n))
    destx = np.append(destx,np.linspace(i,i+1,n))

that allows me to draw lines without problems (and animations :))
the full code:
# First set up the figure, the axis, and the plot element we want to animate
fig = plt.figure()
ax = plt.axes(xlim=(0, 50), ylim=(0, 50))
line, = ax.plot([], [], lw=2)
global x
global y
global n
global a
n=5
a = [0,1,2,4,5,8,9,12,14,18,22,17,30,37,29,45]

global desty,destx
desty = np.linspace(0,0,n)
destx = np.linspace(0,0,n)
for i in range(len(a)-1):
    desty = np.append(desty,np.linspace(a[i],a[i+1],n))
    destx = np.append(destx,np.linspace(i,i+1,n))
# initialization function: plot the background of each frame
def init():
    line.set_data([], [])
    return line,
# animation function.  This is called sequentially
def animate(i):
    global destx
    global desty
    x=destx
    y=desty
    line.set_data(x, y)
    return line,

# call the animator.  blit=True means only re-draw the parts that have changed.
anim = animation.FuncAnimation(fig, animate, init_func=init,
                               frames=200, interval=20, blit=True)
plt.show()

Allows me to draw it only, but how can i draw it slow and smooth point to point?
I'm using python 2.7, centos 7.

A: You can slim your plotting routine down to:
import numpy as np
import random as random
from matplotlib import pyplot as plt
from matplotlib import animation
# First set up the figure, the axis, and the plot element we want to animate
fig = plt.figure()
ax = plt.axes(xlim=(0, 50), ylim=(0, 50))
line, = ax.plot([], [], lw=2)

n=5
a = [0,1,2,4,5,8,9,12,14,18,22,17,30,37,29,45]

x = []
y = []

# initialization function: plot the background of each frame
def init():
    line.set_data([], [])
    return line,

# animation function.  This is called sequentially
def animate(i):
    x.append(np.linspace(i,i+1,n))
    y.append(np.linspace(a[i],a[i+1],n))
    line.set_data(x,y)

    return line,

# call the animator.  blit=True means only re-draw the parts that have changed.
anim = animation.FuncAnimation(fig, animate, np.arange(0,len(a)-1) ,init_func=init,
                               interval=200, blit=True, repeat=False)

plt.show()

Things to note:

*

*You don't require global variables for this to work

*You don't want to set up x and y outside of the animation but inside for the plot to develop (in your case you had the complete x and y set up so that the animation would only plot the entire graph)

*You need to pass an interable to animate (the i); this is the third input to FuncAnimation - np.arange(0,len(a)-1).

*set repeat=False to stop after one run and to avoid 'closing' the curve

*I increased interval to make the plot develop slower

A: You need to use i in your animate function, otherwise it just plots the same thing over and over, which is what you see.
import numpy as np
import random as random
from matplotlib import pyplot as plt
from matplotlib import animation

# First set up the figure, the axis, and the plot element we want to animate
fig = plt.figure()
ax = plt.axes(xlim=(0, 50), ylim=(0, 50))
line, = ax.plot([], [], lw=2)
global x
global y
global n
global a
n=5
a = [0,1,2,4,5,8,9,12,14,18,22,17,30,37,29,45]

global desty,destx
desty = np.linspace(0,0,n)
destx = np.linspace(0,0,n)
plot_me_x = []
plot_me_y = []
for i in range(len(a)-1):
    desty = np.append(desty, np.linspace(a[i],a[i+1],n))
    destx = np.append(destx, np.linspace(i,i+1,n))
    plot_me_x.append(np.array(destx))   # keep a copy of the intermediaries to plot later
    plot_me_y.append(np.array(desty))
# initialization function: plot the background of each frame
def init():
    line.set_data([], [])
    return line,
# animation function.  This is called sequentially
def animate(i):
    global destx
    global desty
    x=plot_me_x[i]
    y=plot_me_y[i]
    line.set_data(x, y)
    return line,

# call the animator.  blit=True means only re-draw the parts that have changed.
anim = animation.FuncAnimation(fig, animate, init_func=init,
                               frames=len(a)-1, interval=20, blit=True)
plt.show()

For the plot to look different at each animation, i must index something that looks different at each iteration.  Although desty and destx are appended to gradually in the iteration that builds them, the final result is not this gradual build but a single thing, so you need to save the intermediaries of this build.  I did this with plot_me_x and y.
I wrote this answer with minimal changes to the OP's code to make it clear where the error was.  Overall, the changes that @Schorsch made lead to an overall cleaner approach (eg, with no globals).


text:
Q: python getattr and setattr with self.__dict__ I have been reading about overriding getattr and setattr and I can't figure out if I need the overriding assignments if I use self.__dict__ = self in the constructor.
Once I make an instance of the class
a = OPT(foo='bar')

a.foo and a['foo'] work with and without the __getattr__ and __setattr__ declaration.
Can someone explain if I need both. If I do, why?  Thanks!
class OPT(dict):
    __getattr__ = dict.__getitem__
    __setattr__ = dict.__setitem__

    def __init__(self, *args, **kwargs):
        super(OPT, self).__init__(*args, **kwargs)
        self.__dict__ = self

A: You override getattr and setattr when you want to do something extra when the class user gets or sets an attribute. For example:
1) you might avoid raising an exception when user manipulates an invalid attribute, so you just return None for an unknown attribute.
2) attribute manipulations are actually forwarded/delegated, so the valid attributes are not known in advance e.g. a class that represents a database row and the user manipulates columns as attributes. I need to run-time check if the given attribute name matches column name, and perhaps I'd like to forgive upper-case/lower-case differences etc.
Another thing, containment is sometimes preferred to subclassing. Instead of inheriting from a dict, you could create a class that contains a dict.

A: Try this:
class DotDict(dict):
    def __init__(self, d: dict = {}):
        super().__init__()
        for key, value in d.items():
            self[key] = DotDict(value) if type(value) is dict else value

    def __getattr__(self, key):
        if key in self:
            return self[key]
        raise AttributeError(key) #Set proper exception, not KeyError

    __setattr__ = dict.__setitem__
    __delattr__ = dict.__delitem__

A: Here's a more elaborate fork of the Marquinho Peli's answer. Changes: support for dictionaries with nested lists;
class DotDict(dict):
    """A dictionary that's recursively navigable with dots, not brackets."""

    def __init__(self, data: dict = None):
        super().__init__()
        if data is None or not isinstance(data, dict):
            raise AttributeError(f"{type(self).__name__} must be instantiated with a dictionary, not a {type(data).__name__}.")
        for key, value in data.items():
            if isinstance(value, list):
                self[key] = [DotDict(item) for item in value]
            elif isinstance(value, dict):
                self[key] = DotDict(value)
            else:
                self[key] = value

    __setattr__ = dict.__setitem__
    __delattr__ = dict.__delitem__

    def __getattr__(self, key):
        try:
            return self[key]
        except KeyError:
            raise AttributeError(f"attribute .{key} not found")

Usage examples:
d = {'key1': 'value1',
     'key2': 'value2',
     'key3': {'key3a': 'value3a'},
     'key4': {'key4a': [{'key4aa': 'value4aa',
                         'key4ab': 'value4ab',
                         'key4ac': 'value4ac'}],
              'key4b': 'value4b'}}

dd = DotDict(d)
print(dd.key4.key4a[0].key4aa)  # value4aa
dd.key4.key4a[0].key4aa = 'newval'
print(dd.key4.key4a[0].key4aa)  # newval

print(dd.key4.key4a[0].key4aaa) # AttributeError: attribute .key4aaa not found

DotDict({}) # OK
DotDict()   # AttributeError: DotDict must be instantiated with dictionary, not a NoneType.


text:
Q: Unable to install tensorflow on Win10 - ImportError: DLL load failed Trying to run import tensorflow as tf but it failed.
I just installed tensorflow but is not allowing to import it.
This is the error
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
~\AppData\Local\Continuum\anaconda\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in <module>()
     57
---> 58   from tensorflow.python.pywrap_tensorflow_internal import *
     59   from tensorflow.python.pywrap_tensorflow_internal import __version__

~\AppData\Local\Continuum\anaconda\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py in <module>()
     27             return _mod
---> 28     _pywrap_tensorflow_internal = swig_import_helper()
     29     del swig_import_helper

~\AppData\Local\Continuum\anaconda\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py in swig_import_helper()
     23             try:
---> 24                 _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
     25             finally:

~\AppData\Local\Continuum\anaconda\lib\imp.py in load_module(name, file, filename, details)
    242         else:
--> 243             return load_dynamic(name, filename, file)
    244     elif type_ == PKG_DIRECTORY:

~\AppData\Local\Continuum\anaconda\lib\imp.py in load_dynamic(name, path, file)
    342             name=name, loader=loader, origin=path)
--> 343         return _load(spec)
    344

ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)
<ipython-input-17-64156d691fe5> in <module>()
----> 1 import tensorflow as tf

~\AppData\Local\Continuum\anaconda\lib\site-packages\tensorflow\__init__.py in <module>()
     22
     23 # pylint: disable=g-bad-import-order
---> 24 from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
     25
     26 from tensorflow._api.v1 import app

~\AppData\Local\Continuum\anaconda\lib\site-packages\tensorflow\python\__init__.py in <module>()
     47 import numpy as np
     48
---> 49 from tensorflow.python import pywrap_tensorflow
     50
     51 # Protocol buffers

~\AppData\Local\Continuum\anaconda\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in <module>()
     72 for some common reasons and solutions.  Include the entire stack trace
     73 above this error message when asking for help.""" % traceback.format_exc()
---> 74   raise ImportError(msg)
     75
     76 # pylint: enable=wildcard-import,g-import-not-at-top,unused-import,line-too-long

ImportError: Traceback (most recent call last):
  File "C:\Users\AMartinez147\AppData\Local\Continuum\anaconda\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\AMartinez147\AppData\Local\Continuum\anaconda\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\AMartinez147\AppData\Local\Continuum\anaconda\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "C:\Users\AMartinez147\AppData\Local\Continuum\anaconda\lib\imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
  File "C:\Users\AMartinez147\AppData\Local\Continuum\anaconda\lib\imp.py", line 343, in load_dynamic
    return _load(spec)
ImportError: DLL load failed: The specified module could not be found.

Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/errors

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.

this is the pip list
Package                            Version
---------------------------------- ----------
absl-py                            0.7.1
alabaster                          0.7.11
altair                             2.2.2
anaconda-client                    1.7.2
anaconda-navigator                 1.9.6
anaconda-project                   0.8.2
aniso8601                          5.1.0
appdirs                            1.4.3
asn1crypto                         0.24.0
astor                              0.7.1
astroid                            2.0.4
astropy                            3.0.4
atomicwrites                       1.2.1
attrs                              18.2.0
Automat                            0.7.0
Babel                              2.6.0
backcall                           0.1.0
backports.shutil-get-terminal-size 1.0.0
beautifulsoup4                     4.6.3
bitarray                           0.8.3
bkcharts                           0.2
blaze                              0.11.3
bleach                             2.1.4
bokeh                              0.13.0
boto                               2.49.0
Bottleneck                         1.2.1
branca                             0.3.0
category-encoders                  1.3.0
certifi                            2018.11.29
cffi                               1.11.5
chardet                            3.0.4
click                              6.7
cloudpickle                        0.5.5
clyent                             1.2.2
colorama                           0.3.9
colorlover                         0.3.0
comtypes                           1.1.7
conda                              4.6.7
conda-build                        3.15.1
constantly                         15.1.0
contextlib2                        0.5.5
cryptography                       2.4.2
cufflinks                          0.14.6
cycler                             0.10.0
Cython                             0.28.5
cytoolz                            0.9.0.1
dash                               0.29.0
dash-core-components               0.37.1
dash-html-components               0.13.2
dash-renderer                      0.14.3
dask                               0.19.1
datashape                          0.5.4
decorator                          4.3.0
defusedxml                         0.5.0
distributed                        1.23.1
docopt                             0.6.2
docutils                           0.14
entrypoints                        0.2.3
et-xmlfile                         1.0.1
fastcache                          1.0.2
filelock                           3.0.8
Flask                              1.0.2
Flask-Compress                     1.4.0
Flask-Cors                         3.0.6
flask-restplus                     0.12.1
folium                             0.6.0
gast                               0.2.2
geographiclib                      1.49
geopy                              1.17.0
gevent                             1.3.6
glob2                              0.6
greenlet                           0.4.15
grpcio                             1.20.1
h5py                               2.8.0
heapdict                           1.0.0
html5lib                           1.0.1
hyperlink                          18.0.0
idna                               2.7
imageio                            2.4.1
imagesize                          1.1.0
imbalanced-learn                   0.4.3
incremental                        17.5.0
ipykernel                          4.10.0
ipython                            6.5.0
ipython-genutils                   0.2.0
ipywidgets                         7.4.1
isort                              4.3.4
itsdangerous                       0.24
jdcal                              1.4
jedi                               0.12.1
Jinja2                             2.10
jsonschema                         2.6.0
jupyter                            1.0.0
jupyter-client                     5.2.3
jupyter-console                    5.2.0
jupyter-core                       4.4.0
jupyterlab                         0.34.9
jupyterlab-launcher                0.13.1
jupyterthemes                      0.20.0
Keras-Applications                 1.0.7
Keras-Preprocessing                1.0.9
keyring                            13.2.1
kiwisolver                         1.0.1
lazy-object-proxy                  1.3.1
lesscpy                            0.13.0
llvmlite                           0.24.0
locket                             0.2.0
lxml                               4.2.5
Markdown                           3.1
MarkupSafe                         1.0
matplotlib                         2.2.3
mccabe                             0.6.1
memory-profiler                    0.55.0
menuinst                           1.4.14
mistune                            0.8.3
mkl-fft                            1.0.10
mkl-random                         1.0.2
mock                               2.0.0
more-itertools                     4.3.0
mpmath                             1.0.0
msgpack                            0.5.6
multipledispatch                   0.6.0
navigator-updater                  0.2.1
nbconvert                          5.4.0
nbformat                           4.4.0
networkx                           2.1
nltk                               3.3
nose                               1.3.7
notebook                           5.6.0
num2words                          0.5.9
numba                              0.39.0
numexpr                            2.6.8
numpy                              1.15.4
numpydoc                           0.8.0
odo                                0.5.1
olefile                            0.46
openpyxl                           2.5.6
packaging                          17.1
pandas                             0.23.4
pandocfilters                      1.4.2
parso                              0.3.1
partd                              0.3.8
path.py                            11.1.0
pathlib2                           2.3.2
patsy                              0.5.0
pbr                                5.2.0
pep8                               1.7.1
pickleshare                        0.7.4
Pillow                             5.2.0
pip                                19.1
pkginfo                            1.4.2
plotly                             3.3.0
pluggy                             0.7.1
ply                                3.11
prometheus-client                  0.3.1
prompt-toolkit                     1.0.15
protobuf                           3.7.1
psutil                             5.4.7
py                                 1.6.0
pyasn1                             0.4.4
pyasn1-modules                     0.2.2
pycodestyle                        2.4.0
pycosat                            0.6.3
pycparser                          2.18
pycrypto                           2.6.1
pycurl                             7.43.0.2
pyflakes                           2.0.0
Pygments                           2.2.0
pylint                             2.1.1
pyodbc                             4.0.24
pyOpenSSL                          18.0.0
pyparsing                          2.2.0
PySocks                            1.6.8
pytest                             3.8.0
pytest-arraydiff                   0.2
pytest-astropy                     0.4.0
pytest-doctestplus                 0.1.3
pytest-openfiles                   0.3.0
pytest-remotedata                  0.3.0
python-dateutil                    2.7.3
pytz                               2018.5
PyWavelets                         1.0.0
pywin32                            223
pywinpty                           0.5.4
PyYAML                             3.13
pyzmq                              17.1.2
QtAwesome                          0.4.4
qtconsole                          4.4.1
QtPy                               1.5.0
relativetimebuilder                0.2.0
requests                           2.19.1
retrying                           1.3.3
rope                               0.11.0
ruamel-yaml                        0.15.46
scikit-image                       0.14.0
scikit-learn                       0.20.3
scipy                              1.1.0
seaborn                            0.9.0
Send2Trash                         1.5.0
service-identity                   17.0.0
setuptools                         40.2.0
simplegeneric                      0.8.1
singledispatch                     3.4.0.3
six                                1.11.0
snowballstemmer                    1.2.1
sortedcollections                  1.0.1
sortedcontainers                   2.0.5
Sphinx                             1.7.9
sphinxcontrib-websupport           1.1.0
spyder                             3.3.1
spyder-kernels                     0.2.6
SQLAlchemy                         1.2.11
statsmodels                        0.9.0
sympy                              1.1.1
tables                             3.4.4
tblib                              1.3.2
tensorboard                        1.13.1
tensorflow                         1.13.1
tensorflow-estimator               1.13.0
tensorflow-gpu                     1.13.1
termcolor                          1.1.0
terminado                          0.8.1
testpath                           0.3.1
textdistance                       4.1.2
toolz                              0.9.0
tornado                            5.1
tqdm                               4.26.0
traitlets                          4.3.2
Twisted                            18.7.0
unicodecsv                         0.14.1
urllib3                            1.23
vincent                            0.4.4
wcwidth                            0.1.7
webencodings                       0.5.1
Werkzeug                           0.14.1
wheel                              0.31.1
widgetsnbextension                 3.4.1
win-inet-pton                      1.0.1
win-unicode-console                0.5
wincertstore                       0.2
wrapt                              1.10.11
xgboost                            0.82
xlrd                               1.1.0
XlsxWriter                         1.1.0
xlwings                            0.11.8
xlwt                               1.3.0
zict                               0.1.3
zope.interface                     4.5.0

A: You can use the diagnosis steps that suggested on this post:
https://github.com/tensorflow/tensorflow/issues/11065
The easiest way could be as below:

After searching a lot and trying to install and reinstall Python, i found the solution was very simple
   use the following for windows
   python -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.0-py3-none-any.whl

You should update the url from this link based on your OS and python version:
https://www.tensorflow.org/install/pip#package-location


text:
Q: Help needed for DIA SDK & DbgEng Are DIA SDK & DbgEng (Not the DbgHelp) both COM based API and based on DbgHelp?
If so, how can I call DbgEng API from a C# application. I can import the DIA library to C# project using idl file  (tlibimp for generated tlib file), but DbgEng doesn't have any IDL file.
I have seen an incomplete wrapper for DbgEng
 which manually wraps the API using Managed C++, but that misses many of the functions.
 Can I import DbgEng.DLL in C# automatically without writing any managed wrapper?
Secondly, does DIA SDK allows a process to be attached and memory to be investigated (and possibly evaluate an expression), like DbgEng or it is just to get the symbols from the pdb file? So far only example I got is Dia2dump which only parses the pdb file.

A: *

*DIA SDK is only for symbols not debugging it is totality unrelated to DbgHelp.dll

*DbgEng.dll have some COM API but only intrfaces you still need to-do some pinvoking to get those interfaces, its better in your case to wrap what you need with Managed C++ or expose it thru COM using C++.

A: It is the other way round -- dbghelp is based on DIA.


text:
Q: Two nodejs applications, one mongodb database Good day! I have created an application using nodejs + mongoose and now I want to make something like a superuser application. I need my admin panel application to connect to the same database. So, i have a question.
Should i store the same Schema file in both applications to have an ability to use my Schema methods? In other words, what is the best way to create one more API using the same db?
Thank you!

A: If I'm not mistaken, why not create another service that only interacts with the database? That way, the systems will refer to the same schema/DB regardless of which application you want to connect to it. So the superuser application and the normal application will just query the DB microservice that interacts the database.
Pro: source of truth for the schema for all applications and the DB queries will just be API calls
Con: additional overhead in creating your ecosystem

A: If you are using the same DB from two different applications, you will want to make sure those schemas are the same between the two. If one changes its inputs, the other might need to change its display (or risk not expecting all that information). Keep all this in mind during your release process.
I would suggest making the schemas an external library to both, or have the admin panel require the current app. You'll avoid getting two sets out of sync and know to look at one place for the schema definitions.


text:
Q: Why the same css path is working for asp pages but not for content pages I have a folder in my web application where aspx page and content page both are there and master page is in root location. I am using the css path which is loading fine in firefox console for aspx page but the same path is not loading for content pages checked in firefox console. Due to that some of the boostrap functionality not working.
Below is the css path for aspx page
<link href="MySheet.css" rel="stylesheet" type="text/css" />

and same path is used for content page
<link href="MySheet.css" rel="stylesheet" type="text/css" />

Need help in this.

A: The browser resolves the href url in a relative manner. If it's located in the root, you can place "/" in the beginning of the path, like this:
<link href="/MySheet.css" rel="stylesheet" type="text/css" />

this will instruct the browser look for the stylesheet in the root, regardless of the current page's relative path. But if you use a server-side technology, like ASP.NET, there's another way of specifying the application's root - "~/", in this case, though in this case you'd have to add runat="server" to the tag, so it would look like this:
<link href="~/MySheet.css" rel="stylesheet" type="text/css" runat="server" />


text:
Q: Facebook Integration in Windows 8.1 Universal App I have a Windows Phone 8.1 app already registered with store. Now I have converted the phone app to an universal app but when trying to integrate Facebook for the windows 8.1 app it returns an error

Given URL is not allowed by the Application configuration: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.

In Facebook developer site I have created an app with Windows Platform and store id as callback Uri of phone app. How can the same Facebook app be associated with Windows 8.1 app?

A: I don't think you can get the same experience when developing windows stoe app as you implement facebook integration in windows phone app.
We need to follow the steps(using WebAuthenticationBroker) mentioned here for windows store app. And you may found how different the facebook login is for windows store app and windows phone app from this article.


text:
Q: Paginating requests to an API I'm consuming (via urllib/urllib2) an API that returns XML results. The API always returns the total_hit_count for my query, but only allows me to retrieve results in batches of, say, 100 or 1000. The API stipulates I need to specify a start_pos and end_pos for offsetting this, in order to walk through the results.
Say the urllib request looks like http://someservice?query='test'&start_pos=X&end_pos=Y.
If I send an initial 'taster' query with lowest data transfer such as http://someservice?query='test'&start_pos=1&end_pos=1 in order to get back a result of, for conjecture, total_hits = 1234, I'd like to work out an approach to most cleanly request those 1234 results in batches of, again say, 100 or 1000 or...
This is what I came up with so far, and it seems to work, but I'd like to know if you would have done things differently or if I could improve upon this:
hits_per_page=100 # or 1000 or 200 or whatever, adjustable
total_hits = 1234 # retreived with BSoup from 'taster query'
base_url = "http://someservice?query='test'"
startdoc_positions = [n for n in range(1, total_hits, hits_per_page)]
enddoc_positions = [startdoc_position + hits_per_page - 1 for startdoc_position in startdoc_positions]
for start, end in zip(startdoc_positions, enddoc_positions):
    if end > total_hits:
        end = total_hits
    print "url to request is:\n ",
    print "%s&start_pos=%s&end_pos=%s" % (base_url, start, end)

p.s. I'm a long time consumer of StackOverflow, especially the Python questions, but this is my first question posted. You guys are just brilliant.

A: I'd suggest using
positions = ((n, n + hits_per_page - 1) for n in xrange(1, total_hits, hits_per_page))
for start, end in positions:

and then not worry about whether end exceeds hits_per_page unless the API you're using really cares whether you request something out of range; most will handle this case gracefully.
P.S. Check out httplib2 as a replacement for the urllib/urllib2 combo.

A: It might be interesting to use some kind of generator for this scenario to iterate over the list.
def getitems(base_url, per_page=100):
    content = ...urllib...
    total_hits = get_total_hits(content)
    sofar = 0
    while sofar < total_hits:
        items_from_next_query = ...urllib...
        for item in items_from_next_query:
            sofar += 1
            yield item

Mostly just pseudo code, but it could prove quite useful if you need to do this many times by simplifying the logic it takes to get the items as it only returns a list which is quite natural in python.
Save you quite a bit of duplicate code also.


text:
Q: Speed up -drawRect: method for UIView subclass I've created a custom UIView subclass. Everything works fine on the simulator, but very slow on the device. My -drawRect: method takes about 100 milliseconds to fully redraw the view.
The speed problem arose when I added a pan gesture to this view and, while dragging, the view needed to be redrawn multiple times per second.
I need to optimize the drawRect: method. Here's my current -drawRect: method code:
- (void)loayoutSubviews
{
    for (UIView* subview in self.subviews)
    {
        [subview removeFromSuperview];
    };

    // ...
    // some calculations here... assume that they can not be optimized
    // ...

    for (unsigned int blockCounter=0; blockCounter<blockQuantity; blockCounter++)
    {
        NSNumber *y=[blockTops objectAtIndex:blockCounter];
        NSNumber *height=[blockHeights objectAtIndex:blockCounter];

        if ([height intValue]>2)
        {
            if ([y doubleValue]>self.frame.size.height/2.0)
            {
                double angle= [[self angleValueForBlockHeight:height] doubleValue];

                UIView *bView=[NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:[blocks objectAtIndex:blockCounter]]];
                [bView setFrame:CGRectMake(0.0, [y doubleValue], self.frame.size.width, blockSize.height)];
                [bView.layer setMasksToBounds:YES];

                double oldHeight=bView.frame.size.height;

                [bView.layer setAnchorPoint:CGPointMake(0.5, 1.0)];
                [bView setFrame:CGRectMake(bView.frame.origin.x, bView.frame.origin.y+bView.frame.size.height/2.0, bView.frame.size.width, bView.frame.size.height)];

                if ([height doubleValue]!=blockSize.height)
                {
                    //preparing transform
                    CATransform3D basicTrans = CATransform3DIdentity;
                    basicTrans.m34 =1.0/-projection;

                    double rangle;
                    rangle=angle/360*(2.0*M_PI);

                    bView.layer.transform = CATransform3DRotate(basicTrans, rangle, 1.0f, 0.0f, 0.0f);

                };

                double newHeight=bView.frame.size.height;

                [bView setCenter:CGPointMake(bView.center.x, bView.center.y-(oldHeight-newHeight))];

                //adding subview
                [self addSubview:bView];
            }
            else
            {
                double angle= [[self angleValueForBlockHeight:height] doubleValue];

                UIView *bView=[NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:[blocks objectAtIndex:blockCounter]]];
                [bView setFrame:CGRectMake(0.0, [y doubleValue], self.frame.size.width, blockSize.height)];
                [bView.layer setMasksToBounds:YES];

                [bView.layer setAnchorPoint:CGPointMake(0.5, 0.0)];
                [bView setFrame:CGRectMake(bView.frame.origin.x, bView.frame.origin.y-bView.frame.size.height/2.0, bView.frame.size.width, bView.frame.size.height)];

                if ([height doubleValue]!=blockSize.height)
                {
                    //preparing transform
                    CATransform3D basicTrans = CATransform3DIdentity;
                    basicTrans.m34 =1.0/-projection;

                    double rangle;
                    rangle=(360.0-angle)/360*(2.0*M_PI);

                    bView.layer.transform = CATransform3DRotate(basicTrans, rangle, 1.0f, 0.0f, 0.0f);

                };

                //adding subview
                [self addSubview:bView];
            };
        }
        else
        {
            //do not need to draw blocks with very low height
        };
    };
}

and here's the pan gesture recognizer code:
-(void)handlePanGesture:(UIPanGestureRecognizer *)sender
{
    double translatedY = [sender translationInView:self].y;
    double delta;

    if (fabs(translatedY)<fabs(oldTranslatedY))
    {
        [sender setTranslation:CGPointZero inView:self];
        oldTranslatedY=0.0;
        delta=0.0;
    }
    else
    {
        delta=translatedY-oldTranslatedY;
        oldTranslatedY=translatedY;
    };

    double pOffset=delta/((blockQuantity*blockSize.height)-self.frame.size.height);

    self.scrollPosition=self.scrollPosition-pOffset;

    if (self.scrollPosition<0.0)
    {
        self.scrollPosition=0.0;
    }
    else if(self.scrollPosition>1.0)
    {
        self.scrollPosition=1.0;
    };

    [self setNeedsLayout];
}

Please feel free to ask me any questions.
UPDATED: moved code from drawRect: method to layoutSubviews

A: You can use Instruments to check which method takes most time, but I think it is unarchiving and creating of UIView. Why do you need it? Why not to hold UIView's in memory, if you need them each time.


text:
Q: Swift: Parsing data using .performSegue(withIdentifier: _, sender: self) Screenshot of ViewStudents and EditStudent
Hi, I'm trying to perform a segue from 'ViewStudents' to 'EditStudent' and wish to parse the id of the student to be edited.
As can be seen in the image I'm creating a new instance of 'EditStudent' and parsing the id. I think the issue I'm having is that I'm performing a segue to a different instance of 'EditStudent'.
Some tutorials say to use 'destination.performSegue(withIdentifier: "EditStudentSegue", sender: self)', but this returns an error notifying that the destination (e.g. EditStudent) has no segue member named "EditStudentSegue" which being that the segue is owned by 'ViewStudents'
If anyone can confirm this and help me navigate to the correct instance it would be much appreciated.

A: Screenshot of ViewStudents and EditStudent
Found the solution, just had to separate the preparatory statements in buttonTap(_:) for parsing data into the overriding prepare(for:sender:) function


text:
Q: java1.6, MyEclipse 7.1.1 Project title: "A Cross-Layer Approach-Based Gnutella for Collaborative Virtual Environments over Mobile Ad Hoc Networks".
I got following error while executing the project:
java.net.SocketException: IP_ADD_MEMBERSHIP failed (out of hardware filters?)
    at java.net.PlainDatagramSocketImpl.join(Native Method)
    at java.net.PlainDatagramSocketImpl.join(Unknown Source)
    at java.net.MulticastSocket.joinGroup(Unknown Source)
    at com.multicast.MulticastRx.run(MulticastRx.java:103)
java.net.SocketException: IP_ADD_MEMBERSHIP failed (out of hardware filters?)
    at java.net.PlainDatagramSocketImpl.join(Native Method)
    at java.net.PlainDatagramSocketImpl.join(Unknown Source)
    at java.net.MulticastSocket.joinGroup(Unknown Source)
    at com.multicast.MulticastTx.run(MulticastTx.java:31)

A: Take a look at Error on MulticastSocket.joinGroup(). They seem to be getting the same error as yours.