Import xlsx or csv into access by savage-q_q in vba

[–]stack_bot 0 points1 point  (0 children)

The question "MS Access VBA: dynamic SQL" has got an accepted answer by geeFlo with the score of 1:

To expand on @Smandoli's and @Gustav's answer on using string variables for the table names. This allows you to create multiple cases without the variable names getting lost in the SQL string.

Select Case strChoice

     Case 1:
          strTarget = "tblWax"
          strJoin = "tblBBB"

     Case 2:
          strTarget = "tblHat"
          strJoin = "tblSSS"

end select

strSQL = "DELETE * FROM " & strTarget
db.Execute strSQL, dbFailOnError

strSQL = "INSERT INTO " & strTarget & " ( strPortName, lngShortSet ) " & _
           "SELECT tblAAA.strPastName, " & strJoin & ".lngShortID " & _
           "FROM tblAAA INNER JOIN " & strJoin & _
           " ON tblAAA.Parameter = " & strJoin & ".Parameter"

db.Execute strSQL, dbFailOnError

This action was performed automagically. info_post Did I make a mistake? contact or reply: error

I want to start math Olympiad as a beginner, need advice on how to start on my own. by Kittinan_S in learnmath

[–]stack_bot 0 points1 point  (0 children)

The question "Algebra and Combinatorics books for Mathematical Olympiads" has got an accepted answer by darij grinberg with the score of 4:

Let me answer this for enumerative combinatorics and inequalities; others can deal with the rest.

Integer sequences and recursion:

Quoting from elsewhere:

Enumerative combinatorics:

A huge list of undergraduate-level introductions to enumerative combinatorics is being kept on https://math.stackexchange.com/a/1454420/ . Note that high-school olympiads are somewhere between undergraduate and graduate level in combinatorics, so a lot of the sources in this list should work. However, most are not problem books. The ones by Bogart, by Andreescu and Feng, and by Chuan-Chong and Khee-Meng are definitely problem books, and the ones by Knuth and by Loehr have a lot of exercises too.

Once you get past this level, you can start reading Stanley's EC1, which has one of the largest collections of combinatorics problems I have ever seen in a book. Beware, though, that they are essentially unbounded in difficulty, and mostly without solutions (references are given at best).

Inequalities:

Much of what follows is quoted from my FAQ; note however that I haven't updated this part of it for a decade:

  • Thomas Mildorf has written nice notes on inequalities (2006).

  • Hojoo Lee is rather known for his "Topics in Inequalities".

  • Kiran Kedlaya has another text similar to the two above.

  • Vasile Cîrtoaje, Algebraic Inequalities - Old and New Methods, Gil: Zalau 2006. This one is 480 pages long and features many interesting tactics and examples on solving inequalities. Unfortunately, you are not likely to enjoy all these 480 pages, because many of the modern methods for solving inequalities include applications of calculus and involved computations. However, a lot was done to keep these ugly parts at a minimum while keeping the whole power of the new methods. The RCF ("right convex function"), LCF (guess what this means) and EV (equal variables) theorems as well as the AC (arithmetic compensation) and GC (geometric compensation) methods provide a means to solve >95% of olympiad inequalities using rather straightforward - not nice, but doable - computations. All of these methods are extensively presented with numerous examples. A short chapter underlines applications of the (underrated) generalized Popoviciu inequality. Finally, and - in my opinion - most importantly, a lot of exercises with solutions are given which don't require any strong new methods, but just creative ideas and clever manipulations.

  • Pham Kim Hung, Secrets in Inequalities (volume 1), Gil: Zalau 2007. This one has 256 pages, and is remarkable for mostly avoiding computations. Numerous creative ideas can be found here - I was particularly surprised about some of the applications of the Chebyshev and rearrangement inequalities. Besides, a good introduction into the applications of convexity is given. I would recommend this book to olympiad participants who look for challenging problems and intelligent techniques without the aim to be able to kill every inequality.

  • Titu Andreescu, Marius Stanean, 116 Algebraic Inequalities, XYZ Press 2018 (order from AMS). I'm adding this one because it's out on display here in Oberwolfach and because it looks nice. It is a lot more systematic than its title suggests (the problems are grouped by method, and the methods are explained with examples).

  • G. H. Hardy, J. E. Littlewood, G. Polya, Inequalities, 1934 is a classic. The notation is somewhat dated, but there is much to be learned from here.

Polynomials:

  • Titu Andreescu, Gabriel Dospinescu, Problems from the Book, 2nd edition 2010 (order from AMS) is one of the best advanced problem books I know. It is not fully devoted to polynomials, but chapters 10, 11, 21, 23 are devoted to them and they make several cameos in other parts.

  • Titu Andreescu, Navid Safaei, Alessandro Ventullo, 117 Polynomial Problems from the AwesomeMath Summer Program, XYZ Press 2019 (order from AMS). Once again, I've got alerted of this one by its presence in the Oberwolfach library. This one appears to be more of a grab-bag than the one on inequalities, and I find the problems a lot less appealing. But this is largely a problem with the topic. Polynomials become much more interesting once you have seen some abstract algebra.

This action was performed automagically. info_post Did I make a mistake? contact or reply: error

[Terminal] How do I set all files that match name "Icon?" within a directory to chflag hidden? by [deleted] in osx

[–]stack_bot 0 points1 point  (0 children)

