text:
Q: Css: how to fix li's in one line My li's aren't in one line. How do I fix this?
I need to have 3 columns and on the same line.
How do I do this?
Thanks!
example
My HTML:

Movies

Quote per category

Home

Movie db search

&copy copyright Robin Hennebel. Data fetched from Tmdb and Chucknorris.io

So you can see my li's where i put a picture and a paragraph via fetch.
I need them to be in one line in 3 columns.
My CSS:
    article ul li {
    display:inline-block;
    width: 30%;
}

article li:nth-child(even){
    background-color: #A0C0FF;
    border-radius: 25px;
}

article li:nth-child(odd){
    background-color: #F897CA;
    border-radius: 25px;
    margin-left: 1%;
}

figure img{
    width: 35%;
    display:block;
    margin-left:auto;
    margin-right: auto;
    margin-top: 1%;
}

figcaption{
    padding: 2%;
}

figure {
    display: flex;
    flex-direction: column;
    align-items: center;
}
article{
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

Does anyone has a solution?

A: METHOD 1: Use flexbox, that's the cleanest & most modern answer. You already use flex elsewhere, and you can make use of all of its magical powers...

ul {
  display: flex;
  flex-wrap: wrap;
}

ul li {
  flex: 1 0 33.3%;
}

Apples

Oranges

Bananas

Pears

Mangos

Peaches

Plums

However support for flexbox in older browsers is iffy. Test it in IE11, does it work?
METHOD 2: You can resort to a more classic way, using display:inline-block (fyi I use width: 30%, for some odd reason 33.3% results in two columns)...

ul li {
  width: 30%;
  display: inline-block;
}

Apples

Oranges

Bananas

Pears

Mangos

Peaches

Plums

Method 3: Or using float: left, my personal favourite over the years, before becoming a flex addict ...

ul li {
  width: 33.3%;
  float: left;
}

Apples

Oranges

Bananas

Pears

Mangos

Peaches

Plums

A: replace css code like this
your li in header nav
nav ul li {
display:inline-block;
width: 30%;
}
nav li:nth-child(even){
   background-color: #A0C0FF;
  border-radius: 25px;
}
 nav li:nth-child(odd){
background-color: #F897CA;
border-radius: 25px;
margin-left: 1%;
}

https://jsfiddle.net/9twyyafs/


text:
Q: How do I get a java applet signed? So, I have this website that contains a java applet (before you insult me, no, I can't replace it with HTML5/JS, I am not responsible for this), but the latest java update prevents websites from running self signed applets.
Of course my applet is self signed, so how do I "get it signed"?

A: Perhaps you can have a look at the following :
http://docs.oracle.com/javase/tutorial/deployment/doingMoreWithRIA/security.html
http://www.oracle.com/technetwork/articles/javase/appletwarning-135102.html

redpajama_set_name: RedPajamaStackExchange


text:
Q: Disabling particular jenkins job for cloning We have some jobs which should'nt be duplicated?
Is it possible to disable cloning(copying) of a particular job in jenkins?

A: The only thing that comes close in the Matrix Authorization Strategy Plugin is:

Job

...
Create
...

☐
☐
☐


text:
Q: When should you not use the new parallel loop functions in c# For maintainability purposes, my impulse is to simply use parallel processing all the time. For simple loops it sounds like there is overhead which could actually slow the function, and presumably for loops where order of execution makes a difference it is a mistake.
How do you decide when to use parallel processing and when to avoid it?

A: Things that would cause problems:

*

*dependency on things with thread affinity; UI controls; asp.net context

*anything with thread-specific state (thread-static / thread-local)

*anything with mutable state and side-effects

But more importantly; do you need it? In many cases it is overkill, and threading always has a slight overhead (the total CPU time increases, even if the elapsed time decreases). Now; if you already in a highly threaded environment (such as a busy web-server), this isn't going to help!
There are a couple of scenarios where it comes into its own, usually when the elapsed time is more important than the overall CPU time - so very useful at the client, or on some web-server scenarios. It is especially useful if the state is immutable, so it is pretty trivial to tear the work apart and put the result back together again. There are some great examples of processing fractals etc, or other CPU-intensive work, with Parallel.


text:
Q: Value undefined for a particular @Input parameter I am having a below component in my AngularJs 2 based Ionic 2 project.
import { Component, Input } from '@angular/core';

@Component({
  selector: 'items-list',
  templateUrl: 'items-list.html'
})

export class ItemsListComponent {
  @Input() type;
  @Input() count;

  items: Array<{ url: string, title: string }>;

  constructor() {
  }

  ngOnInit() {
    console.log(this.type); //undefined
    console.log(this.count); //10

    this.items = [];

    for (let i = 1; i < this.count; i++) {
      this.items.push({
        url: 'assets/' + this.type + '/' + i + '.png', title: 'Style # ' + i
      });
    }

    console.log(JSON.stringify(this.items));

  }
}

I am using the component in one of my page as below and it shows up the template content.
<items-list [type]="children" [count]=10></items-list>

But the "type" input value is always undefined. I am able to see the value of "10" in the console for "count" input.
Why "this.type" is always undefined and why "this.count" shows the actual value?

A: I had the same problem with a component I created.  If your type is a string, don't use [type]="children", use type="children"


text:
Q: using constant values with thumb instructions My question is related to the constant values that are possible for thumb encoding .
I am working with ARM v7 instruction set.
Reference Manual says that constants that can be used while writing instructions in thumb are encoded into into 12 bit encoding and the psudocode ThumbExpandImm() (pg 233 in ARM's ARM) describes the process of encoding and the possible constants that can be used with instruction .
I am trying to generate the constants values that are possible with the instruction using the process described by `ThumbExpandImm()` .

I am having problem with the last possibility mentioned when the bits <11:10> of 12 bit encoding for constant is not equal to '00'
,in which case the manual says that the number is represented as immediate value with rotation .
When I generate such numbers and try to assemble , assembler gives out a message:
"cannot be represented by 0-255 shifted left by 0-23 or duplicated in all, odd or even bytes"
I don't understand why assembler is talking about left shift while manual says rotate.
I was also wondering about the idea behind encoding with such scheme ,since it would be difficult to figure out whether the constant value I have in mind to be used ,is permitted in the encoding .

A: I will help you out on this...
if imm12<11:10> == '00' then
....
else
unrotated_value = ZeroExtend('1':imm12<6:0>, 32);
(imm32, carry_out) = ROR_C(unrotated_value, UInt(imm12<11:7>));
return (imm32, carry_out);

so try this, this is gnu assembler.
.syntax unified

.thumb

movs r0,#1
movs r0,#2
movs r0,#3
movw r5,#0x123
movw r6,#0x123
movw r7,#0x123
movw r0,#0x076
movw r0,#0x876
movs.w r0,#0x2000
movs.w r0,#0x4000
movs.w r0,#0x8000

I am guessing you are using something else based on your error messages, but that doesnt affect the encoding...
00000000 <.text>:
   0:   2001        movs    r0, #1
   2:   2002        movs    r0, #2
   4:   2003        movs    r0, #3
   6:   f240 1523   movw    r5, #291    ; 0x123
   a:   f240 1623   movw    r6, #291    ; 0x123
   e:   f240 1723   movw    r7, #291    ; 0x123
  12:   f240 0076   movw    r0, #118    ; 0x76
  16:   f640 0076   movw    r0, #2166   ; 0x876
  1a:   f45f 5000   movs.w  r0, #8192   ; 0x2000
  1e:   f45f 4080   movs.w  r0, #16384  ; 0x4000
  22:   f45f 4000   movs.w  r0, #32768  ; 0x8000

take this one
1e:   f45f 4080   movs.w  r0, #16384  ; 0x4000
i = 1, imm3 = 0b100, imm8 = 0b10000000
imm12 is 0xC80, bits 11:10 are 0b11 which is not equal to 0b00 so
unrotated value = ZeroExtend(0b100000000) = 0x00000080
imm32 = ror(0x00000080,0b11001) = ror(0x00000080,25)
a rotate of 24 would be to take 6 nibbles off the right and move them to the left
00000080
00 000080
000080 00
0x00008000

and one more to the right gives 0x00004000 which is our desired constant.
so basically your constant has to be represented by a 1 with 7 bits of your choice which can be rotated right between 0b01000 and 0b11111 (8 and 63)
  0:    f45f 3090   movs.w  r0, #73728  ; 0x12000

0x00000090 rotated right (10111) 23
0x00009000 is a rotate of 24 so 0x00012000 is a rotate of 23.
Or think of it as 0x00000090 rotated left 32-23 = 9
rotated left 8 is 0x00009000 so 9 is 0x00012000.
   4:   f45f 2009   movs.w  r0, #561152 ; 0x89000

0x00000089 rotated left 32-20 = 12 (10100)
0x00000089<<12 = 0x00089000
This is pretty much the same as the ARM encoding.  Basically if you cant take a number between 0x00 and 0xFF and shift it left to get the constant you want you probably cant use that constant.  Or another way to look at it is what is the distance between your most significant non zero and your least, if they are more than 8 bits apart, it wont work, as far as this rotation goes.
these all have the bit pattern 10011001 with some zeros on either side and can be encoded.
   f45f 7099    movs.w  r0, #0x132
   f45f 7019    movs.w  r0, #0x264
   f45f 6099    movs.w  r0, #0x4c8
   f45f 6019    movs.w  r0, #0x990

Now for the mov instruction since I happen to be looking at it, I can do this:
  f241 2034     movw    r0, #0x1234

because there is a 16 bit immediate incoding so long as you dont want to do a movs.  If you do want movs then you have the imm12 situation not the imm16 situation.
thumb2 encoding is much more flexible than the arm encoding because it has the imm16 and it also has these other variations:
If you look in the same place in your arm document where it says if imm12[11:10] = '00'
case imm12<9:8> of
when '00'
imm32 = ZeroExtend(imm12<7:0>, 32);
when '01'
if imm12<7:0> == '00000000' then UNPREDICTABLE;
imm32 = '00000000' : imm12<7:0> : '00000000' : imm12<7:0>;
when '10'
if imm12<7:0> == '00000000' then UNPREDICTABLE;
imm32 = imm12<7:0> : '00000000' : imm12<7:0> : '00000000';
when '11'
if imm12<7:0> == '00000000' then UNPREDICTABLE;
imm32 = imm12<7:0> : imm12<7:0> : imm12<7:0> : imm12<7:0>;

so [9:8] of '00' means we can have any number from 0 to 255.
  f05f 0099     movs.w  r0, #0x00000099

the '01' case means any number from 1 to 255 but the same number has to be in the [7:0] and in the [23:16] location in the constant
  f05f 1099     movs.w  r0, #0x00990099

the '10' case means any number from 1 to 255 but that number has to be in the [31:24] and [15:8] location of the number
  f05f 2099     movs.w  r0, #0x99009900

and the '11' case, any number from 1 to 255 but that same number has to be in all four bytes
  f05f 3012     movs.w  r0, #0x12121212
  f05f 3089     movs.w  r0, #0x89898989


text:
Q: How do I pull from within a nested tag with javascript? Obviously, I'm new to Javascript, and I'm sure that my time with it will be shortlived; this is just for a small project at work. I would really appreciate it if someone would help me figure this out.
I'm trying to set up a page that displays data from an external .xml file, of which I have absolutely no control. It is set up just like this:
<lab id="1" name="A" inUse="14" offline="1" available="16">
</lab>
<lab id="2" name="B" inUse="11" offline="9" available="7">
   <client id="x" status="available" mac="#" ip="#" name="COMPUTER1" />
   <client id="y" status="available" mac="#" ip="#" name="COMPUTER2" />
</lab>

I am displaying the data with a table using the following code:
<%
    try
    {
        URL url = new URL("http://clstats.cc.nd.edu/public/xml-client.jsp");
        InputStream input = url.openStream();
        DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
        Document XMLInfo = builder.parse(input);

        NodeList labs = XMLInfo.getElementsByTagName("lab");

        int length = labs.getLength();
        int i;
        for (i = 0; i < length; i++)
        {

           Node current = labs.item(i);
           String labName = current.getAttributes().getNamedItem("name").getTextContent();
           String available = current.getAttributes().getNamedItem("available").getTextContent();
           String offline = current.getAttributes().getNamedItem("offline").getTextContent();
           String inUse = current.getAttributes().getNamedItem("inUse").getTextContent();
            //Alternate the row colors
            if( (i % 2) == 0)
            {
                  %>

                  <%
             }
             else
             {
                 %>

                 <%
              }
              %>
              <%= labName %>
              <%= available %>
                          <%= offline %>
              <%= inUse %>

               <%
        }
    }
    catch(Exception e){
    }

%>

I am having no trouble displaying information from the "lab" tag, but I'd like to only display data from within a particular lab, let's say lab id=2. Is there a way to display attributes from the "client" tags from under a single, particular "lab" tag?
Thanks, I hope I explained the problem well enough. As you can see, I'm pretty much a noob, and any help would be much appreciated.
Intended Result:

Name
Status

COMPUTER1
Available

COMPUTER2
AVAILABLE

A: You are using getElementsByTagName on the XMLInfo to get labs. I think you can also use  Nodelist clients = current.getElementsByTagName("client"); then iterate through those nodes.

A: That looks like java to me in which case I think you could use Xpath like this:
InputStream input = url.openStream();
   DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
   Document XMLInfo = builder.parse(input);

  XPath xPath = XPathFactory.newInstance().newXPath();
  Node myNode = xPath.evaluate("/lab[@id='2']", XMLInfo, XPathConstants.NODESET);

That should get you the individual node.


text:
Q: Is the Lebesgue measure zero for the discontinuous set of a semicontinuous function? [Q.]
Is there a semicontinuous function, which has its discontinuous set with non-zero measure?
Remark:
Given a semicontinuous function, the set of all discontinuous points may be uncountable, for instance, an indicator function on a Cantor set.
I also found a paper here with its title: "Baire order of functions are continuous almost everywhere", see this link:
http://www.ams.org/journals/proc/1975-051-02/S0002-9939-1975-0372128-1/S0002-9939-1975-0372128-1.pdf
I do not understand this paper, but does it say all semicontinuous functions are continuous almost everywhere, since it is baire-1 function?


text:
Q: Read Xlement fully using LinQ I have an XElement which I am getting after parsing an xml. This XElement needs to be read only when the need arises so, I have stored it in a list for future use.
I have to read this XElement using Linq.
XDocument doc = XDocument.Parse(DataManager.offeringElements[index].DataElem.ToString());

        var docNode = from dataNode in doc.Descendants("DataLinks")
                      select new
                      {
                          Offering = dataNode .Element("link").Value,
                          linkUrl = dataNode.Element("link").Attribue("href").Value
                      };

the Xelement has the following nodes
<DataLinks>
      <link href="">a. Management</link>
      <link href="">b. Analytics</link>
      <link href="">c. Development</link>
    </DataLinks>

My problem is that I am not able to read all the three nodes.I am able to get only the first node. Where is it going wrong?

A: This should work i.e. Elemenets not Descendants and ensure when selecting new, you are selecting a type of object.
public class ObjectType
{
   public Offering {get; set;}
   public linkUrl {get; set;}
}

 var docNode = from dataNode in doc.Elemenets ("DataLinks")
                  select new ObjectType
                  {
                      Offering = dataNode .Element("link").Value,
                      linkUrl = dataNode.Element("link").Attribue("href").Value
                  };

A: I would do it like this. IMHO, the method syntax looks cleaner then the query syntax. Note that this is untested code.
IEnumerable<XElement> seqLinks = doc.Descendants("DataLinks").Single()
   .Descendants("link");

foreach(XElement link in seqLinks)
{
    Console.WriteLine("Value is {0}, and href is {1}",
        link.Value, link.Attribute("href").Value)
}


text:
Q: What is the difference between session and connection in MyBatis? With JDBC, I understand each connection represents a physical tcp connection with database.
But in MyBatis, there is not connections but sessions, so what is the difference between session and connection?
When I open a session or close a session, what happen internal? Is this mean create/close a connection?

A: First of all, JDBC connection does not represent physical TCP connection. TCP connection basically allows only to do very few operations, the main one to send an array of bytes to the application on the other end of the connection.
JDBC connection uses TCP connection underneath but it is a higher level abstraction that allows the application to do the more high level operation, namely, to execute SQL queries.
Similarly, SQLSession in mybatis uses JDBC connection but is even more high level concept. Mainly, it allows to execute sql query and map the result to object as specified by the mapping.


text:
Q: Razer Blade Stealth touchpad jumps with Linux My Issue
I am using the 2016 model Razer Blade Stealth laptop. Recently, I've decided to install Linux on it. Whenever I use the touchpad on any Linux OS I've loaded onto it so far, the cursor jumps around at what seems to be entirely random, usually just a small distance in any direction. I've looked for solutions for over a week now and have tried everything I could find that's already online; no luck. I know it isn't an issue with the hardware because the touchpad works perfectly fine on Windows 10.
The cursor does not jitter or jump whenever I'm just resting my finger on the touchpad, it only occurs when I am moving it. There  also seems to be no consistent spots where it tends to jump around.
What I've tried
Since this appears to be an issue with ALL Linux distrobutions I've tried so far, I've decided to stick with manjaro community edition with i3, which runs on Arch Linux.
[name@name-pc ~]$ uname -r
4.14.66-1-MANJARO

I've tried -

*

*Installing xf86-input-synaptics

*Editing /usr/lib/udev/hwdb.d/60-evdev.hwdband shifting the fuzz zone up and down; no difference.

*following the instructions in this post

Those three things are the only things I found to try. It may be possible that I'm not following the instructions correctly?

A: I've had exactly the same issue, the following steps helped me solve it :

*

*On manjaro/arch linux : Install libinput-git from AUR  to pick up the following change in libinput that should solve the issue: https://gitlab.freedesktop.org/libinput/libinput/merge_requests/99 that. You should note that compiling libinput may require other packages
(python-sphinx, etc...)

*Reboot your pc

If it works, profit !
Else, you may want to tweak the fuzz value :

*

*sudo libinput measure fuzz --fuzz=4

*sudo udevadm hwdb --update

*reboot
If the fuzz value 4 does not work, try with 8 or 12 or 16
More details about touchpad fuzz and jitter here : https://wayland.freedesktop.org/libinput/doc/latest/touchpad-jitter.html


text:
Q: Shut down a notebook instance I am using a couple of notebook instances on Google Cloud as my everyday compute engines. The usual workflow is to iteratively develop my data product using Jupyterlab, and then SSH into the machine once the code is ready to be run (My typical workflow is to run several simulations and hyper parameter tuning experiments). At this point, I usually quit the Jupyterlab interface (File > Quit). After the compute process is over, I typically issue a shutdown command on the SSH instance sudo shutdown -h now (sometimes this is the last line in a bash script).
However, I observe that this does not necessary shutdown the instance (I am looking at the cloud console to verify this). The only way to shutdown is to use the Cloud Console shutdown. However, this is inefficient since I would like to have a bash script that runs my simulations and then shuts down the instance once I am done.
Is there a best practice to be followed for shutting down notebook instances post the workload is done?

A: You can manage your notebook instance from Compute Engine too, so you have actually 3 ways for stopping your instance (From the console, with the gcloud command or calling an API).
I recommend you to add the gcloud stop instance command at the end of your bash script.

gcloud compute instances stop notebook-instance-test --zone=us-west1-b

Remember to add the zone of the instance at the end of the command (if you don't added it the command will ask for the zone)
I tested this myself in a notebook instance and it worked perfectly.


text:
Q: Secure random number generation for all Android versions I am currently playing around with the idea of an application for android which involves encryption. I am planning to use aes in ctr mode and PBKDF2 with whirlpool for key stretching.
I am going to implement a new bouncy castle implementation instead of androids built in old implementation. To make sure it works as intended on any android version.
But I am having some problem figuring out a solid way to generate random numbers for salt and key. I have read somewhere that the built in secure random in android is insecure in some old android versions and I have also heard that most android phones have a hard time keeping a high entropy in dev/random and blocks often. Shouldn't that have a huge impact on the security of dev/urandom?
I am therefore looking for good ways to use the sensors on the phone to gather more entropy.

A: The following classes should help you alleviate issues with the Android SecureRandom class. This code was created instead of a text because otherwise the small details.
/**
 * A strengthener that can be used to generate and re-seed random number
 * generators that do not seed themselves appropriately.
 *
 * @author owlstead
 */
public class SecureRandomStrengthener {
    private static final String DEFAULT_PSEUDO_RANDOM_NUMBER_GENERATOR = "SHA1PRNG";

    private static final EntropySource TIME_ENTROPY_SOURCE = new EntropySource() {

        final ByteBuffer timeBuffer = ByteBuffer.allocate(Long.SIZE / Byte.SIZE
                * 2);

        @Override
        public ByteBuffer provideEntropy() {
            this.timeBuffer.clear();
            this.timeBuffer.putLong(System.currentTimeMillis());
            this.timeBuffer.putLong(System.nanoTime());
            this.timeBuffer.flip();
            return this.timeBuffer;
        }
    };

    private final String algorithm;
    private final List<EntropySource> entropySources = new LinkedList<EntropySource>();
    private final MessageDigest digest;
    private final ByteBuffer seedBuffer;

    /**
     * Generates an instance of a {@link SecureRandomStrengthener} that
     * generates and re-seeds instances of {@code "SHA1PRNG"}.
     *
     * @return the strengthener, never null
     */
    public static SecureRandomStrengthener getInstance() {
        return new SecureRandomStrengthener(
                DEFAULT_PSEUDO_RANDOM_NUMBER_GENERATOR);
    }

    /**
     * Generates an instance of a {@link SecureRandomStrengthener} that
     * generates instances of the given argument. Note that the availability of
     * the given algorithm arguments in not tested until generation.
     *
     * @param algorithm
     *            the algorithm indicating the {@link SecureRandom} instance to
     *            use
     * @return the strengthener, never null
     */
    public static SecureRandomStrengthener getInstance(final String algorithm) {
        return new SecureRandomStrengthener(algorithm);
    }

    private SecureRandomStrengthener(final String algorithm) {
        if (algorithm == null || algorithm.length() == 0) {
            throw new IllegalArgumentException(
                    "Please provide a PRNG algorithm string such as SHA1PRNG");
        }

        this.algorithm = algorithm;
        try {
            this.digest = MessageDigest.getInstance("SHA1");
        } catch (final NoSuchAlgorithmException e) {
            throw new IllegalStateException(
                    "MessageDigest to create seed not available", e);
        }
        this.seedBuffer = ByteBuffer.allocate(this.digest.getDigestLength());
    }

    /**
     * Add an entropy source, which will be called for each generation and
     * re-seeding of the given random number generator.
     *
     * @param source
     *            the source of entropy
     */
    public void addEntropySource(final EntropySource source) {
        if (source == null) {
            throw new IllegalArgumentException(
                    "EntropySource should not be null");
        }
        this.entropySources.add(source);
    }

    /**
     * Generates and seeds a random number generator of the configured
     * algorithm. Calls the {@link EntropySource#provideEntropy()} method of all
     * added sources of entropy.
     *
     * @return the random number generator
     */
    public SecureRandom generateAndSeedRandomNumberGenerator() {
        final SecureRandom secureRandom;
        try {
            secureRandom = SecureRandom.getInstance(this.algorithm);
        } catch (final NoSuchAlgorithmException e) {
            throw new IllegalStateException("PRNG is not available", e);
        }

        reseed(secureRandom);
        return secureRandom;
    }

    /**
     * Re-seeds the random number generator. Calls the
     * {@link EntropySource#provideEntropy()} method of all added sources of
     * entropy.
     *
     * @param secureRandom
     *            the random number generator to re-seed
     */
    public void reseed(final SecureRandom secureRandom) {
        this.seedBuffer.clear();
        secureRandom.nextBytes(this.seedBuffer.array());

        for (final EntropySource source : this.entropySources) {
            final ByteBuffer entropy = source.provideEntropy();
            if (entropy == null) {
                continue;
            }

            final ByteBuffer wipeBuffer = entropy.duplicate();
            this.digest.update(entropy);
            wipe(wipeBuffer);
        }

        this.digest.update(TIME_ENTROPY_SOURCE.provideEntropy());
        this.digest.update(this.seedBuffer);
        this.seedBuffer.clear();
        // remove data from seedBuffer so it won't be retrievable

        // reuse

        try {
            this.digest.digest(this.seedBuffer.array(), 0,
                    this.seedBuffer.capacity());
        } catch (final DigestException e) {
            throw new IllegalStateException(
                    "DigestException should not be thrown", e);
        }
        secureRandom.setSeed(this.seedBuffer.array());

        wipe(this.seedBuffer);
    }

    private void wipe(final ByteBuffer buf) {
        while (buf.hasRemaining()) {
            buf.put((byte) 0);
        }
    }
}

And this is the small interface that is EntropySource:
/**
 * A simple interface that can be used to retrieve entropy from any source.
 *
 * @author owlstead
 */
public interface EntropySource {
    /**
     * Retrieves the entropy.
     * The position of the ByteBuffer must be advanced to the limit by any users calling this method.
     * The values of the bytes between the position and limit should be set to zero by any users calling this method.
     *
     * @return entropy within the position and limit of the given buffer
     */
    ByteBuffer provideEntropy();
}

Note that the output of the classes has not been tested for randomness (but this relies mainly on the returned SecureRandom class and should therefore be fine).
Finally, as I don't have the Android 1.6 runtime ready, somebody should test it against this or a lower version for compatibility (!).


text:
Q: I am having problems saving several files totaling over 4gb on FAT32 drive So after reading about FAT32, I understood that you can't download a file greater than 4gb on FAT32. I am fine with that.  But here is the problem I am having. I have a 1.9tb thumb drive that I am trying to use on my firestick using an OTG USB cable. It is only compatible with FAT32. I downloaded movies on the drive so I can view later.  Each movie is less than 2gb each.  I figured that I would be able to fill this thumb drive up.  Unfortunately as soon as my total storage gets over 4gb, something happens to my thumb drive and it becomes unrecognizable and I have to reformat it and start all over.  It has happened to me three times.  It appears that even if each of the files are less than 4gb, the drive is still limited to a total storage of 4gb. Is this correct?

A: It's a fake 2 TB drive. It actually has only 4 GB (or maybe 8 GB) of memory chips inside. Once you exceed some threshold your data starts overwriting filesystem structures because it "wraps around" memory chips.
You can "salvage" this drive by creating a 4 GB partition at the very beginning.


text:
Q: mongos returns empty collection when queried from different applications We use sharded MongoDB configuration with 2 shards. There are several front applications, which retrieve data via mongos service (installed on each application server).
Problem is that at some point running the same query from Application server #1 will return empty collection, while running the same query from Application server #3 will return correct results.
The problem persists on Application server #1 until flush command is run. As documentation states:

"You should only need to run flushRouterConfig after movePrimary has
  been run or after manually clearing the jumbo chunk flag."

But neither Primary was moved nor was flag cleared.
Any ideas why could this happen?
Config file
# mongos.conf

# for documentation of all options, see:
#   http://docs.mongodb.org/manual/reference/configuration-options/

# where to write logging data.
systemLog:
  destination: file
  logAppend: false
  logRotate: rename
  path: /var/log/mongos.log

# how the process runs
processManagement:
  fork: true  # fork and run in background
  pidFilePath: /var/run/mongos.pid  # location of pidfile

# network interfaces
net:
  port: 27017
  bindIp: 127.0.0.1,94.130.167.133,192.168.0.1  # Listen to local interface only, comment to listen on all interfaces.

security:
  keyFile: /var/lib/database/mongos/.keyfile

sharding:
  configDB: myproject-config/192.168.0.15:27027,192.168.0.16:27017,192.168.0.17:27017

printShardingStatus()
MongoDB shell version: 3.2.8
connecting to: cron0.myproject.smapps.org:27017/test
config.locks collection empty or missing. be sure you are connected to a mongos
--- Sharding Status ---
  sharding version: {
    "_id" : 1,
    "minCompatibleVersion" : 5,
    "currentVersion" : 6,
    "clusterId" : ObjectId("2c5bc3fd9b2385s9613b0la5")
}
  shards:
    {  "_id" : "myproject0",  "host" : "myproject0/192.168.0.11:27017,192.168.0.12:27017",  "state" : 1,  "tags" : [ ] }
    {  "_id" : "myproject1",  "host" : "myproject1/192.168.0.13:27017,192.168.0.18:27017",  "state" : 1,  "tags" : [ "game" ] }
    {  "_id" : "myproject2",  "host" : "myproject2/192.168.0.26:27017,192.168.0.28:27017",  "state" : 1,  "tags" : [ "game" ] }
  active mongoses:
    "4.0.6" : 14
  balancer:
    Currently enabled:  yes
    Currently running:  no
    Failed balancer rounds in last 5 attempts:  0
    Migration Results for the last 24 hours:
        8 : Success
  databases:
    {  "_id" : "myproject",  "primary" : "myproject0",  "partitioned" : true,  "version" : {  "uuid" : BinData(4,"+YxjwrKzTuekDlKutwT1IA=="),  "lastMod" : 1 } }
...


text:
Q: Why can a struct contain a pointer to another struct that is not defined? int main(void)
{
    struct a
    {
        struct b* x;
    };
}

I defined struct a to contain a pointer x to struct b without defining struct b. I was expecting an error. Even by including -Wall, I got nothing from the compiler. Is there an explanation for this?

A: What you have is an incomplete type and it is perfectly fine to have a pointer of such type, but it can't be instantiated unless you complete it.

2.7 Incomplete Types
You can define structures, unions, and enumerations without listing
  their members (or values, in the case of enumerations). Doing so
  results in an incomplete type. You can't declare variables of
  incomplete types, but you can work with pointers to those types.
struct point;

At some time later in your program you will want to complete the type.
  You do this by defining it as you usually would:
struct point {
    int x, y;
};

This technique is commonly used to for linked lists:
struct singly_linked_list   {
    struct singly_linked_list *next;
    int x;
    /* other members here perhaps */
};
struct singly_linked_list *list_head;

A: That's just a standard language feature. struct b is now an incomplete type. There's not much you can do with incomplete types. But one thing you can do is declare pointers to incomplete types.
You will be able to complete that type later by providing a full declaration for struct b. After that it will become a normal struct type.

A: Because the compiler can allocate the structure since it knows the size of a pointer, but you cannot use x because the compiler will not know how to dereference the pointer unless there is a definition for the structure.
You can take advantage of this by using forward declarations, you can declare a pointer of an unknown struct type and avoid including a possible large header file only for the structure thus improving compilation time and effort.


text:
Q: Displaying $_SESSION['name'] and $_SESSION['surname'] I am just trying to display name and surname by session. But,they returned 0. I don't understand why it returned 0 even though both of them are string. There is nothing interesting with the codes;
<?php

    echo   $_SESSION['name']+ ""+$_SESSION['surname'];

?>

A: The period (.) is the string concatenation operator in PHP.
By using the addition operator (+), you are coercing the operands to numbers, of which their value is 0. And obviously, 0 + 0 + 0 = 0.
What you want is...
echo $_SESSION['name'] . $_SESSION['surname'];

I removed the empty string in the middle because it won't do anything. Perhaps you meant a space?

A: echo $_SESSION['name'] ." ". $_SESSION['surname'];

Output will be like Name Surname for example : Mohit Bumb.


text:
Q: Buffering program output when the program author doesn't do it in the first place I have a program which I suspect is coded incorrectly. I think it doesn't do buffering but instead write to disk line by line. The way I specify file name is -e . The question is is there something I can try to make it write to RAM and move it to disk upon application completion?
Actually I would like something like /dev/null but something from where I can collect the output

A: A bit of a workaround that might improve performance - you could you create a ramdisk and have it send it's output to that. There's lots of howtos online, but here's one:
http://www.vanemery.com/Linux/Ramdisk/ramdisk.html

A: Most filesystems will buffer writes anyway unless the application specifically requests synchronous behaviour. For example, the ext2 filesystem will wait up to 30 seconds before flushing writes to disk. So, even poor code like you suspect should not cause significant performance degradation.
You could try using the async mount option to change the behaviour of the filesystem:
async  All I/O to the filesystem should be done asynchronously.

Another approach could be to redirect the output using a named pipe. That would give you all the flexibility in the world to buffer the output in memory.


text:
Q: ASP.NET Find DropDown Value Inside Repeater Control Part II ive had a few questions on this subject, still having problems.
I want to find the values from a number of dropdown and textbox controls inside a repeater control.
db.ConnectionString = SystemConnString
    db.Open()

    Dim selectedAdTitle As String = ""
    Dim enteredAdFullName As String = ""

    cmd.Parameters.Add(New SqlParameter("@TransactionID", TransactionID))
    cmd.Parameters.Add(New SqlParameter("@AdTitle", selectedAdTitle))
    cmd.Parameters.Add(New SqlParameter("@AdFullName", enteredAdFullName))

    For i As Integer = 0 To myRepeater.Items.Count - 1

        Dim AdTitle As DropDownList = DirectCast(myRepeater.Items(i).FindControl("AdTitle"), DropDownList)
        Dim AdFullName As TextBox = DirectCast(myRepeater.Items(i).FindControl("AdFullName"), TextBox)

        selectedAdTitle = AdTitle.Text
        enteredAdFullName = AdFullName.Text

        cmd.Parameters("@AdTitle").Value = selectedAdTitle
        cmd.Parameters("@AdFullName").Value = enteredAdFullName

        SQL = ""
        SQL = SQL & "INSERT INTO InsuredPersons (TransactionID,Title,FullName) VALUES ("
        SQL = SQL & "@TransactionID,"
        SQL = SQL & "@AdTitle,"
        SQL = SQL & "@AdFullName"
        SQL = SQL & ")"

        cmd.CommandText = SQL
        cmd.Connection = db
        cmd.ExecuteNonQuery()
    Next

AdTitle and AdFullName dont seem to be bringing across the values. There is no error so they have found the control ok. Below is the ASPX file code.
<asp:Repeater ID="myRepeater" runat="server">
    <ItemTemplate>
        <asp:DropDownList ID="AdTitle" runat="server">
            <asp:ListItem Selected="True" Value="" Text=""/>
            <asp:ListItem Selected="False" Value="Miss" Text="Miss"/>
            <asp:ListItem Selected="False" Value="Ms" Text="Ms"/>
            <asp:ListItem Selected="False" Value="Mrs" Text="Mrs"/>
            <asp:ListItem Selected="False" Value="Mr" Text="Mr"/>
            <asp:ListItem Selected="False" Value="Other" Text="Other"/>
        </asp:DropDownList>

       <asp:TextBox ID="AdFullName" runat="server"></asp:TextBox>
   </ItemTemplate>

Edit:
Repeater is constructed on page load
    Dim repeatTimes((TotalAdInsured - 1)) As Integer

    myRepeater.DataSource = repeatTimes
    myRepeater.DataBind()

DirectCast is done on button click
Protected Sub continueButtonDetails_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles continueButtonDetails.Click

Answer: Had to put IsPostback around Repeater Construction.
If Not IsPostBack() Then

        Dim repeatTimes((TotalAdInsured - 1)) As Integer

        myRepeater.DataSource = repeatTimes
        myRepeater.DataBind()

    End If

A: First off I think you want:
myDropDown.SelectedItem.Text

Rather Than
myDropDown.Text

Also why do you have two ItemTemplates?  I didn't know you could even do that...
Are you interacting with any of the TextBoxes or DropDowns at any other point during the page lifecycle?
Try putting a PostBack check around the repeater databinding.  I think whats happening is your loading the controls dynamically, therefore they have no viewstate, therefore the values will always be empty.

A: Make sure your are running your code at the correct point in the page life cycle.  If you are doing it too early (for example in the OnInit) then it won't have the values from the client yet.  Try moving it to your OnCommand()/OnSubmit() event and see what happens.  Here are some references on ASP.NET Page Life Cycle:

*

*http://msdn.microsoft.com/en-us/library/ms178472.aspx

*http://www.15seconds.com/issue/020102.htm

*http://www.beansoftware.com/ASP.NET-Tutorials/Page-Life-Cycle.aspx

*Picture of asp.net page life cycle


text:
Q: want to subtract current time with event time (which has comes from my json api) in swift 5 i have an api which gives me the Event time like movie time And i want to Add a countdown Time in my apps that tells me how much time Are Left to Start a movie.

A: Your code is not displayed but I hope this will help.
// use repeating scheduledTimer(withTimeInterval:repeats:block:) method for the Timer.
// Initialize the timer and save in the property for invalidating
private let step: Double = 1.0
private var timer: Timer?

private func initTimer() {
    let action: (Timer)-> Void = { [weak self] timer in
        guard let StrongSelf = self else {
            return
        }
    }
}
timer = Timer.scheduledTimer(withTimeInterval: step, repeats: true, block: action)
private func deinitTimer() {
    timer?,invalidate()
    timer = nil
}

// To Display
func timeString(from timeInterval: TimeInterval) -> String {
    let seconds = Int(timeInterval.turncatingRemainder(dividingBy: 60))
    let minutes = Int(timeInterval.turncatingRemainder(dividingBy: 60 * 60) / 60)
    let hours = Int(timeInterval / 3600)
    return String(format: "%.value:%.value:%.value" , hours, minutes, seconds
}

// Pause & Resume
stopwatch.toggle()
//Reset
stopwatch.stop()


text:
Q: Short time limits for SDE Let $W$ be a standard one dimensional Brownian motion, and let $X$ be the solution to the SDE
$$dX_t = \sigma(X_t) \, dW_t \;, \quad  X_0 = x_0\;.$$
where $\sigma:\mathbb R \to \mathbb R$ is a Lipschitz continuous function, and $x_0 \in \mathbb R$ is a fixed constant.
For every $\varepsilon > 0$, let $A_\varepsilon$ denote the event
$$\{\underset{0 \leq t \leq \varepsilon}{\text{max}} W_t  \geq 1\} \;, $$
and let $\mathbb P^\varepsilon$ be the probability measure given by
$$\mathbb P^\varepsilon (E) = \frac{\mathbb P(E \cap A_\varepsilon)}{\mathbb P(A_\varepsilon)} \;, $$
for all events $E$.
We denote by $\mathbb E_{\mathbb P^\varepsilon}$ the expectation under $\mathbb P^\varepsilon$.
Consider the solution $Y$ to the deterministic ODE
$$dY_t = \sigma(Y_t) \, dt \; , \quad Y_0 = x_0.$$
Question: Is it true that
$$\lim_{\varepsilon \to 0} \, \mathbb E_{\mathbb P^\varepsilon} \big [\underset{0 \leq t \leq \varepsilon}{\sup} |X_t - Y_{t/\varepsilon} | \, \big] = 0?$$

A: Let $\tau = \inf\{ t>0 : W_t = 1 \}$.  The conjecture is true and the essence of the proof outlined below appears to be the following peculiar property of the hitting time $\tau$: $$
\lim_{\epsilon \searrow 0} P_{\epsilon}[\tau > \epsilon-\epsilon^{3/2}] = 1 \;. $$
(This can be computed directly using the fact that distribution of $\tau$ is inverse gamma with parameters $1/2$ and $1/2$.) In order to leverage this property, one must carefully split up $e_t:= X_t - Y_{t/\epsilon}$ as outlined below.

Theorem. It holds that:  $$\lim_{\epsilon \searrow 0}  E[ \sup_{0 \le t \le \epsilon} |e_t|^2 ] = 0 \;.$$

Proof.
The proof shows that for any $T \in [0, \epsilon]$ $$
E_{\epsilon} [ \sup_{0 \le t \le T} |e_t|^2 ] \le C_1(\epsilon) + C_2 (\epsilon) \int_0^T E_{\epsilon} [ \sup_{0 \le r \le s} |e_r|^2 ] ds
$$ where $C_1(\epsilon)$ and $C_2 (\epsilon) $ are non-negative and $\lim_{\epsilon \searrow 0}  C_1(\epsilon) =0$ and $\lim_{\epsilon \searrow 0} C_2(\epsilon) \epsilon = O(1)$.  By Grönwall's inequality,  $$
E_{\epsilon} [ \sup_{0 \le t \le \epsilon} |e_t|^2 ] \le C_1(\epsilon) \exp(C_2 (\epsilon) \epsilon) \;,
$$ and then passing to the limit gives the required result.  The remaining details follow.
By Itô's formula, \begin{align*}
& |e_t|^2 = \mathrm{I} +  \mathrm{II} +  \mathrm{III} \quad \text{where} \\
&  \mathrm{I}:= \frac{2}{\epsilon} \int_0^t e_s (\sigma(X_s) - \sigma(Y_{s/\epsilon})) ds \;, \\
&  \mathrm{II}:= \frac{2}{\epsilon} \int_0^t e_s \sigma(X_s) (\epsilon dW_s - ds) \;, \\
&  \mathrm{III}:= \int_0^t \sigma(X_s)^2 ds \;.
\end{align*}

Estimate for $\mathrm{I}$.
This term exclusively contributes to $C_2(\epsilon)$.
Since $\sigma$ is $L$-Lipschitz for some $L>0$ $$
I \le \frac{2 L}{\epsilon} \int_0^t |e_s|^2 ds
$$ and thus $$
\sup_{0 \le t \le \epsilon} I \le \frac{2 L}{\epsilon} \int_0^{\epsilon} |e_s|^2 ds \le \frac{2 L}{\epsilon} \int_0^{\epsilon} \sup_{0 \le r \le s} |e_r|^2 ds \;.
$$
Thus, $C_2(\epsilon) = 2 L / \epsilon$.

Estimate for $\mathrm{II}$.
This term contributes to $C_1(\epsilon)$, and here is where we leverage the aforementioned peculiar property of $\tau$.
\begin{align*}
& \lim_{\epsilon \searrow 0} E_{\epsilon} [ \sup_{0 \le t \le \epsilon} \left| \mathrm{II} \right| ]  =
\lim_{\epsilon \searrow 0} E_{\epsilon} [ \sup_{0 \le t \le \epsilon} \left| \mathrm{II} \right| \mathbf{1}_{ \{ \tau > \epsilon - \epsilon^{3/2} \} } ] \\
& \quad =
\lim_{\epsilon \searrow 0} E [ \sup_{0 \le t \le \epsilon} \left| 2 \int_0^t e_s \sigma(X_s) dW_s \right| ] = 0
\end{align*}
Here we took 3 steps that are explained in detail below.
In the first step, we used Cauchy-Schwarz to show that $$
\left( E_{\epsilon} \sup_{0 \le t \le \epsilon} |\mathrm{II}| \mathbf{1}_{\{\tau < \epsilon - \epsilon^{3/2} \} } \right)^2 \le \underbrace{E[\sup_{0 \le t \le \epsilon} |\mathrm{II}|^2 ]}_{\to O(1)} \, \underbrace{P_{\epsilon}[ \tau < \epsilon - \epsilon^{3/2}]}_{\to 0}
$$
In the second step, we used a natural splitting and the triangle inequality to write, \begin{align*}
& E_{\epsilon} \sup_{0 \le t \le \epsilon} |\mathrm{II}| \mathbf{1}_{\{\tau > \epsilon - \epsilon^{3/2} \} } \le \mathrm{II}_a + \mathrm{II}_b \quad \text{where} \\
& \mathrm{II}_a :=  E_{\epsilon} \sup_{0 \le t \le \epsilon}  \frac{2}{\epsilon} \left| \int_0^{t \wedge \tau} e_s \sigma(X_s) (\epsilon dW_s - ds) \right| \mathbf{1}_{\{\tau > \epsilon - \epsilon^{3/2} \} }\\
& \mathrm{II}_b :=  E_{\epsilon}  \sup_{0 \le t \le \epsilon}  \frac{2}{\epsilon} \left| \int_{t \wedge \tau}^t e_s \sigma(X_s) (\epsilon dW_s - ds) \right| \mathbf{1}_{\{\tau > \epsilon - \epsilon^{3/2} \} }
\;.
\end{align*}
To estimate these terms, there are two cases to consider:

*

*Case 1: $t \le \tau$. Then $\mathrm{II}_b=0$ and $\mathrm{II}_a$ can be written in terms of the piece of the Brownian bridge up to time $t$; and,

*Case 2: $t > \tau$.  Then $t>\epsilon - \epsilon^{3/2}$ and hence $\mathrm{II}_b=O(\epsilon^{1/2})$ and again  $\mathrm{II}_a$ can be written in terms of the piece of the Brownian bridge up to time $\tau$.

In other words, conditioned on the event $(\tau < \epsilon)$, the law of $\epsilon W_s - s$ is equal to the law of a standard Brownian bridge.
In the third and last step, we used Doob's martingale inequality, Itô isometry, and (standard) a priori bounds on $X_t$ and $Y_{t/\epsilon}$ over $(0,\epsilon)$.  Since the estimate of this term is almost identical to the estimate of $\mathrm{III}$ given below, the details are suppressed.

Estimate for $\mathrm{III}$.
This term also contributes to $C_1(\epsilon)$.  Noting that $\sigma$ is $L$-Lipschitz, \begin{align*}
E_{\epsilon} [ \sup_{0 \le t \le \epsilon} \mathrm{III} ] &= E_{\epsilon}[ \int_0^{\epsilon}  [ \sigma(X_s)^2 ds ] \\
&\le 2 \epsilon \sigma(0)^2 + 2 L^2 E_{\epsilon}[ \int_0^{\epsilon} |X_s|^2 ds ] \\
&\le 2  \epsilon ( \sigma(0)^2 + L^2 |x_0|^2 ) + 2 L^2 \epsilon \int_0^{\epsilon} \sigma(X_s)^2 ds \\
& \quad + 2 L^2 \epsilon \int_0^{\epsilon} X_s \sigma(X_s) dW_s
\end{align*}
and as long as $2 L^2 \epsilon \le 1/2$, it follows that
$$
E_{\epsilon} [ \sup_{0 \le t \le \epsilon} \mathrm{III} ] \le 4  \epsilon ( \sigma(0)^2 + L^2 |x_0|^2 ) + 4 L^2 \epsilon \int_0^{\epsilon} X_s \sigma(X_s) dW_s
$$ The last term in this expression can be treated in a similar way as the last step in the estimate for $\mathrm{II}$, namely Doob's martingale inequality, Cauchy-Schwarz, Itô isometry, and (standard) a priori bounds on $X_t$ over $(0,\epsilon)$.  In particular, \begin{align*}
\left( E_{\epsilon} [ \sup_{0 \le t \le \epsilon} \left| \int_0^t X_s \sigma(X_s) d W_s \right| ] \right)^2 &\le
E \sup_{0 \le t \le \epsilon} \left| \int_0^t X_s \sigma(X_s) dW_s \right|^2\\
&\le 4 E \left| \int_0^{\epsilon} X_s \sigma(X_s) dW_s \right|^2 \\
&\le 4 E \int_0^{\epsilon} X_s^2 \sigma(X_s)^2 ds \\
&\le 4 \tilde{C}_2 (1+ x_0^4) e^{\tilde{C}_1 \epsilon} \epsilon
\end{align*}
where in turn we used Cauchy-Schwarz, Doob's martingale inequality with $p=2$, Itô's isometry, and then an a priori bound on the second/fourth moment of $X_t$ over $(0, \epsilon)$.
$\Box$

A: No, for example, take  $dX_t = 2 dB_t$.  By the reflection principle the conditioned process is symmetric around 1, but $Y_1 = 2$.


text:
Q: json help (how get data from a specific field and use it in a webpage) I've looked for some help on the reddit site itself, but I still can't quite figure it out, so I've reposted here. I've also searched this forum but I haven't found a close enough answer and don't know enough about programming to extrapolate from what I have found.
I'm certainly not much of a programmer; this seems possible but I can't work out how to do it.
I'd like to be able to insert a link to a reddit thread on a webpage and also display the number of comments in the thread I've linked to.
I understand how to do the first part:
4eddit thread

And I know I can get info on the thread by appending .josn to the url
http://www.reddit.com/r/redditdev/comments/d570p/reddit_widget_help.json
And I know the data I need in the json output is "num-comments".
How can I come up with something that looks like this...
reddit widget help (n comments)
...where n is pulled from the .json info and is updated when the page is loaded?
Update
I've used Matthew Flaschen's example below to get it working.
In the last hour or so I've discovered that moodle (our online course management system) doesn't support JQuery but only YUI. And in any event I can't seem to get and YUI javascript examples to run in the html sections that I am able to edit (I assume this is because I'm unable to edit the  section).
As a workaround I can load this html:

 comments

in an iframe. Unfortunately it means I'll have to have a separate html file (for each iframe) for each lesson/comment thread I'd like students to discuss.
Any idea for making this a bit more elegant?

A: I made a simple proof-of-concept.  You can test it on JSFiddle. (with jQuery) (without jQuery):
Thread has  comments

Because this is cross-domain, we have to use JSONP (JSON with padding).  Basically, this means we provide a special function on our page (show_num_contents), then use a script tag.  Reddit responds with a a script that calls the function, passing in the JavaScript object.
We use addEventListener to wait until load to manipulate the DOM.


text:
Q: Can I parse PDF file for scraping? I have been trying to understand the structure of Scrapy. I just start using Scrapy with selenium for CSS-HTML. I also have to parse some PDFs to scrape and mine the data. Even though I convert pdf to HTML at some converter websites, I couldn't parse it properly.

MUAM.

Here I have "ft20" class and I supposed to mine "MUAM."

ADET

And here I have again "ft20" class in the same "DİV" or "SPAN" but I need a table with this information.
So the question is what should I use to Scrape the PDF file properly. Also, do you guys have any suggestions for converting from PDF to HTML?
I would love you to share what I missed and should know for the beginning.

A: I solve this problem with tabula library:
for file in glob.glob("*.pdf"):
    print(file)
tabula.convert_into(file, "output.csv", output_format="csv", pages='all')

this code make a CSV file from pdf


text:
Q: Uncaught SyntaxError: Unexpected token '<' in React I am getting this error - 'Uncaught SyntaxError: Unexpected token '<''. I do not know why I am getting this error. I've tried different things but still not working. Can anyone please help me with this. Please find below my demo code-
index.html-
<!DOCTYPE html>

        <meta charset="utf-8" />

Loading...

index.js
import React from 'react'
import ReactDOM from 'react-dom'
import App from './app/app'

 ReactDOM.render(<App /> , document.getElementById('root'));

App.js
import React, { Component } from 'react'

export default class App extends Component {
    render(){
        return (

I am root Component

        );
    }
}

Package.json-
"dependencies": {
    "es6-object-assign": "^1.1.0",
    "react": "^16.13.1",
    "react-app-polyfill": "^1.0.6",
    "react-dom": "^16.13.1",
    "react-redux": "^7.2.0",
    "react-router": "^5.1.2",
    "react-scripts": "^3.4.1",
    "react-thunk": "^1.0.0"
  },
 "devDependencies": {
    "babel-cli": "^6.26.0",
    "babel-plugin-transform-react-jsx": "^6.24.1",
    "babel-preset-env": "^1.7.0",
    "babel-preset-react": "^6.24.1"
  }
"scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build"
  },

Am I doing something wrong?
Thanks in Advance!!!


text:
Q: Google Cloud Messaging displays special characters wrong I have a Google Cloud Function (GCF) that sends a Push Notification via Google Cloud Messaging (GCM). The title and body of the notification contain special characters (ä, ö, ü). The problem is that the notification fails to display these special characters correctly on the smartphone. Instead, it shows '??'. My first guess was that the charset of the JVM of the GCF was wrong but I checked that with Charset.defaultCharset() and System.getProperty("file.enconding"). Both return UTF-8. But nevertheless, even log messages are showing '??' instead of the special characters. Is the GCF environment using another charset that the default one?
Anybody has an idea how to find that out? Or how to solve it?
EDIT: Running the function locally on my machine has no problems displaying special characters.

A: The solution was to set the build environment variables as flag with the deploy command:
$ gcloud functions deploy my-function ... --set-build-env-vars=JAVA_TOOL_OPTIONS=-Dfile.encoding="UTF-8"

I still don't understand why this is necessary if the default charset is also UTF-8 without that command flag.


text:
Q: Appending non-DataFrame to pandas csv I'm trying to find out if there is an easier way to append a Date column and an additional info column to my existing csv file. I'm adding these columns because this information is not in the JSON string from the REST API call.
import requests
import json
import http.client
import datetime
import pandas as pd
from pandas.io.json import json_normalize

url = api.getinfo()
r = requests.get(url, headers=headers, verify=False)
if r.status_code != http.client.OK:
    raise requests.HTTPError(r)

jsonstring = json.dumps(r.json()["data"])
load = json.loads(jsonstring)
df = json_normalize(load)
col = ["poolId", "totalPoolCapacity", "totalLocatedCapacity",
       "availableVolumeCapacity", "usedCapacityRate"]
with open('hss.csv', 'a') as f:
    df.to_csv(f, header=False, columns=col)

a = pd.read_csv('hss.csv')
a['date'] = [datetime.date.today()] * len(a)
a.to_csv('hss.csv')
b = pd.read_csv('hss.csv')
b['storage system'] = "ssystem22"
b.to_csv('hss.csv')

I end up getting extra columns Unnamed: 0,Unnamed: 0.1 in my csv file each time the script is run. Also each time I append it overwrites the old dates.
,Unnamed: 0,Unnamed: 0.1,poolId,totalPoolCapacity, totalLocatedCapacity,availableVolumeCapacity,usedCapacityRate,date,storage system
0,155472,223618,565064,51,,2017-04-12,ssystem22
1,943174,819098,262042,58,,2017-04-12,ssystem22
0,764600,966017,046668,71,,2017-04-12,ssystem22
1,764600,335680,487650,76,,2017-04-12,ssystem22
2,373700,459800,304446,67,,2017-04-12,ssystem22

A: I kept researching and found how to fix this. I should have been using the pd.Series function. Below is the corrected code:
import requests
import json
import http.client
import datetime
import pandas as pd
from pandas.io.json import json_normalize

url = api.getinfo()
r = requests.get(url, headers=headers, verify=False)
if r.status_code != http.client.OK:
    raise requests.HTTPError(r)

jsonstring = json.dumps(r.json()["data"])
load = json.loads(jsonstring)
df = json_normalize(load)
df['storage system'] = pd.Series('ssystem22', index=df.index)
df['date'] = pd.Series(datetime.date.today().strftime('%m-%d-%Y'),
                       index=df.index)
col = ["poolId", "totalPoolCapacity", "totalLocatedCapacity",
       "availableVolumeCapacity", "usedCapacityRate", "storage system",
       "date"]
with open(csvfile, 'a') as f:
    df.to_csv(f, header=False, columns=col)


text:
Q: Very simple number line with points First time using LaTeX. I read some questions on here but I am still confused.
All I want to do is to draw a simple number line between -3 and 3, and plot some points, say 0.5, 0.7, and 0.9.
How do I do that?

A: Do you mean something like
\documentclass[border=2pt]{standalone}
\usepackage{pgfplots}
\begin{document}
    \begin{tikzpicture}
        \begin{axis}[
            % center the x axis
            axis x line=middle,
            % we don't need a y axis line ...
            axis y line=none,
            % ... and thus there is no need for much `height' of the axis
            height=50pt,
            % but `height' also changes `width' which is restored here
            width=\axisdefaultwidth,
            xmin=-3,
            xmax=3,
        ]
            \addplot coordinates {
                (0.5,0) (0.7,0) (0.9,0)
            };
        \end{axis}
    \end{tikzpicture}
\end{document}

A: A pure tikz alternative:

\documentclass[tikz,border=3mm]{standalone}
\begin{document}
  \begin{tikzpicture}
    \draw (-3,0) -- (3,0);
    \foreach \i in {-3,-2,...,3} % numbers on line
      \draw (\i,0.1) -- + (0,-0.2) node[below] {$\i$}; % tick and their labels
    \foreach \i in {0.5, 0.7, 0.9}% points on line
      \fill[red] (\i,0) circle (0.6 mm);
  \end{tikzpicture}
\end{document}

A: Here's an adaption of one I made earlier. The code is designed to support various options so not all of it is necessarily to draw the simple line in this case. Additional options have, in fact, been added to turn some of those features off.
This makes the preamble a bit complex, though potentially useful if you like that kind of thing. However, the code for the actual numberline is not especially complex.
\NumberLine*[
  dot=blue,% colour of dots marking points on the line
  dot opacity=.75,% opacity of dots
  fraction=1,% we're only marking whole numbers
  ticks above=false,% we only want standard axis marks below
  min=-3,% start from here - max is 3 by default
  number to=none,% we don't want to visualise a number as drawn along a fraction of the line
  h scale=3,% scale the line a bit as the marks are too close otherwise
  mark at={0.5,0.7,0.9},% points we want to mark on the line
]

\documentclass[tikz,border=10pt,multi]{standalone}
\usepackage{xparse}
\makeatletter
\newif\ifnl@mixednumbers
\newif\ifnl@ticksabove
\newif\ifnl@isnumberto
\tikzset{% http://tex.stackexchange.com/a/159856/ - Claudio Fiandrino
  number line/.code={
    \tikzset{
      /number line/.cd,%
      #1
    }
  },
  /number line/.cd,
  dot/.store in=\nl@dot,
  dot opacity/.store in=\nl@dotopacity,
  fill/.store in=\nl@fill,
  fraction/.store in=\nl@fraction,
  h scale/.store in=\nl@hscale,
  line height/.store in=\nl@lineht,
  line above/.store in=\nl@lineabove,
  line below/.store in=\nl@linebelow,
  mark at/.store in=\nl@markat,
  max/.store in=\nl@max,
  min/.store in=\nl@min,
  mixed numbers/.is if=nl@mixednumbers,
  mixed numbers/.default=true,
  number to/.store in=\nl@numberto,
  number from/.store in=\nl@numberfrom,
  ticks above/.is if=nl@ticksabove,
  ticks above/.default=true,
  v scale/.store in=\nl@vscale,
  fraction=4,
  v scale=1.2,
  h scale=4,
  max=3,
  min=0,
  number to={7/4},
  number from=0,
  mixed numbers=false,
  fill=orange,
  dot=green,
  dot opacity=.75,
  ticks above,
  mark at=,
  line height=0.2,
  line above=0.2,
  line below=0.2,
}
\newcommand*\tnl{% modified from ref: WeCanLearnAnything at http://tex.stackexchange.com/questions/267921/macro-for-mixed-numbers-on-number-line-tikz (but I doubt this is the original source)
  \begin{scope}[xscale=\nl@hscale,yscale=\nl@vscale]
    \edef\tempa{none}%
    \edef\tempb{\nl@numberto}%
    \ifx\tempa\tempb
      \nl@isnumbertofalse
    \else\nl@isnumbertotrue
      \filldraw[\nl@fill] (\nl@numberfrom,0) rectangle (\nl@numberto,\nl@lineht);% shaded portion of number line
    \fi
    \draw
    (\nl@min,0)--(\nl@max,0)% lower part of x-axis
    (\nl@min,\nl@lineht)--(\nl@max,\nl@lineht);% higher part of x-axis
    \foreach \x in {\nl@min,...,\nl@max}
      \node [anchor=mid] at (\x,-0.5) {\x};% whole numbers underneath number line
    \pgfmathsetmacro\nl@maxfrac{int(\nl@max*\nl@fraction)}
    \pgfmathsetmacro\nl@minfrac{int(\nl@min*\nl@fraction)}
    \foreach \x in {\nl@minfrac,...,\nl@maxfrac}% fractional tick marks and numbers above number line
    {%
      \draw (\x/\nl@fraction,-\nl@linebelow)--(\x/\nl@fraction,\nl@lineht);
      \ifnl@ticksabove
        \node[above] at (\x/\nl@fraction,{\nl@lineht+0.05}) {$\frac{\x}{\nl@fraction}$}; % draw tick and mark fraction above line
      \fi
      \ifnl@mixednumbers
        \pgfmathsetmacro\intbit{int(\x/\nl@fraction)}% integer bit
        \pgfmathsetmacro\fracbit{int(\x-\nl@fraction*\intbit)}% proper fraction bit
        \ifnum\intbit=0\let\intbit\relax\fi % don't print 0 in mixed numbers
        \ifnum\fracbit=0\else
          \node [anchor=mid] at (\x/\nl@fraction,{-\nl@linebelow-0.3}) {$\intbit\frac{\fracbit}{\nl@fraction}$}; % mark the mixed number below the line
        \fi
      \fi
    }%
    \ifnl@isnumberto
      \fill[\nl@dot,opacity=\nl@dotopacity] (\nl@numberto,.5*\nl@lineht) circle[x radius=\nl@lineht cm/\nl@hscale,y radius=\nl@lineht cm/\nl@vscale];% dot
    \fi
    \foreach \i in \nl@markat
    {%
      \draw (\i,0) -- (\i,{\nl@lineht+\nl@lineabove}) node [above] {\i};% draw tick to node above line to mark point specified with mark at
      \fill[\nl@dot,opacity=\nl@dotopacity] (\i,.5*\nl@lineht) circle[x radius=\nl@lineht cm/\nl@hscale,y radius=\nl@lineht cm/\nl@vscale];% dot
    };
  \end{scope}}
\NewDocumentCommand \NumberLine { s O {} }{%
  \IfBooleanTF {#1}{%
    \tikz[number line={mixed numbers=false,#2}]\tnl;%
  }{%
    \tikz[number line={mixed numbers=true,#2}]\tnl;%
  }}
\makeatother

\begin{document}

\NumberLine*[
  dot=blue,
  dot opacity=.75,
  fill=blue,
  fraction=1,
  ticks above=false,
  min=-3,
  number to=none,
  h scale=3,
  mark at={0.5,0.7,0.9},
]

\end{document}

A: With a simple picture environment without TikZ:
\documentclass{article}
\usepackage{color}
\begin{document}

\setlength{\unitlength}{1cm}
\makeatletter
%\fboxsep=.1pt \fbox{% debug for bounding box
\begin{picture}(6.3,.55)(-3.21,-.45)
  \put(-3, 0){\line(1, 0){6}}
  \multiput(-3, -.1)(1, 0){7}{\line(0, 1){.2}}
  \@for\x:=-3,-2,-1,0,1,2,3\do{%
    \put(\x, -.2){\makebox(0, 0)[t]{$\x$}}%
  }%
  \color{red}%
  \@for\x:=.5,.7,.9\do{%
    \put(\x, 0){\circle*{.1}}%
  }%
\end{picture}%
% }% end of \fbox
\makeatother

\end{document}

A: A PSTricks solution.
Same colored dots
\documentclass{article}

\usepackage{pstricks}
\usepackage{multido}

\def\Dot(#1){\psdot[dotstyle = o, fillcolor = blue](!#1 0)}

\begin{document}

\begin{pspicture}(-3.2,-0.4)(3.05,0.1) % boundry found manually
  \psline{->}(-3,0)(3,0)
  \multido{\i = -3+1}{7}{%
    \psline(\i,-0.1)(\i,0.1)
    \uput[270](\i,-0.1){$\i$}}
  \Dot(0.5)
  \Dot(0.7)
  \Dot(0.9)
\end{pspicture}

\end{document}

Note that if the points are equidistantly distributed on the line, you can use the \multido macro to generalise the code.
Different colored dots
\documentclass{article}

\usepackage{pstricks}
\usepackage{multido}

\def\Dot[#1](#2){\psdot[dotstyle = o, fillcolor = #1](!#2 0)}

\begin{document}

\begin{pspicture}(-3.2,-0.4)(3.05,0.1) % boundry found manually
  \psline{->}(-3,0)(3,0)
  \multido{\i = -3+1}{7}{%
    \psline(\i,-0.1)(\i,0.1)
    \uput[270](\i,-0.1){$\i$}}
  \Dot[blue](0.5)
  \Dot[yellow](0.7)
  \Dot[red](0.9)
\end{pspicture}

\end{document}

A: Another example with PSTricks. Irrational numbers are the features of my answer!
\documentclass[pstricks,margin=10mm,preview]{standalone}
\usepackage{pst-plot}

\newcommand{\xpoint}[2][white]{%
    \pscircle[fillstyle=solid,fillcolor=#1](!#2 0){3pt}}

\begin{document}
\begin{pspicture}(-4,0)(5,0)
    \psaxes[xAxis=true](0,0)(-4,0)(5,0)
    \xpoint{2 sqrt} % the square root of 2
    \xpoint[red]{4 sqrt}% the square root of 4
\end{pspicture}
\end{document}


text:
Q: Run animation sequentially for infinite time How do I define a set of animations without using the <set> tag? I read somewhere on this forum that the set tag has a buggy implementation and will not run with repeatCount="infinite".

A: You could override onAnimationStart and onAnimationEnd, if you you extend View, to trigger starting the new animation when the old animation has finished.


text:
Q: What is the best way to trim a dictionary after sorting? I want to reduce the number of items in a dictionary. So I need to trim dictionary after sorting by value. My question is how?
So I to trim this dict so only the top TWO entries are retained—
base_dic={'Cs':0,5, 'Cp':0.3, 'Os':0.6, 'Op': 0.9}

I've tried—
dict(sorted(base.items(), key=lambda x: x[1], reverse=True)[:2])

But is this the best way? And to display or compare the values in dictionary, is there smart way to ordering by value? Note that it is not just sorting of values, it is sorting of dictionary using values.
I want to have only a few elements with maximum values. That is, from
base={'Cs':0,5, 'Cp':0.3, 'Os':0.6, 'Op': 0.9, .... 100 elements}

to such as
base={'Op': 0.99, 'Nid': 0.97}

Effectively retaining only the top TWO elements and discarding the rest.

A: The way you suggest is certainly pythonic.  The only issue I can see is that you need just the two biggest elements, but still have to sort all tuples in the dict: this could be done more efficiently with heapq.nlargest
values = dict(heapq.nlargest(2, mydict.items(), lambda i: i[1]))

A: Yes, this is more or less the most obvious way to do it. You could aim to get rid of the lambda for a cleaner solution using base_dic.get.
keys = sorted(base_dic.keys(), key=base_dic.get, reverse=True)[:2]
trim_dict = {k : base_dic[k] for k in keys}


text:
Q: Как обратиться к документу во фрейме? Как в js обратиться к дочернему документу, который находится во встроенном фрейме (элемент iframe)?
A: Обращение к document:
document.getElementsByTagName('iframe')[0].contentDocument

Обращение к window:
document.getElementsByTagName('iframe')[0].contentWindow

Учтите, что страницы должны быть на одном домене, порту, и схеме ( протоколе )!


text:
Q: Object not found using Xampp i am facing error by using Xampp server
error is:
Error 404
localhost
Apache/2.4.41 (Win64) OpenSSL/1.0.2s PHP/7.1.33

my all files are locate in htdocs
  file
index.php opened successfully but when i can move from another page school.php, contact.php, about.php its give me error
kindle tell me reason behind it

A: XAMPP sets a default as Program Files/Xampp/Htdocs/xampp

YOU ARE ALREADY IN HTDOCS…

try doing ahref=…/ in your directory…see if that works, if not…

try editing your xampp.conf file.

it is located in your xampp/apache folder
mine is (C:/Program Files/Xampp/Apache/conf/extra/xampp.conf)
(it might actually be xampp.htconf or something, but you'll see it…its the only one with the xampp)…

copy the PhpMyAdmin section, and paste it below.

change the /phpmyadmin to /htdocs or whatever you want to beshown after http://localhost 633.

Then you'll need to set up the doc root as well, this just tells apache where to serve the file from…

DONT SET UP as HTDOCS though because apache will go in a huge loop and consume all your CPU…i know i've tried.

anyway, i have a couple set up…

my document root is soemthing like:

c:/program files/xampp/htdocs/production/kreative

so you will see my main site,
but i have also set up
/phpmyadmin
/xampp
/development(which goes to c:/program files/xampp/htdocs/xampp/development).

Its nice if you add an .htacessfile to those directories you want to use
(like for me the phpmyadmin etc…don't want my visitors using those).

Hope this helps.


text:
Q: How can I make 2 cells inside a CSS display: table-row occupy 50% of the row? I have the following HTML:
<!DOCTYPE html>

    <title></title>

                I want this to fill almost 45% of the width of the screen

                I want this to fill almost 45% of the width of the screen

I tried this code above but it seems like the DIVs inside the table-row don't expand in width. If possible I would like solution within the div with id of abc as I cannot change the style of the div def

A: utilize float property

                I want this to fill almost 45% of the width of the screen

                I want this to fill almost 45% of the width of the screen

A: Quite easy, if you want to make a table-like structure, use display: table-cell; on the divs:

            I want this to fill almost 45% of the width of the screen

            I want this to fill almost 45% of the width of the screen

You can also use float: left;, but since it's already a table in display, you might as well go on that way.
Edit: To be complete, I added a display: table; to the #def div.
You can see a fiddle of this. And as others have said as well, it is always better to separate the CSS from the HTML, as I've done in the fiddle.

A: You can do following to get desired result
FIDDLE DEMO
CSS
.container {
    margin-bottom: 4rem;
    margin-left: auto;
    margin-right: auto;
    margin-top: 7.25rem;
    width: 90%;
    border:2px solid;
    background:yellow;
}
.subcontainer {
    display: table-row;
    width: 100%;
}
.first {
    width: 50%;
    height: 20px;
    background-color: green;
    float:left;/***Use This***/

}
.second {
    width: 50%;
    height: 20px;
    background-color: red;
    float:right;/***Use This***/
}

Or you can use table-cell
FIDDLE DEMO
.first {
    width: 50%;
    height: 20px;
    background-color: green;
    display:table-cell;/***Use This***/

}
.second {
    width: 50%;
    height: 20px;
    background-color: red;
    display:table-cell;/***Use This***/
}

EDIT: It is always better to write CSS separately

A: You need display: table-cell; on your divs that are inside table-row.
like so:

                I want this to fill almost 45% of the width of the screen

                I want this to fill almost 45% of the width of the screen

JSFiddle
Floating works too (better for when you are supporting old IEs) but display: table-cell; is more in line with what you are doing.


text:
Q: How can I create a function that calls another function and passes in an instance attribute as an argument? I am fairly new to coding and am getting really confused with how to call one function from another. I am trying to pass in an instance attribute as an argument but keep getting a name error for 'getVal'. Is this an issue with the 'getVal' function or the argument I am trying to pass? 'self.Volume' is a list of numbers and 'self.num' is a list of binary numbers.
def getVal(self, solution):
    return [self.volume[i] for i in range(10) if solution[i]]

def fitness(self):
    print(getVal(self.num))

A: since getVal() and fitness() are class-functions, you need to call them with self.:
def fitness(self):
    print(self.getVal(self.num))

A: If this is within a class, then you have to refer to the method via self.getVal(). In Python, the instance is passed in as the first argument if you call its method, which is named self by convention. So to call the method, you have to either do ClassName.getVal(self, self.num) or self.getVal(self.num).

A: Close. You need to make sure you put self. before your calls to a class function. and no need to pass self.num into getVal you can just call it from inside getVal
def getVal(self):
    return [self.volume[i] for i in range(10) if self.num[i]]

def fitness(self):
    print(self.getVal())


text:
Q: Connecting a Multi User Access Front End to SQL Server Back End Thank you for your help as always!
I have built an Access database that we intend to distribute to ~100 end users.  I am currently running a pilot program for 5 users.  I have migrated the tables to SQL 2014 Server but currently the back end of the pilot program is in a shared network folder (location unknown to them).  I distributed the Access front end (accde file type) by saving the file on that shared Network and instructing the end users to save a copy to their desktop.  The pilot is working fine, if not a little slow.
The issue that I am having is this:
I am able to set up an ODBC Connection on my machine and am able to connect to the SQL Server backend through that  connection.  However, I am not sure how to get my end users Access to the tables on the server.  Do I need to create a user name for each user on the server and give them read and write access?  Do I also need to create an ODBC connection on each machine that we plan to install the Front End on?  I would prefer to not have to create an ODBC connection on each machine, is it possible to work around this?  Thank you!
Access Version: 2013
SQL: 2014
Working on SSMS 2014
-Charlie

A: A few things:
When you create a linked table, simply use the ribbon import and link – and then ODBC database. Just choose a file DSN. The reason for this is that access by DEFAULT will use a DSN-less connection. In simple terms, this means when you link the tables, then you can distribute your applcatation to each workstation and there no need to setup a SYSTEM/Machine DSN.
So just keep in mind that use the default file DSN – once Access creates the link to SQL server, then such links are DSN-less, and you don't need any setup on each workstation.
As for creating users on SQL server? Well, you likely don't need to unless you want some kind of special security for each user. If you using SQL logon, then MAKE sure that during the above linking process you "check" the save password option. Once again, since by default the linked tables are DSN-less, then every user will in fact be using the one and same SQL User/password and thus this will be transparent to each user (they will not have to log on).
If you using windows authentication for SQL logons, then security is setup with the windows system and not SQL server. In this case then each users windows logon will be used to control (permit) use of the SQL server. If you not using a domain controller, then you be using SQL logons, and likely just the one logon that you are using will suffice. Often even in a corporate environment because I don't want to call up the IT admin folks for each logon and permissions to SQL server, then I still OFTEN choose SQL logons. Thus "once" the IT admin folks give me enough rights to the SQL server, then I am free to create my own logons, or just use the "one same" logon for everyone and thus don't have to waste time bothering the IT folks.
A few additional final points:
Ignore suggesting to use all kinds of ADO and VBA code and connection strings etc. – they are not required. In fact in most cases you want to AVOID ADO code in your application. And oleDB is being depreciated for SQL server (which ADO tends to rely on).
You STILL as a matter of good deployment want to place the front end program you have on each workstation. Just like you install word on each workstation, or your accounting packages, now that YOU ARE developing software, then you install your software on each workstation like the IT industry done for the last 30 years. You can certainly share data on a shared folder, but you install the actual application (word, Excel, or in this case YOUR applcatation on EACH workstation. And you should compile the accDB to an accDE before any deployment.
So you don't really need any special code on start up to "connect" or "link" to SQL server if your deployment to such users is on your same network. If you are developer or consultant "offsite", then you likely need to add some code on start up to re-link to THEIR sql server that no doubt would be different than the one your developing with offsite. So some ability to re-link to a "different" SQL server then the one your are developing with would be required if you not able to develop on site, or that the SQL server you working with is a "copy" or "test" version of the Actual production SQL server being used.

A: You do not need an ODBC connection on every machine. You can create the connection by using ODBC connection strings via DoCmd.TransferDatabase. This is persistent, so you can just execute the connection/updates on your development copy of the front end and the connection will exist and persist in any end user copies of that that you make.
You do have to deal with the authentication issue. Depending on your security situation you can create a single "database user" and include the username and password to the above connection. If you are in a AD environment you can use that for authentication. Or you create individual SQL accounts for each user or user group. No matter what you do the users will be able to see and edit the tables if Access is to have read/write permission to them. You can secure individual tables by using views to link them to Access instead of the tables themselves.
I would advise against having users make a local copy of the front end. That makes it a nightmare to make sure your users are using the latest version of your front end. Encourage them to make a shortcut instead. Unless you have per-user local temp tables or code that dynamically edits forms/reports there is not much reason not to have everybody using the same front end file. Even in that case create a deployment batch file that creates/overwrites the front end copy for each user.
Sample code that links to SQL server database:
Public Sub LoadDatabase()

Dim MyDB As DAO.Database
Set MyDB = CurrentDb
Dim d As DAO.Recordset
Set d = MyDB.OpenRecordset("SELECT TableName FROM tblLinkTables")
d.MoveFirst
Do While Not d.EOF
    DoCmd.DeleteObject acTable, d!TableName
    DoCmd.TransferDatabase acLink, "ODBC Database", "ODBC;Driver={SQL Server};Server=MYSQLSERVERNAME;Database=MyDatabaseName;Uid=DatabaseUser;Pwd=DatabaseUserPassword", acTable, d!TableName, d!TableName, False, True
    d.MoveNext
  Loop
d.Close
Set d = Nothing

End Sub

where the list of tables to link exists on a local table called tblLinkTables with a single field TableName for each table to be linked. This is a very simplified version. The one I actually use has the capability to have different local table names than the SQL tables and also link views and create primary keys (optionally) for them.

A: The following is one example of how you can obtain a connection to SQL Server. It supports using either a Trusted Connection (where the windows user is authorized access, or you can specify a sqlserver defined userid and password.
' The following are some of the parameters the connection will use.
Global gv_DBS_SQLServer                 As ADODB.Connection
Global gvstr_SQLServer_Name             As String
Global gv_SQLServer_DSN                 As String
Global gvstr_SQLServer_Database         As String

'Call the GetConnection Function
' Pass Name of Server; Database Name; Connection Variable; adUseServer; True if using Password; False if not using a Trusted Connection;
' Sample
    If GetConnection(gvstr_SQLServer_Name, gvstr_SQLServer_Database, _
            gv_DBS_SQLServer, adUseServer, True, False) = False Then
        MsgBox "Unable to connect to SQL Server", vbOKOnly, "No Connection"
    End If

Public Function GetConnection(ByVal strDSN As String, _
        ByVal strDatabase As String, _
        ByRef cnLocal As ADODB.Connection, _
        ByVal CursorLoc As CursorLocationEnum, _
        ByVal UsePassword As Boolean, _
        ByVal blnTrusted As Boolean) As Boolean

Dim strConnectString    As String
Dim strDisplay          As String

    On Error GoTo ERROR_HANDLER
    GetConnection = False
Retry_Connection:
    If cnLocal Is Nothing Then Set cnLocal = New ADODB.Connection
    If cnLocal.State = adStateOpen Then
        Debug.Print "Connection already open -- -will not reopen!!"
        GetConnection = True
        GoTo Proc_Exit
    End If
    With cnLocal
        Debug.Print "Use TRUSTED CONNECTION (ABOVE)"
        If blnTrusted = True Then
            strConnectString = "Driver={SQL Server};" & _
                               "Server=" & strDSN & ";" & _
                               "Database=" & strDatabase & ";" & _
                               "Trusted_Connection=yes"
        Else
            strConnectString = "Driver={SQL Server};" & _
                               "Server=" & strDSN & ";" & _
                               "Database=" & strDatabase & ";" & _
                               "User Id=UUUUUUU;Password=" & DecryptString("PPPPPPPP") & ""

            strDisplay = "Driver={SQL Server};" & _
                         "Server=" & strDSN & ";" & _
                         "Database=" & strDatabase & ";" & _
                         "User Id=UUUUUU;Password=PPPPPPP"

        End If

         Debug.Print "Will use Conn String: " & strDisplay
        .ConnectionString = strConnectString
        .CursorLocation = CursorLoc
        .Open
    End With
    GetConnection = True
Proc_Exit:
    Exit Function
ERROR_HANDLER:
    Debug.Print Err.Number & vbCrLf & Err.Description
    Err.Source = "Module_Connect: "
    DocAndShowError
    Resume Proc_Exit
    Resume Next
    Resume
End Function


text:
Q: How to find the latest binlog of MariaDB by shell script? I want to find the latest mysql binary log in /var/log/mysql/, but I found the name of binlog is mariadb-bin.0000*, and we also have mysql-bin.index, so it's really hard for me to use shell script to distinguish them. My idea is finding binlogs by their file type, which is "Mysql replication log", then sort them by modification time, but I don't know how to do it.
Can anyone help me with that?

A: ls -1t /var/log/mysql/mariadb-bin.* will return you the list of files sorted, most recent first. That might be mariadb-bin.index.
If you want the last binlog only, you can combine it with grep -v (wich will exclude what you grep) and head.
ls -1t /var/log/mysql/mariadb-bin.* | grep -v "mariadb-bin.index" | head -n 1


text:
Q: How to temporarily blacklist nvidia driver at boot time I would like to disable the Nvidia driver at boot time in Grub, on specific grub entries.
I noticed that adding module.blacklist=nvidia was the way to go. (source)
I rebooted my system, edited the GRUB command line with e, and at the end of the linux, I appended:
... module.blacklist=nvidia

However, the nvidia driver is still loaded:
$ lsmod | grep nvidia
nvidia_uvm           1007616  0
nvidia_drm             49152  10
nvidia_modeset       1183744  14 nvidia_drm
nvidia              19722240  616 nvidia_uvm,nvidia_modeset
drm_kms_helper        184320  2 nvidia_drm,i915
drm                   491520  14 drm_kms_helper,nvidia_drm,i915
i2c_nvidia_gpu         16384  0

➡ Am I using the wrong syntax ?
➡ Is there something I am missing during the boot ?
In the meantime, I'm switching the driver using the additional driver tool before I reboot:
additional_driver_picture
Running Ubuntu 20.04

A: The correct syntax is
module_blacklist=nvidia .

Note the underscore instead of the dot.


text:
Q: Android - Lightweight Gradients From Android's Developer Reference:
LinearGradient(float x0, float y0, float x1, float y1, int[] colors, float[] positions, Shader.TileMode tile)

So I'm wondering if there's a way to draw a gradient in the onDraw() method?
The problem here being that I need to enter the coordinates for whatever I'm about draw the gradient on. What if I need the same gradient on multiple shapes of different sizes and positions? Even more important, what if the shape I'm drawing the gradient on, changes it's position? Even Android Studio advises you to not do initialization of variables inside the onDraw() method.
Thanks!

A: What I was able to do, is create a drawable with a gradient in an .xml file.
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <shape>
            <gradient
                android:startColor="@android:color/holo_blue_light"
                android:endColor="@android:color/holo_red_dark"
                android:angle="45"/>
        </shape>
    </item>
</selector>

Then in your onDraw() do (obviously inside an init function, because you will only need to initialize once, at least I did):
Drawable d = ContextCompat.getDrawable(context, R.drawable.indicator_active);

And to draw it, just do
d.setBounds(l, t, r, b);
d.draw(canvas);

If anyone knows of an easier/more flexible way, let me know!


text:
Q: Convert UTC Time to local Time using time zone info from database I have timezone information for a particular record from database as for example -6 which means UTC-6.
How can I use this -6 to convert my UTC time to UTC-6?
I think I have to use TimeZoneInfo in c#.
Timezone information is not the same for all records.

A: You could use DateTimeOffset to create a date with the offset.
var dbDate = myRawDbDate.Kind == DateTimeKind.Unknown ? DateTime.SpecifyKind(myRawDbDate, DateTimeKind.Utc): myRawDbDate;
var localDdate = new DateTimeOffset(dbDate, new TimeSpan(0,6,0)).DateTime;

A: Hi You can use TimeZoneInfo Class.
 var timeZone = TimeZoneInfo.FindSystemTimeZoneById("Central Standard Time"); //UTC-6
 var UTC6date = TimeZoneInfo.ConvertTimeFromUtc(Yourdate.ToUniversalTime(), timeZone);

for more information here is the link. MSDN : https://msdn.microsoft.com/en-us/library/bb382835(v=vs.110).aspx
to view all the time zone for UTC-6:00 etc.
Use TimeZoneInfo.GetSystemTimeZones() method.
Sample code :
var timeZonList = TimeZoneInfo.GetSystemTimeZones();

    foreach (var item in timeZonList)
    {
        Console.WriteLine(item);
    }

TimeZoneInfo.ConvertTimeFromUtc(date converted to universal time, "Timezone to convert your date").

Hope this helps.


text:
Q: TCP DF packets get block though in IPTABLES the required port is allowed by rule The rule is added to accept on Port 10000 as:
iptables -I INPUT 5 -i eth0  -p tcp --dport 10000 -j ACCEPT
But the packet to 10000 port is blocked by ipatables with this log:
packet-droppedIN=eth0 OUT= MAC=<00:00:00:00:aa:59:00:90:30:00:00:00:00:00> SRC=10.78.34.175 DST=10.78.34.171 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=58229 DF PROTO=TCP SPT=50694 DPT=10000 WINDOW=5840 RES=0x00 SYN URGP=0
Any idea?
Please dont close this question as irrelevant to programming.

A: Check Port 10000 is listening on server:

netstat -an |grep "10000"

Then check your src ip in server firewall as:

iptables -nL |grep yourIP

if you have installed any other firewall check in that too.


text:
Q: Grant Access to Site/ Site Collection Usage Reports I need to grant access to users from my Communications department to the Site and Site Collection Usage Reports on SharePoint 2007.
I read this article:
Manage permissions for usage reporting
But do not want to give Full Control Access to them... Any ideas? Workaround?

A: Got it! In 2007 onwards there is a special permission: View Usage Data  -  View reports on Web site usage.
Create a new Permission Level with this and you are good to go!


text:
Q: What is the known performance difference between a Microsoft.VisualBasic.Collection and a .NET System.Collections.Generic.Dictionary(Of TKey, TValue)? I'm working on a fairly large project for a trading company in Philadelphia. The company utilizes automated trading algorithms which process streaming quotes and send out quotes for hundreds of products dozens of times per second. Obviously, performance is a significant concern. (Which makes me question why we're using VB.NET, but that's another topic entirely.)
I'm relatively new to the company and am working with another guy on some code that's been around for a while. This code utilizes a Microsoft.VisualBasic.Collection object to store all of the products (objects representing pairs of ETFs or stocks and a large amount of data about each) and does a LOT of searching/retrieving from that Collection.
As I understand it, the Collection class is deprecated and pretty much no one uses it anymore. In our more recent code we've been using .NET collections such as List(Of T) and Dictionary(Of TKey, TValue) and from what I understand it might make sense to replace the old Collection with a Dictionary. However, as the source code is quite substantial, going ahead with this replacement would be a significant undertaking; and so my question is just this:
Has anyone actually measured the performance difference between the old Collection and a .NET Dictionary? Is such a comparison, for whatever reason, inappropriate? It certainly seems that everything we are currently doing with the Collection we could do with a Dictionary; basically I just want to know if it makes sense for us to go through the code and make this transition, or if doing so would essentially be a waste.
EDIT: Originally in the question I referred to the current Collection we are using as a VB6 Collection. After reading the first two answers I realize it is more accurately a Microsoft.VisualBasic.Collection, which appears to be a class introduced for compatibility between VB6 and VB.NET. I think the question still holds.
Based on the first link provided in Kenneth Cochran's answer, I am led to believe that a Dictionary would indeed be better suited to our purposes than a Collection as it performs better at retrieving items by key and running "For Each" loops by several milliseconds for 10,000 runs. At our company, this is a realistic scenario; there are lots of places in the code with statements like the following:
Dim ETF as ETFdetails = ETFcoll(sym)

And as I said, these lines execute on hundreds of products, many times per second. With this in mind I am inclined to think we really should go ahead and make the change, then measure any performance difference. I expect that we will see at least a mild but noticeable improvement.
Is there anything obviously wrong with what I've just said? If so, point it out!

A: If you are using VB.NET you are not using VB6 collections. The VB.NET collection is functionally equivalent to the VB6 collection but they are not the same. http://www.vbmigration.com/Blog/post/2008/11/Speed-up-your-VBNET-collections.aspx has a comparison of the various .NET collection types with the VB6 collection, including the VB.NET collection. Each collection type has its strong points and weak points (why else would we have so many collection types to choose from). Some are faster and insertion at the expense of searching and vice versa. Some are faster with small collections while other are faster with large collections. Your choice should depend on which performance attribute is most important to you.
Here is a table I stumbled across that gives relative performance of the standard .NET collection types. Notice VB.NET collection is not included:
http://www.artima.com/forums/flat.jsp?forum=152&thread=179998

A: There's nothing wrong with VB.Net performance.  It compiles to the same IL that C# does, which is in turn JIT-compiled to machine language.  That's why it's called the .Net Framework rather than the .Net VM.
While I haven't seen a head-to-head comparison of the VB6 Collection vs VB.Net Dictionary, I would expect them to be similar since the underlying algorithm is essentially a hashtable either way.  That said, if there is going to be a small difference I'm inclined to give the advantage to the Dictionary, because there's no casting/late binding involved.  The system will spend less time worrying about checking or translating types.
Of course, this assumes you're using VB.Net in a strongly-typed way, with Option Strict and Option Explcit turned on.

A: Apart from performance, I would recommend using the dictionary anyway.
It has got generic type parameters so you can directly specify the datatypes to be held by the dictionary. This prevents many errors (which can be detected at compile-time) and should increase the performance because many casts and runtime-typechecks are unnecessary.
The algorithmic complexity of both datastructures is O(1).

A: This is an old question but I hope it helps anyway..
According to http://msdn.microsoft.com/en-us/library/vstudio/ms172875(v=vs.100).aspx

Element Type. The Visual Basic collection supports elements of type
  Object, which is not type-safe because you can add an element of any
  data type. This usually results in degraded performance because the
  compiler must box and unbox the elements to convert them to and from
  the Object Data Type. Some of the .NET Framework collections also have
  elements of type Object, but many others are strongly typed, meaning
  they support elements of a specific type, which makes them type-safe
  and usually results in optimal performance.

The question is if you need store different types of objects inside that collection.
I made the test. I have several nested Microsoft.VisualBasic.Collection and the program iterates about 6600 times to find an item inside those Collections. It took about 1920ms to finish.
Then I replaced with a single System.Collections.Generics.Dictionary(Of String, String) (since it was only storing Strings) and with the same amount of data took only about 5ms. The difference is huge!!!
The boxing and unboxing is an expensive operation in this case.
I hope this answers your question.
Cheers from Argentina!
PS. sorry my english sucks!


text:
Q: Standard project/package structure of a j2ee web application We are starting a new Java EE web application using Spring, Sping MVC and Hibernate. We will most probably be using maven also.
Before starting we need to come up with the project/package structure for the web application.
What is the Standard project/package structure of a Java EE web application?
It should also run on all application servers without making any changes in the project structure or the any configuration files.
We will be using Spring source IDE version 2.6.0 (latest release).
Any ideas?

A: If you are using maven, it's best to follow the standard maven project layout.  You can get maven to generate this structure for you by doing,
mvn archetype:generate

and select spring-mvc-jpa-archetype from the list of choices
This will give you a package structure like,
  ├── pom.xml
  └── src
      ├── main
      │   ├── java
      │   │   └── mygroup
      │   │       ├── controller
      │   │       │   ├── HomeController.java
      │   │       │   └── PersonController.java
      │   │       ├── dao
      │   │       │   └── PersonDao.java
      │   │       └── model
      │   │           └── Person.java
      │   ├── resources
      │   │   ├── db.properties
      │   │   ├── log4j.xml
      │   │   └── META-INF
      │   │       └── persistence.xml
      │   └── webapp
      │       ├── index.html
      │       ├── META-INF
      │       │   ├── context.xml
      │       │   └── MANIFEST.MF
      │       ├── resources
      │       │   └── css
      │       │       └── screen.css
      │       └── WEB-INF
      │           ├── spring
      │           │   ├── app
      │           │   │   ├── controllers.xml
      │           │   │   └── servlet-context.xml
      │           │   ├── db.xml
      │           │   └── root-context.xml
      │           ├── views
      │           │   ├── edit.jsp
      │           │   ├── home.jsp
      │           │   └── list.jsp
      │           └── web.xml
      └── test
          ├── java
          │   └── mygroup
          │       ├── controller
          │       │   ├── DataInitializer.java
          │       │   ├── HomeControllerTest.java
          │       │   └── PersonControllerTest.java
          │       └── dao
          │           └── PersonDaoTest.java
          └── resources
              ├── db.properties
              ├── log4j.xml
              ├── test-context.xml
              └── test-db.xml

A: A common, more complete Java package structure for a MVCSR (Model, View, Controller, Service, Repository) web application goes something like:
java
└── com
    └── youdomain
        |
        ├── base   // broadly used app-wide base and abstract classes)
        |
        ├── core   // broadly, scattered use helpers, utilities, app health/stats
        |          // tracking, logging, etc
        |
        ├── controller // Fields Http/CGI requests and drives/initiates request
        |          // comprehension, validation, security checks, requesting
        |          // operations by the Service module and invoking the View to
        |          // generate a response.
        |
        ├── data   // This is the lower level data infrastructure, with several
        |          //packages under it for mappers, schema tables/enums, helpers,
        |          // record location, id management, etc
        |
        ├── domain // app-wide exposed classes, managers, and interfaces to
        |          // each persisted (usually DB) domain 'object'. Each
        |          // object often correlates to one table row in you DB.
        |          // Domain objects are mostly considered data, but have some fundamental
        |          // record construction, validation, elaboration, and ancillary information
        |          // functionality which is opaque to the rest of the application.
        |          // For example: Customer, Account, Purchase, Inventory,
        |          // Product, Sale, Return, SpecialOffer, FeedbackComment...
        |
        ├── repository // more complicated persisted objects, often structured
        |       // to address certain efficiency or traversal needs, often each
        |       // repository is underpinned by several records, tables,
        |       // and even cross-DB structures. Example:
        |       //  -- OrderHistory,
        |       //  -- ProductsGlobalSearchIndex,
        |       //  -- CustomerSpecificProductMarketingSuggestionCorrelates
        |
        ├── service // The smarts of the whole application, performs macro, holoistic
        |       //  operations involving multiple DB tables and operations. Such as:
        |       //  -- account.UserAccountLifecycle,
        |       //  -- order.CustomerOrder,
        |       //  -- order.CustomerOrderShipment
        |
        └── view // Intefaces with your jsp, freemarker, tapestry etc.