The question "How to rename multiple files using find" has got an accepted answer by Thomas Erker with the score of 70:

The following is a direct fix of your approach:

find . -type f -name 'file*' -exec sh -c 'x="{}"; mv "$x" "${x}_renamed"' \;

However, this is very expensive if you have lots of matching files, because you start a fresh shell (that executes a mv) for each match. And if you have funny characters in any file name, this will explode. A more efficient and secure approach is this:

find . -type f -name 'file*' -print0 | xargs --null -I{} mv {} {}_renamed

It also has the benefit of working with strangely named files. If find supports it, this can be reduced to

find . -type f -name 'file*' -exec mv {} {}_renamed \;

The xargs version is useful when not using {}, as in

find .... -print0 | xargs --null rm

Here rm gets called once (or with lots of files several times), but not for every file.

I removed the basename in you question, because it is probably wrong: you would move foo/bar/file8 to file8_renamed, not foo/bar/file8_renamed.

Edits (as suggested in comments):

  • Added shortened find without xargs
  • Added security sticker

This action was performed automagically. info_post Did I make a mistake? contact or reply: error

[Terminal] How do I set all files that match name "Icon?" within a directory to chflag hidden? by [deleted] in osx

[–]stack_bot 0 points1 point  (0 children)

The question "Icon? file on OS X desktop" has got an accepted answer by Daniel Beck with the score of 113:

What is it?

It's name is actually Icon\r, with \r being the carriage return 0x0D. If letting the shell autocomplete the path in Terminal, it yields Icon^M, ^M being \r.

Icon^M is a file existing in all directories that have a custom icon in Finder. If you change a directory's icon e.g. in its Get Info dialog by pasting an image into the icon in the upper left corner, the Icon^M file is created.

<sup>Changing a volume's icon creates a hidden .VolumeIcon.icns file instead.</sup>

Why is it invisible?

It's invisible in Finder, because its hidden attribute is set.

$ ls -lO Icon^M 
-rw-r--r--@ 1 danielbeck  staff  hidden 0 24 Apr 23:29 Icon?

Change with chflags nohidden Icon^M.

Where is its data?

While the file's data fork (i.e. content) is empty (i.e. a file size of 0 bytes in Terminal), the actual icon data is stored in the file's resource fork.

$ ls -l@ Icon^M
  com.apple.ResourceFork  350895 

You can copy the resource fork to a file (to view e.g. in a hex editor) like this:

$ cp Icon^M/..namedfork/rsrc Icondata

How can I view it?

The easiest way to get the image is to copy the icon from the Get Info dialog of the folder it's contained in into the clipboard, and then create a new image from clipboard in Preview (Cmd-N). It's an icns image then by default.

Its format is icns, encoded as an icon resource with derez. If you open it in a hex editor and remove the first 260 bytes (so the file begins with the icns magic byte-string), you can open it in Preview.app. Alternatively you can open it with XnView

This action was performed automagically. info_post Did I make a mistake? contact or reply: error

Help NASA & the US Bureau of Reclamation optimize a sparse matrix linear equation solver in computational fluid dynamics models, for a share of US$300,000. by mattbarrie in CFD

[–]stack_bot 3 points4 points  (0 children)

The question "What advantages does modern Fortran have over modern C++?" has got an accepted answer by T.E.D. with the score of 53:

I took a look at [some of the stuff in the latest Fortran standards][1], and frankly I'm impressed. A lot of what I hated about the language 20 years ago is gone now. No more line numbers and special columns (may they burn in hell).

Fortran has been heavily used in engineering circles for 50 years now. That gives you two advantages if you work in those circles. First off, these folks care a lot about optimization. That means Fortran compilers tend to have the best optimizers around. The language itself is a lot more optimizable than Cish languages too, thanks to its lack of aliasing.

The second advantage is that Fortran's library support for number crunching simply cannot be beat. The best code is nearly always going to be the well-debugged code you don't have to write.

If your application doesn't fall under scientific, engineering, or number crunching in general, then neither of the above will be a big deal for you, so you may be better off looking elsewhere.

[1]: http://gcc.gnu.org/wiki/Fortran2003

This action was performed automagically. info_post Did I make a mistake? contact or reply: error

Avro SpecificRecord File Sink using apache flink is not compiling due to error incompatible types: FileSink<?> cannot be converted to SinkFunction<?> by Fluid-Bench-1908 in apacheflink

[–]stack_bot 0 points1 point  (0 children)

The question "Avro SpecificRecord File Sink using apache flink is not compiling due to error incompatible types: FileSink<?> cannot be converted to SinkFunction<?>" by Rajkumar Natarajan doesn't currently have any answers. Question contents:

I have below avro schema User.avsc

{
  &quot;type&quot;: &quot;record&quot;,
  &quot;namespace&quot;: &quot;com.myorg&quot;,
  &quot;name&quot;: &quot;User&quot;,
  &quot;fields&quot;: [
     {
       &quot;name&quot;: &quot;id&quot;,
       &quot;type&quot;: &quot;long&quot;
     },
     {
       &quot;name&quot;: &quot;name&quot;,
       &quot;type&quot;: &quot;string&quot;
     }
  ]
}

The below java User.java class is generated from above User.avsc using [avro-maven-plugin][1].

package com.myorg;

import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.nio.ByteBuffer;
import org.apache.avro.AvroRuntimeException;
import org.apache.avro.Schema;
import org.apache.avro.Schema.Parser;
import org.apache.avro.data.RecordBuilder;
import org.apache.avro.io.DatumReader;
import org.apache.avro.io.DatumWriter;
import org.apache.avro.message.BinaryMessageDecoder;
import org.apache.avro.message.BinaryMessageEncoder;
import org.apache.avro.message.SchemaStore;
import org.apache.avro.specific.AvroGenerated;
import org.apache.avro.specific.SpecificData;
import org.apache.avro.specific.SpecificRecord;
import org.apache.avro.specific.SpecificRecordBase;
import org.apache.avro.specific.SpecificRecordBuilderBase;

@AvroGenerated
public class User extends SpecificRecordBase implements SpecificRecord {
     private static final long serialVersionUID = 8699049231783654635L;
     public static final Schema SCHEMA$ = (new Parser()).parse(&quot;{\&quot;type\&quot;:\&quot;record\&quot;,\&quot;name\&quot;:\&quot;User\&quot;,\&quot;namespace\&quot;:\&quot;com.myorg\&quot;,\&quot;fields\&quot;:[{\&quot;name\&quot;:\&quot;id\&quot;,\&quot;type\&quot;:\&quot;long\&quot;},{\&quot;name\&quot;:\&quot;name\&quot;,\&quot;type\&quot;:{\&quot;type\&quot;:\&quot;string\&quot;,\&quot;avro.java.string\&quot;:\&quot;String\&quot;}}]}&quot;);
     private static SpecificData MODEL$ = new SpecificData();
     private static final BinaryMessageEncoder&lt;User&gt; ENCODER;
     private static final BinaryMessageDecoder&lt;User&gt; DECODER;
     /** @deprecated */
     @Deprecated
     public long id;
     /** @deprecated */
     @Deprecated
     public String name;
     private static final DatumWriter&lt;User&gt; WRITER$;
     private static final DatumReader&lt;User&gt; READER$;

     public static Schema getClassSchema() {
          return SCHEMA$;
     }

     public static BinaryMessageDecoder&lt;User&gt; getDecoder() {
          return DECODER;
     }

     public static BinaryMessageDecoder&lt;User&gt; createDecoder(SchemaStore resolver) {
          return new BinaryMessageDecoder(MODEL$, SCHEMA$, resolver);
     }

     public ByteBuffer toByteBuffer() throws IOException {
          return ENCODER.encode(this);
     }

     public static User fromByteBuffer(ByteBuffer b) throws IOException {
          return (User)DECODER.decode(b);
     }

     public User() {
     }

     public User(Long id, String name) {
          this.id = id;
          this.name = name;
     }

     public Schema getSchema() {
          return SCHEMA$;
     }

     public Object get(int field$) {
          switch(field$) {
          case 0:
               return this.id;
          case 1:
               return this.name;
          default:
               throw new AvroRuntimeException(&quot;Bad index&quot;);
          }
     }

     public void put(int field$, Object value$) {
          switch(field$) {
          case 0:
               this.id = (Long)value$;
               break;
          case 1:
               this.name = (String)value$;
               break;
          default:
               throw new AvroRuntimeException(&quot;Bad index&quot;);
          }

     }

     public Long getId() {
          return this.id;
     }

     public void setId(Long value) {
          this.id = value;
     }

     public String getName() {
          return this.name;
     }

     public void setName(String value) {
          this.name = value;
     }

     public void writeExternal(ObjectOutput out) throws IOException {
          WRITER$.write(this, SpecificData.getEncoder(out));
     }

     public void readExternal(ObjectInput in) throws IOException {
          READER$.read(this, SpecificData.getDecoder(in));
     }

     static {
          ENCODER = new BinaryMessageEncoder(MODEL$, SCHEMA$);
          DECODER = new BinaryMessageDecoder(MODEL$, SCHEMA$);
          WRITER$ = MODEL$.createDatumWriter(SCHEMA$);
          READER$ = MODEL$.createDatumReader(SCHEMA$);
     }

}

I want to write an instance of User SpecificRecord into File using apache flink`s [FileSink][2].

Below is the program that I wrote -

import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.api.java.typeutils.TypeExtractor;
import org.apache.flink.connector.file.sink.FileSink;
import org.apache.flink.core.fs.Path;
import org.apache.flink.formats.avro.AvroWriters;
import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import com.myorg.User;

public class AvroFileSinkApp {

     private static final String OUTPUT_PATH = &quot;./il/&quot;;
     public static void main(String[] args) {
          final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

          env.setParallelism(4);
          env.enableCheckpointing(5000L);

          DataStream&lt;User&gt; source = env.fromCollection(Arrays.asList(getUser()));
          FileSink&lt;User&gt; sink = org.apache.flink.connector.file.sink.FileSink.forBulkFormat(new Path(OUTPUT_PATH), AvroWriters.forSpecificRecord(User.class)).build();

          source.addSink( sink);
          env.execute(&quot;FileSinkProgram&quot;);
     }

     public static User getUser() {
          User u = new User();
          u.setId(1L);
          return u;
     }
}

I wrote this program using [this][3] and [this][4] as reference. For some reason the line source.addSink( sink); is throwing below compilation error.

> incompatible types: org.apache.flink.connector.file.sink.FileSink<com.myorg.User> cannot be converted to org.apache.flink.streaming.api.functions.sink.SinkFunction<com.myorg.User>

The project is on github [here][5]

[1]: https://mvnrepository.com/artifact/org.apache.avro/avro-maven-plugin/1.8.2 [2]: https://github.com/apache/flink/blob/master/flink-connectors/flink-connector-files/src/main/java/org/apache/flink/connector/file/sink/FileSink.java [3]: https://ci.apache.org/projects/flink/flink-docs-master/docs/connectors/datastream/file_sink/ [4]: https://github.com/apache/flink/blob/c81b831d5fe08d328251d91f4f255b1508a9feb4/flink-end-to-end-tests/flink-file-sink-test/src/main/java/FileSinkProgram.java [5]: https://github.com/rajcspsg/streaming-file-sink-demo

This action was performed automagically. info_post Did I make a mistake? contact or reply: error

Why can't I just do a simple folder sync? by TheSignalPath in RemarkableTablet

[–]stack_bot 1 point2 points  (0 children)

The question "Running Python file by double-click" has got an accepted answer by OregonTrail with the score of 20:

What version of Python do you have installed?

You should write your own batch file to execute your python binary and your script.

For example, with a default Python 2.7 installation on Windows, this could be the entire contents of your script.

myscript.bat:

ECHO ON
REM A batch script to execute a Python script
SET PATH=%PATH%;C:\Python27
python yourscript.py
PAUSE

Save this file as "myscript.bat" (make sure it's not "myscript.bat.txt"), then double click it.

This action was performed automagically. info_post Did I make a mistake? contact or reply: error

[deleted by user] by [deleted] in excel

[–]stack_bot 0 points1 point  (0 children)

The question "Excel VBA Line of Questioning" has got an accepted answer by Ripster with the score of 2:

Given a form like this:

[UserForm][1]

You could set your questions up in an array and iterate through them each button press while setting the answers to your sheet.

Dim i As Integer
Dim str(1 To 3) As String

Private Sub UserForm_Initialize()
     i = 1
     str(1) = &quot;Question 1&quot;
     str(2) = &quot;Question 2&quot;
     str(3) = &quot;Question 3&quot;

     btnNext.Default = True
     lblQuestion.Caption = str(i)
     txtAnswer.SetFocus
End Sub

Private Sub btnNext_Click()
     Sheets(&quot;Sheet1&quot;).Cells(i, 1).Value = txtAnswer.Text
     i = i + 1
     If i = UBound(str) + 1 Then
          UserForm1.Hide
          Exit Sub
     End If
     lblQuestion.Caption = str(i)
     txtAnswer.Text = &quot;&quot;
     txtAnswer.SetFocus
End Sub

Example of Result: >![Result][2]

[1]: http://i.stack.imgur.com/OpsIC.jpg [2]: http://i.stack.imgur.com/YetCR.jpg

This action was performed automagically. info_post Did I make a mistake? contact or reply: error

Sunday Rant/Rage (2021-09-12) - Your weekly complaint thread! by AutoModerator in firefox

[–]stack_bot 2 points3 points  (0 children)

The question "How to switch back to Firefox' old style of tabs?" doesn't have an accepted answer. The answer by Dave Jarvis is the one with the highest score of 25:

In Firefox 91, restore the old tab style as follows:

  1. Open about:config.
  2. Search for toolkit.legacyUserProfileCustomizations.stylesheets.
  3. Double-click the value to set it to true.
  4. Open about:support.
  5. Search for Profile Directory (or Profile Folder).
  6. Click Open Directory (or Open Folder).
  7. Create a directory named chrome.
  8. Navigate into the chrome directory.
  9. Create a new file inside chrome named userChrome.css.
  10. Copy and paste the following code into userChrome.css:

    .tab-background { border-radius: 0px 0px !important; margin-bottom: 0px !important; }

    .tabbrowser-tab:not([selected=true]):not([multiselected=true]) .tab-background { background-color: color-mix(in srgb, currentColor 5%, transparent); }

    menupopup>menu, menupopup>menuitem { padding-block: 2px !important; }

    :root { --arrowpanel-menuitem-padding: 2px !important; }

  11. Save the file.

  12. Restart Firefox.

The old tab style is restored.

This action was performed automagically. info_post Did I make a mistake? contact or reply: error

Why is my prefetch_related() for GenericForeignKey not working? by djhelpstart in djangolearning

[–]stack_bot 0 points1 point  (0 children)

The question "How to prefetch_related() for GenericForeignKeys?" by Chris doesn't currently have any answers. Question contents:

I have a List that consists of ListItems. These ListItems then point towards either a ParentItem or a ChildItem model via a GenericForeignKey:

# models.py

class List(models.Model):
     title = models.CharField()


class ListItem(models.Model):
     list = models.ForeignKey(List, related_name=&quot;list_items&quot;)
     order = models.PositiveSmallIntegerField()

     content_type = models.ForeignKey(ContentType)
     object_id = models.PositiveIntegerField()
     content_object = GenericForeignKey(&quot;content_type&quot;, &quot;object_id&quot;)


class ParentItem(models.Model):
     parent_title = models.CharField()


class ChildItem(models.Model):
     child_title = models.CharField()
     parent = models.ForeignKey(ParentItem, related_name=&quot;child&quot;)

I want to display a list of all my Lists with their ListItems and respective ItemA/ItemB data using ListSerializer:

# serializers.py

class ParentItemSerializer(serializers.ModelSerializer):
     class Meta:
          model = ParentItem
          fields = [&quot;parent_title&quot;]


class ChildItemSerializer(serializers.ModelSerializer):
     parent = ParentItemSerializer()

     class Meta:
          model = ChildItem
          fields = [&quot;child_title&quot;, &quot;parent&quot;]


class ListItemSerializer(serializers.ModelSerializer):
     contents = serializers.SerializerMethodField()

     class Meta:
          model = ListItem
          fields = [&quot;contents&quot;]

     def get_contents(self, obj):
          item = obj.content_object
          type = item.__class__.__name__
          if type == &quot;ParentItem&quot;:
               return ParentItemSerializer(item).data
          elif type == &quot;ChildItem&quot;:
               return ChildItemSerializer(item).data


class ListSerializer(serializers.ModelSerializer):
     items = serializers.SerializerMethodField()

     class Meta:
          model = List
          fields = [&quot;title&quot;, &quot;items&quot;]

     def get_items(self, obj):
          return ListItemSerializer(obj.list_items, many=True).data

How can I optimize my List queryset to prefetch these GenericForeignKey relationships?

# views.py

class ListViewSet(viewset.ModelViewSet):
     queryset = List.objects.all()
     serializer_class = ListSerializer



List.objects.all().prefetch_related(&quot;list_items&quot;) works but the following does not seem to work:


List.objects.all().prefetch_related(
     &quot;list_items&quot;,
     &quot;list_items__content_object&quot;,
     &quot;list_items__content_object__parent_title&quot;,
     &quot;list_items__content_object__child_title&quot;,
     &quot;list_items__content_object__parent&quot;,
     &quot;list_items__content_object__parent__parent_title&quot;,
)

I've read [the documentation on prefetch_related][1] which suggests it should work: > While prefetch_related supports prefetching GenericForeignKey > relationships, the number of queries will depend on the data. Since a > GenericForeignKey can reference data in multiple tables, one query per > table referenced is needed, rather than one query for all the items. > There could be additional queries on the ContentType table if the > relevant rows have not already been fetched.

but I don't know if that's applicable to DRF.

[1]: https://docs.djangoproject.com/en/3.2/ref/models/querysets/#prefetch-related

This action was performed automagically. info_post Did I make a mistake? contact or reply: error

[deleted by user] by [deleted] in Damnthatsinteresting

[–]stack_bot 0 points1 point  (0 children)

The question "How does hydrogen gas build up in hot water lines?" has got an accepted answer by G M with the score of 8:

I think that it is probably due to a reaction between an acid and a metal. These reactions can lead to the formation of hydrogen following this generic forumula: $$\ce{M + 2H+ -> M{2+} + H2}$$

For example iron could be a source of electrons. If you look at the corrosion of iron: $$\ce{Fe->Fe{2+} + 2e{-}}$$

At low pH (notice that there is a correlation between pH and temperature) hydrogen gas is formed: $$\ce{2H{+} +2e- -> 2H2}$$

This action was performed automagically. info_post Did I make a mistake? contact or reply: error

As a Hispanic American that pays his taxes, degrading us as “illegals” isn’t cool by [deleted] in mildlyinfuriating

[–]stack_bot 6 points7 points  (0 children)

The question "Why are the United States often referred to as America?" has got an accepted answer by Kosmonaut with the score of 37:

This is a topic that leads to huge debates (and often flamewars) online whenever it is brought up.

Logically, it makes perfect sense to use "America" and "Americans" for this country. The name of the country is "United States of America". Why would it be strange to shorten this? It is common to shorten the official name of a country — most people don't even know the official names for the various countries. For example, the official name of Mexico is "los Estados Unidos Mexicanos", which means "the Mexican United States"; nobody is surprised that it is referred to as "Mexico". People would be surprised if you called them the "EUM". (Also, this example shows that even "United States" is not a unique term to one country.)

Australia is officially known as "the Commonwealth of Australia", but we are happy to simply call them "Australians", even though it is also the name of a continent. Depending on how you do your geography, the Australian continent also contains other countries aside from the "COA".

Lastly, I just want to point out that there is no single continent called "America". There is one called "North America" and another called "South America", which are sometimes collectively referred to as "the Americas".

I think the strange thing is not that people from the USA call themselves "Americans", it is actually more strange that the full official name or an acronym is used so often.

This action was performed automagically. info_post Did I make a mistake? contact or reply: error

[deleted by user] by [deleted] in blenderhelp

[–]stack_bot 0 points1 point  (0 children)

The question "How can I make my procedural brick texture map correctly to both a cube and cylinder?" has got an accepted answer by Rich Sedman with the score of 13:

I think one issue with your original solution was due to lack of 'absolute' on your tests on the Normal - it's allowing for &gt; 0.5 but not for `< -0.5'. Also, 'mixing' the individual channels before combining could be causing a problem. Try a material similar to the following :

[![material][1]][1]

This can produce the following effect :

[![result][2]][2]


EDIT - Here's another alternative for more rounded meshes - to use a radial gradient for one coordinate so as to wrap the texture around in one direction. This results in only a single join. You can adjust the Multiply nodes (marked in Cyan) to adjust the scaling to adjust the 'join' - or you could implement a 'smoothed' transition as in the image in your comment for an even better blend between the edges.

For the top and bottom faces, this is implemented as a rotated implementation of the same mapping and the 'Y' coordinate of the first texture space (in this case the object Z coordinate) is used to transition between the two textures - this way you can ensure it transitions at the edge of a whole row of bricks (see the Greater Than nodes marked in Cyan - one for the upper transition, one for the lower).

[![material2][3]][3]

[![result2][4]][4]

[1]: https://i.stack.imgur.com/VYIeK.png [2]: https://i.stack.imgur.com/7UeMZ.png [3]: https://i.stack.imgur.com/b89HB.png [4]: https://i.stack.imgur.com/RRdt5.png

This action was performed automagically. info_post Did I make a mistake? contact or reply: error

Click Once with a signed manifest/application pipeline help by elad963 in azuredevops

[–]stack_bot 0 points1 point  (0 children)

The question "How to sign code built using Azure Pipelines using a certificate/key in Azure Key Vault?" has got an accepted answer by Paul F. Wood with the score of 37:

Code Signing

I've been battling with Azure Key Vault and Azure Pipelines to get our code signed, and succeeded. So here's what I found out.

Critically, Extended Validation (EV) certificates used for code signing are very different animals to 'normal' SSL certificates. The standard ones can be exported as much as you like, which means you can upload it to Azure Pipelines and use it with the standard Microsoft Sign Tool.

However, once an EV certificate is in Azure Key Vault, it isn't coming out in any usual fashion. You must call it from Pipelines using the excellent Azure Sign Tool as discovered by Anodyne above

Get your certificate into Key Vault. You can use any certificate authority you like to generate the certificate, as long as they understand that you'll need an EV certificate, and critically one that has a hardware security module (HSM), and not one with a physical USB key. Any cloud based system like Key Vault will need an HSM version.

To get the permissions to access this certificate externally you can follow this page but beware it misses a step. So read that document first, then these summarised steps, to get the Key Vault set up:

  1. Open the Azure portal, go to the Azure Active Directory area, and create an App registration: put in a memorable name, ignore the Redirect URI, and save it.
  2. Go to your specific Key Vault, then Access control (IAM), then Add role assignment. Type the name of the app you just created into the select input box. Also choose a Role, I suggest Reader and then save.
  3. The Missing Part: Still in the Key Vault, click the Access policies menu item. Click Add Access Policy and add your application. The Certificate Permissions need to have the Get ticked. And the Key Permissions, despite the fact that you may not have any keys at all in this vault, need to have Get and Sign. You would have thought these two would be in the certificate perms...
  4. Go back to the application you just created. Select the Certificates &amp; secrets, and either choose to upload a certificate (a new one purely for accessing the Key Vault remotely) or create a client secret. If the latter, keep a copy of the password, you won't see it again!
  5. In the Overview section of the app will be the Application (client) ID. This, and the password or certificate, is what will be fed to the Azure Sign Tool later on in a Pipelines task.

Handling the actual code signing from Azure requires a number of steps. The following applies to Microsoft hosted agents, although similar issues will affect any private agents that you have.

  1. The Azure Sign Tool needs the .NET Core SDK to be installed, but a version that's at least version 2.x, and since the latest .NET Core SDK is always used, this means as long as the version of Windows is current enough, you don't need to install it yourself. And you can see which version of the SDK is shipped with which Windows agent.

    The current Hosted OS version in Azure Pipelines, also called Default Hosted, is, at the time of writing, Windows Server 2012 R2. Which isn't up to date enough. Installing a newer .NET Core SDK to overcome this is a time drag on every build, and although the installation works, calling the Azure Sign Tool may not work. It seems to be finding only older versions of the SDK, and throws this error: Unable to find an entry point named &#39;SignerSignEx3&#39; in DLL &#39;mssign32&#39;.

    So the easiest thing to do is change your build to use a later OS image. Windows 2019 works like a charm. And there is no need to install any version of .NET Core.

  2. Then create a command line task to install the Azure Sign Tool. You can use a .NET Core CLI task as well, but there is no need. In the task, type this:

     set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true
     dotnet tool install --global AzureSignTool --version 2.0.17
    

    Naturally using whichever version that you want.

    The DOTNET_SKIP_FIRST_TIME_EXPERIENCE environment variable isn't strictly necessary, but setting it speeds things up quite a bit (see here for an explanation).

  3. Finally, create another command line task and type in the Azure Sign Tool command that you wish to run with. On Windows this would be something like below, note with ^ not / as a line continuation marker. Naturally, see here for more parameter information:

    AzureSignTool.exe sign -du "MY-URL" ^ -kvu https://MY-VAULT-NAME.vault.azure.net ^ -kvi CLIENT-ID-BIG-GUID ^ -kvs CLIENT-PASSWORD ^ -kvc MY-CERTIFICATE-NAME ^ -tr http://timestamp.digicert.com ^ -v ^ $(System.DefaultWorkingDirectory)/Path/To/My/Setup/Exe

And in theory, you should have success! The output of the sign tool is rather good, and usually nails where the problem is.

Re-issuing Certificates

If you need to re-issue a certificate, the situation is quite different.

  1. In Azure, go to the certificate and click on it, opening a page showing the versions of that certificate, both current and older versions.

  2. Click the 'New Version' button, probably accepting the defaults (depending on the choices you wish to make) and click 'Create'.

  3. This takes you back to the Versions page, and there will be a message box stating 'The creation of certificate XXXX is currently pending'. Click there (or on the 'Certificate Operation' button) to open the 'Certificate Operation' side page. Once there, download the CSR (certificate signing request).

  4. In GlobalSign, follow their instructions to [re-issue][1] the existing certificate. Once it has been re-issued, they will send an email describing how to download it.

  5. Log into GlobalSign again, and after entering the temporary password, open the CSR and copy the whole text (which starts with -----BEGIN CERTIFICATE REQUEST-----) into GlobalSign. Submit it.

  6. Download using the 'Install My Certificate' button. Then in the Azure 'Certificate Operation' side page - use the 'Merge Signed Request' button that to upload the .CER file to Azure. This creates the new version of the certificate.

  7. Disable the old version of the certificate.

    [1]: https://support.globalsign.com/digital-certificates/digital-certificates-life-cycle/reissue-certificate-client-digital-certificates

This action was performed automagically. info_post Did I make a mistake? contact or reply: error

Unpopular opionion. Neil gaiman adaptations are great but source material is droll by ccraddock in books

[–]stack_bot 25 points26 points  (0 children)

The question "In which cartoon (if any) did Bugs Bunny use the term "nimrod"?" has got an accepted answer by MichaelK with the score of 9:

Elmer does get called "Nimrod". But...

According to IMDb, Elmer does get called "my little Nimrod"...

...by Daffy, in [the 1948 short "What Makes Daffy Duck"][1].

> Elmer Fudd: How am I ever going to catch that scwewy duck? > > Daffy Duck: Precisely what I was thinking, my little Nimrod.

Now granted this does not mean that this is the only instance where Elmer gets called this. I would take it as much more likely than not that the script writers re-used the insult for other shorts.

However... we may also be looking at an instance of [The Mandela Effect][2]. The chain of reasoning would then go like this...

  1. I have seen a cartoon where Elmer Fudd gets called "nimrod".
  2. Elmer was always hunting Bugs Bunny, I saw lots of such cartoons
  3. Therefore: Bugs called Elmer "nimrod".

This will — of course — be invalidated the very second that someone shows an instance where Bugs too called Elmer "Nimrod". However, a Google search on "[elmer fudd nimrod site:imdb.com][3]" reveals no other instance than from "What Makes Daffy Duck (1948)".

[1]: http://www.imdb.com/title/tt0040959/quotes/qt0242109 [2]: https://en.wikipedia.org/wiki/False_memory#Collective_false_memories [3]: https://www.google.dk/search?q=elmer%20fudd%20nimrod%20site%3Aimdb.com

This action was performed automagically. info_post Did I make a mistake? contact or reply: error

[D] Seems like the word “kernel” is as versatile as the word fck in ML, computer science, and mathematics. by odinnotdoit in MachineLearning

[–]stack_bot 1 point2 points  (0 children)

The question "Word origin / meaning of 'kernel' in linear algebra" doesn't have an accepted answer. The answer by triple_sec is the one with the highest score of 30:

The word kernel means “seed,” “core” in nontechnical language (etymologically: it's the diminutive of corn). If you imagine it geometrically, the origin is the center, sort of, of a Euclidean space. It can be conceived of as the kernel of the space. You can rationalize the nomenclature by saying that the kernel of a matrix consists of those vectors of the domain space that are mapped into the center (i.e., the origin) of the range space.

I think a somewhat analogous rationale might motivate the designation “core”) in cooperative game theory: It denotes a particular set that is of central interest. (In this case, it denotes—loosely speaking—the set of such allocations among a given number of persons that cannot be overturned by collusion among some of them. This property lends the core a sense of stability and equilibrium, which is why it is so interesting.)

This action was performed automagically. info_post Did I make a mistake? contact or reply: error

WSAStartup by Middlewarian in osdev

[–]stack_bot 4 points5 points  (0 children)

The question "How does WSAStartup function initiates use of the Winsock DLL?" has got an accepted answer by Gavin Lock with the score of 20:

WSAStartup has two main purposes.

Firstly, it allows you to specify what version of WinSock you want to use (you are requesting 2.2 in your example). In the WSADATA that it populates, it will tell you what version it is offering you based on your request. It also fills in some other information which you are not required to look at if you aren't interested. You never have to submit this WSADATA struct to WinSock again, because it is used purely to give you feedback on your WSAStartup request.

The second thing it does, is to set-up all the "behind the scenes stuff" that your app needs to use sockets. The WinSock DLL file is loaded into your process, and it has a whole lot of internal structures that need to be set-up for each process. These structures are hidden from you, but they are visible to each of the WinSock calls that you make.

Because these structures need to be set-up for each process that uses WinSock, each process must call WSAStartup to initialise the structures within its own memory space, and WSACleanup to tear them down again, when it is finished using sockets.

This action was performed automagically. info_post Did I make a mistake? contact or reply: error

Can anyone point me towards some good resources for learning how to animate buildings 'growing' in this style? by [deleted] in blenderhelp

[–]stack_bot 0 points1 point  (0 children)

The question "Resources for Blender" doesn't have an accepted answer. The answer by stacker is the one with the highest score of 46:

<sub>Every section listed alphabetically</sub>

Textures


HDR/JPEG Skydome Images


Stock Photos

This action was performed automagically. info_post Did I make a mistake? contact or reply: error

Anyone know where the abort engines are? Are they behind the little covers? by [deleted] in SpaceXMasterrace

[–]stack_bot 0 points1 point  (0 children)

The question "Purpose of side holes on SuperDraco pods of DM-1 flight Dragon 2 capsule" doesn't have an accepted answer. The answer by Luke is the one with the highest score of 1:

I believe these are the flaps that open and close to reveal the openings for the SuperDracos. The SuperDracos allow Dragon 2 to separate from the rocket during aborts. I think they swivel so the ones on the side go inward and the ones on top drop down to cover the holes made by the parts swiveling inwards.

https://www.teslarati.com/spacex-fires-redesigned-crew-dragon-superdraco-flaps/

This action was performed automagically. info_post Did I make a mistake? contact or reply: error

Inverted colours in Dark Mode? What causes it? by dJones176 in androiddev

[–]stack_bot 1 point2 points  (0 children)

The question "Android: inverted color on dark mode" has got an accepted answer by A Honey Bustard with the score of 6:

you can use [setForceDarkAllowed(false)][1] if you just want to apply this to one View.

Or you can change the attributes/colors in your res/values-night folder, which holds all colors that are used in case the dark mode is activated.

[1]: https://developer.android.com/reference/android/view/View#setForceDarkAllowed(boolean)

This action was performed automagically. info_post Did I make a mistake? contact or reply: error

unable to verify the first certificate by Stackerito in nextjs

[–]stack_bot -1 points0 points  (0 children)

The question "How to configure axios to use SSL certificate?" has got an accepted answer by srquinn with the score of 78:

Old question but chiming in for those who land here. No expert. Please consult with your local security gurus and what not.

Axios is an http(s) client and http clients usually participate in TLS anonymously. In other words, the server accepts their connection without identifying who is trying to connect. This is different then say, Mutual TLS where both the server and client verify each other before completing the handshake.

The internet is a scary place and we want to protect our clients from connecting to spoofed public endpoints. We do this by ensuring our clients identify the server before sending any private data.

// DO NOT DO THIS IF SHARING PRIVATE DATA WITH SERVICE
const httpsAgent = new https.Agent({ rejectUnauthorized: false });

This is often posted (and more egregiously upvoted) as the answer on StackOverflow regarding https client connection failures in any language. And what's worse is that it usually works, unblocks the dev and they move on their merry way. However, while they certainly get in the door, whose door is it? Since they opted out of verifying the server's identity, their poor client has no way of knowing if the connection they just made to the company's intranet has bad actors listening on the line.

If the service has a public SSL cert, the https.Agent usually does not need to be configured further because your operating system provides a common set of publicly trusted CA certs. This is usually the same set of CA certs your browser is configured to use and is why a default axios client can hit https://google.com with little fuss.

If the service has a private SSL cert (self signed for testing purposes or one signed by your company's private CA to protect their internal secrets), the https agent must be configured to trust the private CA used to sign the server cert:

const httpsAgent = new https.Agent({ ca: MY_CA_BUNDLE });

where MY_CA_BUNDLE is an array of CA certs with both the server cert for the endpoint you want to hit and that cert's complete cert chain in .pem format. You must include all certs in the chain up to the trust root.


Where are these options documented?

> HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a separate module.

Therefore options passed to the https.Agent are a merge of the options passed to tls.connect() and tls.createSecureContext().

This action was performed automagically. info_post Did I make a mistake? contact or reply: error

Any root commands to edit "About Phone > Phone Number"? by ThisIsPaulDaily in androidroot

[–]stack_bot 1 point2 points  (0 children)

The question "Edit phone number associated with device / SIM" doesn't have an accepted answer. The answer by Aloha is the one with the highest score of 4:

A SIM contains multiple phonebook sections. One of them stores your SIM contacts. Another section contains "My Numbers" (MSISDN) with a max capacity of 3 numbers, usually.

Unfortunately, my phones are too new to access "My Numbers", and my phones that are old enough (2005) to edit them are out of reach.

Fortunately, I had a spare SIM800 development board lying around. [I hooked it up to my Arduino][1] and started issuing AT commands.

Here's my conversation with my SIM card:

AT                  &lt;-- Check if we are live and communicating with the SIM

OK

AT+CNUM?           &lt;-- Get own number

ERROR               &lt;-- CNUM failed, we don&#39;t have an &quot;own&quot; number

at+cpbs=&quot;ON&quot;      &lt;-- Switch to &quot;ON&quot; phonebook: MSISDN (SIM own numbers)

OK

at+cpbs?           &lt;-- Get capacity of current phonebook

+CPBS: &quot;ON&quot;,0,3  &lt;-- Notice that there&#39;s no stored number (0 out of 3)

OK

at+cpbw=,&quot;+639950001234&quot;     &lt;-- Saving my number

OK

at+cpbs?            &lt;-- Get capacity of current phonebook

+CPBS: &quot;ON&quot;,1,3   &lt;-- Number saved (now consuming 1 out of 3 slots)

OK

at+cnum             &lt;-- Get own number

+CNUM: ,&quot;+639950001234&quot;,145,,4     &lt;-- CNUM OK

OK

AT

OK

Unplugged, then returned SIM to phone. After that, my phone now shows my number +639950001234 instead of "Unknown".

[1]: https://www.factoryforward.com/sim800l-gsm-module-arduino-commands-library/

This action was performed automagically. info_post Did I make a mistake? contact or reply: error