text:
Q: Voice Control iOS I would like to build a simple reader app for the iPad 2 that would allow users to navigate/read via voice controls. The app would allow the user to enter a mode where the microphone was live and listened for predefined keywords like 'down', 'up', 'next', 'back', 'home', etc.
I don't want to reinvent the wheel on this so I'm just wondering first, if someone has done this already and if not, are there any good tutorials or SDKs available to help with recording someone's voice, and then comparing future output to see if it matches, or just dealing with the microphone in general?

A: Let's put aside that this is a fairly vaguely worded question for the moment.
If you are expecting to allow voice control in your app that somehow works throughout the entire device, it's just not possible. Your app would only work to control itself -- or at least itself and whatever external hooks you can normally get to the rest of the device, like, say, playing a song out of the user's iTunes library.
If you're planning on doing this in a jailbroken environment, then you should find some open-source library that does voice recognition -- if there are any -- and start from there. Be prepared for a very long haul, though.

A: Dragon Mobile SDK is what you're looking for.
http://dragonmobile.nuancemobiledeveloper.com/
There maybe others voice recognition SDKs out there, but this is the only one I can think of from the top of my head.

A: You can find a library called CMU Sphinx. There's an iphone version for it called
PocketSphinx. See if it fits your needs.

A:
I would like to build a simple reader app for the iPad 2 that would allow users to navigate/read via voice controls.

The iOS 13 new feature Voice Control fully meets your request because you can control your device and your app with your voice exactly the same as with touches.
It's also possible to define actions for some specific words for instance.
The device settings are perfectly well detailed to handle this amazing new feature (Accessibility - Voice Control):

If you need dedicated names to be read out in your app, use the accessibilityUserInputLabels property to define them.
That's definitely the built-in tool your need to reach your goal: no need to use external library or SDK, everything is natively provided.  ;o)


text:
Q: Match a pattern and write the stream to a file using Java 8 Stream I'm trying to read a huge file and extract the text within "quotes" and put the lines into a set and write the content of the set to a file using Java 8 Stream.
public class DataMiner {

    private static final Pattern quoteRegex = Pattern.compile("\"([^\"]*)\"");

    public static void main(String[] args) {

        String fileName = "c://exec.log";
        try (Stream<String> stream = Files.lines(Paths.get(fileName))) {
            Set<String> dataSet = stream.
                    //How do I Perform pattern match here
                    .collect(Collectors.toSet());
            Files.write(Paths.get(fileName), dataSet);

        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}

Please help me. Thanks!
EDIT: Answers to the questions..

*

*No there are no multiple quoted texts.

*I could have used simple loop. But I want to use Java 8 streams

A: Unfortunately, the Java regular expression classes don't provide a stream for matched results, only a splitAsStream() method, but you don't want split.
Note: It has been added in Java 9 as Matcher.results().
You can however create a generic helper class for it yourself:
public final class PatternStreamer {
    private final Pattern pattern;
    public PatternStreamer(String regex) {
        this.pattern = Pattern.compile(regex);
    }
    public Stream<MatchResult> results(CharSequence input) {
        List<MatchResult> list = new ArrayList<>();
        for (Matcher m = this.pattern.matcher(input); m.find(); )
            list.add(m.toMatchResult());
        return list.stream();
    }
}

Then your code becomes easy by using flatMap():
private static final PatternStreamer quoteRegex = new PatternStreamer("\"([^\"]*)\"");
public static void main(String[] args) throws Exception {
    String inFileName = "c:\\exec.log";
    String outFileName = "c:\\exec_quoted.txt";
    try (Stream<String> stream = Files.lines(Paths.get(inFileName))) {
        Set<String> dataSet = stream.flatMap(quoteRegex::results)
                                    .map(r -> r.group(1))
                                    .collect(Collectors.toSet());
        Files.write(Paths.get(outFileName), dataSet);
    }
}

Since you only process a line at a time, the temporary List is fine. If the input string is very long and will have a lot of matches, then a Spliterator would be a better choice. See How do I create a Stream of regex matches?

redpajama_set_name: RedPajamaStackExchange


text:
Q: Accessing React childs state I have a React element that renders Child elements with a target state. this target state can change anytime and parent doesn't have access at the moment.
const Parent = () => {
  function getTarget(){
    //TODO
  }

  return(
    <Button>get target</Button>
    {children.map(c=>{
      <Child props={props}/>
    })}
  )
}

const Child = (props) => {
  //props stuff
  const [target, setTarget] = useState(null)
  // this target would be changed by user as they interact.

  return(
    //child elements
  )
}

what I'm trying to do is to get the target state of the Child using button in the Parent with following restraints:

*

*There can be variable amount of Child elements, but only one of them are visible at a time.

*The "get target" button has to be in Parent, the "target" state has to be initialized in child, and it's unknown.
because only on Child is active at a time, a solution that works for
return(
  <Button>get target</Button>
  <Child props={props}/>
)

is also fine.

A:

const Parent = () => {
  const [activeTarget, setActiveTarget] = useState(null);

  const handleButton = () => {
    console.log(activeTarget);
  }

  return(
    <Button onClick={handleButton}>get target</Button>
    {children.map(c=>{
      <Child setActiveTarget={setActiveTarget} />
    })}
  )
}

const Child = ({setActiveTarget}) => {
  const [target, setTarget] = useState(null);

  // when the user interacts call 'setTarget' and 'setActiveTarget' to update both states

  // update parent state when child mounts
  useEffect(() => {
    setActiveTarget(target);
  }, [target]} // you can additionally add dependencies to update the parent state conditionally

  return(
    //child elements
  )
}


text:
Q: Strange regular expression string When I learn GNU Emacs Lisp, I get very confused about the code.
(looking-back "\\s)" 1)

I don't know what the \\s) stand for?I know it can mach the character ), and I want to know the rule of the matching string. Why not use the regular expression?

A: "I don't know what the \\s) stand for? I know it can mach the character ), and I want to know the rule of the matching string."
\s) matches one occurrence of a character with syntax class "close parenthesis".
See the Elisp manual, node Syntax Class Table.

Open parenthesis characters: (
Close parenthesis characters: )
Characters used in dissimilar pairs to surround sentences or
       expressions.  Such a grouping is begun with an open parenthesis
       character and terminated with a close.  Each open parenthesis
       character matches a particular close parenthesis character, and
       vice versa.  Normally, Emacs indicates momentarily the matching
       open parenthesis when you insert a close parenthesis.  *Note
       Blinking::.
In human languages, and in C code, the parenthesis pairs are (),
       [], and {}.  In Emacs Lisp, the delimiters for lists and
       vectors (() and []) are classified as parenthesis characters.


text:
Q: Declaring and initializing an array with pointers to arrays of arrays In the context of this question, I came up with the following code
typedef char Tuple[2];

Tuple test1[2] = {{1,2},{1,2}};
Tuple test2[3] = {{1,2},{1,2},{1,2}};
Tuple test3[4] = {{1,2},{1,2},{1,2},{1,5}};

Tuple* all[3]  = {test1, test2, test3};

to store pointers to arrays of arrays (2-tuples) in an initialized list. However, I failed to write equivalent code without using a typedef. What would the correct syntax for this look like?

A: char test1[2][2] = {{1, 2}, {1, 2}};
char test2[3][2] = {{1, 2}, {1, 2}, {1, 2}};
char test3[4][2] = {{1, 2}, {1, 2}, {1, 2}, {1, 5}};

char (*all[3])[2] = {test1, test2, test3};

Keep the typedef.


text:
Q: Join com Active Record do Codeigniter Fiz uma query que esta rodando ok e estou passando para o Active Record do Codeigniter mas não esta dando certo por causa de um join que esta um pouco fora com convencional, será que alguém tem ideia do que pode ser?
$query = $this->db->query("
    SELECT count(rl.id) as total, rl.dt_validate
    FROM respostas r
    JOIN respostas_log rl
        ON rl.id = (select max(rl2.id) from respostas_log rl2 where rl2.respostas_id = r.id)
    GROUP BY rl.dt_validate
    ");

E com o Active Record não roda....
$query = $this->db
        ->select('count(rl.id) as total, rl.dt_validate')
        ->from('respostas r')
        ->join('respostas_log rl', "rl.id = (select max(rl2.id) from respostas_log rl2 where rl2.respostas_id = mr.id)")
        ->group_by('rl.dt_validate')
        ->get();

Será que alguém tem alguma ideia do que pode ser?

A: Explicação:
O método é esse:
public function join($table, $cond, $type = '')
{
    if ($type != '')
    {
        $type = strtoupper(trim($type));

        if ( ! in_array($type, array('LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER')))
        {
            $type = '';
        }
        else
        {
            $type .= ' ';
        }
    }
    // Extract any aliases that might exist.  We use this information
    // in the _protect_identifiers to know whether to add a table prefix
    $this->_track_aliases($table);
    // Strip apart the condition and protect the identifiers
    if (preg_match('/([\w\.]+)([\W\s]+)(.+)/', $cond, $match))
    {
        $match[1] = $this->_protect_identifiers($match[1]);
        $match[3] = $this->_protect_identifiers($match[3]);

        $cond = $match[1].$match[2].$match[3];
    }
    // Assemble the JOIN statement
    $join = $type.'JOIN '.$this->_protect_identifiers($table, TRUE, NULL, FALSE).' ON '.$cond;
    $this->ar_join[] = $join;
    if ($this->ar_caching === TRUE)
    {
        $this->ar_cache_join[] = $join;
        $this->ar_cache_exists[] = 'join';
    }
    return $this;
}

Então, $table é o nome da tabela que relaciona a $cond é a condição e o $type que pode ser alguns desses 'LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'
Exemplo
$this->db->from('cliente')
    ->join('telefone', 'cliente.id = telefone.clienteid', 'left')
    ->get()
    ->result();

Esse é o formato ele é limitado em colocar um SQL ali porque por automático ele coloca um escape (`), sendo essa SQL gerada por ele:
SELECT * FROM (`cliente`) LEFT JOIN `telefone` ON `cliente`.`id` = `telefone`.`clienteid`

Solução:
$query = $this->db->query("SELECT count(rl.id) as total, rl.dt_validate FROM respostas r JOIN respostas_log rl ON rl.id = (select max(rl2.id) from respostas_log rl2 where rl2.respostas_id = r.id) GROUP BY rl.dt_validate");

Na verdade você já tem a solução e quando se faz um SQL complexa é a melhor forma de executar instruções SQL no CodeIgniter.


text:
Q: determine cutoff for independant variable based on outcome I have very limited understanding of statistics so have failed to find the correct question to ask, let alone the answer.
I have put multiple samples through a series of experiments where for each experiment a variable "reads" increases. For each experiment the test can pass (seen) or fail (missed).
This has left me with a count of seen and missed for each read which I have plotted in a stacked histogram (preliminary data):

I would like to determine a cut off for reads where, with a given confidence level, we can say that we wouldn't miss anything. From the above results looks like could say with 5 or more reads we would not miss anything, but I need to say that with an associated confidence value. eg with 5 reads or more would not miss 95% of samples, or with 10 reads would not miss 99% of samples.
What test do I need?
Thanks.
UPDATE:
The way the samples were run across the series had a random element to it, so the counts (Y axis) are not equal across the X axis.
Therefore, I think I should count this as a proportion
I can't determine FP (I can't rule them out) so I can't plot a ROC curve, but could I plot the recall/FNR (I realise they are the inverse of each other):

I guess as per here I was hoping to find two normally distributed populations and I could calculate the confidence from the number of SD from the mean of the FNR at my X cutoff value


text:
Q: IPCM Macroblock found I try to load an video into an Vectorpublish document.
Everything works find so far. But at frame 150 the Video (huge mp4-file about 56.2 Gibibyte) decoder breaks.
This is the code.
package net.vectorpublish.desktop.vp.video;

import java.awt.event.ActionEvent;
import java.awt.image.BufferedImage;
import java.io.File;
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;

import javax.annotation.PostConstruct;
import javax.inject.Inject;
import javax.inject.Named;

import org.jcodec.api.FrameGrab;
import org.jcodec.codecs.h264.io.model.Frame;
import org.jcodec.common.io.FileChannelWrapper;
import org.jcodec.common.io.NIOUtils;
import org.jcodec.common.model.Picture;
import org.jcodec.scale.AWTUtil;

import net.vectorpublish.desktop.vp.History;
import net.vectorpublish.desktop.vp.api.history.Redo;
import net.vectorpublish.desktop.vp.api.layer.LayerSelectionListener;
import net.vectorpublish.desktop.vp.api.ui.Dialog;
import net.vectorpublish.desktop.vp.api.ui.KeyframeSlider;
import net.vectorpublish.desktop.vp.api.ui.ToolBar;
import net.vectorpublish.desktop.vp.api.ui.VPAbstractAction;
import net.vectorpublish.desktop.vp.api.ui.kf.Keyframer;
import net.vectorpublish.desktop.vp.api.vpd.DocumentNode;
import net.vectorpublish.desktop.vp.api.vpd.VectorPublishNode;
import net.vectorpublish.desktop.vp.ui.ImageKey;
import net.vectorpublish.desktop.vp.video.hs.AddVideoStep;
import net.vectorpublish.desktop.vp.video.hs.data.AddVideoStepData;

@Named
@SuppressWarnings("restriction")
public class LoadVideoButton extends VPAbstractAction implements LayerSelectionListener {
    public LoadVideoButton() {
        super(VideoText.ADD_VIDEO, VideoText.ADD_VIDEO_DESC, true);
    }

    public DocumentNode doc = null;
    @Inject
    public Dialog dlg = null;

    @Inject
    public final KeyframeSlider ks = null;

    @Inject
    public final History h = null;

    @Inject
    public final Redo redo = null;

    public void actionPerformed(final ActionEvent event) {
        new Thread(new Runnable() {

            public void run() {
                File video = dlg.showOpenFile("mp4", "MP4 video").getAbsoluteFile();
                try {
                    FileChannelWrapper channel = NIOUtils.readableChannel(video);
                    FrameGrab graber = FrameGrab.createFrameGrab(channel);
                    int count = graber.getVideoTrack().getMeta().getTotalFrames();
                    List<BufferedImage> images = new ArrayList<BufferedImage>(count);
                    for (int frameNo = 0; frameNo < count; frameNo++) {
                        System.out.println("load frame " + frameNo);
                        Picture nativeFrame = graber.getNativeFrame();

                        if (nativeFrame instanceof Frame) {
                            Frame frame = (Frame) nativeFrame;
                            BufferedImage bufferedImage = AWTUtil.toBufferedImage(frame);
                            images.add(bufferedImage);
                        }
                    }
                    NIOUtils.closeQuietly(channel);
                    AddVideoStepData data = new AddVideoStepData(images);
                    AddVideoStep step = new AddVideoStep(h, doc.getLastExecutedHistoryStep(), data);
                    redo.actionPerformed(event);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }).start();
    }

    @Inject
    private final ToolBar tb = null;

    @PostConstruct
    public void setup() {
        setIcons(VideoText.NS, ImageKey.get("add.video"));
        tb.add(this);
    }

    public void notify(Set<VectorPublishNode> arg0) {
        if (arg0.size() == 1 && arg0.iterator().next() instanceof DocumentNode) {
            doc = (DocumentNode) arg0.iterator().next();
        } else {
            doc = null;
        }
        setEnabled(doc != null);
    }
}

This is the log:
DefaultI8nImageFactory Found: Image for key net.vectorpublish:io/open/small in cache!    (DefaultI8nImageFactory > OpenImpl)
DefaultI8nImageFactory Found: Image for key net.vectorpublish:io/open/large in cache!    (DefaultI8nImageFactory > OpenImpl)
DefaultI8nImageFactory Found: Image for key de.e-nexus:video/add.video/small in cache!   (DefaultI8nImageFactory > LoadVideoButton)
DefaultI8nImageFactory Found: Image for key de.e-nexus:video/add.video/large in cache!   (DefaultI8nImageFactory > LoadVideoButton)
DefaultI8nImageFactory Found: Image for key net.vectorpublish:io/document/small in cache!        (DefaultI8nImageFactory > IOContributions > LanguageController)
DefaultLogger Show dialog: Ask dialog.   (unknown)
LayerSelectionManager Notify: 9 listeners about tree-selection.          (LayerSelectionManager > LayerImpl > NewFile > FilesImpl > FilesImpl > FilesImpl)
AddKeyframe Method in: Check for Add/Modify Keyframe availability. evaluateEnableButton          (AddKeyframe > AddKeyframe > LayerSelectionManager > LayerImpl > NewFile > FilesImpl > FilesImpl > FilesImpl)
AddKeyframe Found: 0 Keyframer and 1 non-Keyframer.      (AddKeyframe > AddKeyframe > LayerSelectionManager > LayerImpl > NewFile > FilesImpl > FilesImpl > FilesImpl)
LayerSelectionManager Notify: 9 listeners about tree-selection.          (LayerSelectionManager > LayerImpl)
AddKeyframe Method in: Check for Add/Modify Keyframe availability. evaluateEnableButton          (AddKeyframe > AddKeyframe > LayerSelectionManager > LayerImpl)
AddKeyframe Found: 0 Keyframer and 0 non-Keyframer.      (AddKeyframe > AddKeyframe > LayerSelectionManager > LayerImpl)
LayerSelectionManager Notify: 9 listeners about tree-selection.          (LayerSelectionManager > LayerImpl)
AddKeyframe Method in: Check for Add/Modify Keyframe availability. evaluateEnableButton          (AddKeyframe > AddKeyframe > LayerSelectionManager > LayerImpl)
AddKeyframe Found: 0 Keyframer and 1 non-Keyframer.      (AddKeyframe > AddKeyframe > LayerSelectionManager > LayerImpl)
load frame 0
load frame 1
load frame 2
load frame ... (cut)
load frame 148
load frame 149
load frame 150
[WARN]  . (:0): IPCM macroblock found. Not tested, may cause unpredictable behavior.
[WARN]  . (:0): IPCM macroblock found. Not tested, may cause unpredictable behavior.
java.lang.NullPointerException
        at org.jcodec.codecs.h264.decode.deblock.DeblockingFilter.calcBsH(DeblockingFilter.java:160)
        at org.jcodec.codecs.h264.decode.deblock.DeblockingFilter.deblockFrame(DeblockingFilter.java:71)
        at org.jcodec.codecs.h264.H264Decoder$FrameDecoder.decodeFrame(H264Decoder.java:156)
        at org.jcodec.codecs.h264.H264Decoder.decodeFrameFromNals(H264Decoder.java:103)
        at org.jcodec.codecs.h264.H264Decoder.decodeFrame(H264Decoder.java:99)
        at org.jcodec.api.specific.AVCMP4Adaptor.decodeFrame(AVCMP4Adaptor.java:68)
        at org.jcodec.api.FrameGrab.getNativeFrame(FrameGrab.java:242)
        at net.vectorpublish.desktop.vp.video.LoadVideoButton$1.run(LoadVideoButton.java:68)
        at java.lang.Thread.run(Thread.java:748)

A: IPCM macroblocks are unuasual, but completely legal. If your decoder doesn't support it, use a different decoder, or convert this video first.


text:
Q: Setting a custom content-type xmlhttprequest I have an API I am trying to interface with that requires a custom content-type header be set, with the value text/xmlmc
I've implemented this like so
    Xmlmc.prototype.submitRequest = function (request,callback) {
    var self = this;
    var port = portMap[request.service] || 5015;
    var endpoint = this.endpoint = 'http://' + this.server + ':' + port;
    var xml = request.toXml();
    var xhttp;
    if (window.XMLHttpRequest) {
        xhttp = new XMLHttpRequest();
    } else {
        // IE 5 and 6 makes us sad. Please don't use it
        xhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }

    //handle request
    xhttp.onreadystatechange = function() {
        if (xhttp.readyState == 4) {
            var response = self.handleResponse(xhttp);
            callback(response);
        }
    };

    xhttp.open('POST',endpoint,true);
    xhttp.setRequestHeader('Content-type', 'text/xmlmc');
    //xhttp.setRequestHeader('Content-length', xml.length.toString());
    if(this.sessionCookie != '') {
        xhttp.setRequestHeader('Cookie', this.sessionCookie);
    }
    xhttp.send(xml);
};

The endpoint is localhost:5015
When I do this, the request fails and never even sends. When I use a standard request header like 'text/plain' the request is sent but returns a status code of 501 not implemented. How can I set a custom HTTP header in an xmlhttprequest?

A: It turns out this was due to a cross origin issue. Even when the domain is the same, if the ports are different it is a problem. I fixed the issue by adding a reverse proxy to my apache configuration and now I can query the api without cross origin requests. Unfortunately I don't have access to change the API and allow cross origin domains.


text:
Q: Error in function createFiberFromTypeAndProps in ./node_modules/react-dom/cjs/react-dom.development.js:25058 I am learning to create a gatsby blog website with a YouTube tutorial. I have followed the exact steps as shown in the tutorials. There were errors that were related to graphql query format. which were solved.
I have searched for the error. But all the answers were related to react app. There was no answers related to gatsby. So I was unable to figure out the right way to solve it.
The page loads at local server port 8000. The error comes while clicking the Read more button to see the single post. The error seems to be of React.
Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports. Check the render method of singlePost.
Here is the codesandbox link: https://codesandbox.io/s/gatsby-starter-hello-world-m685p
singlePost.js
import React from "react"
import { graphql } from "gatsby"
import { MDXRenderer } from "gatsby-plugin-mdx"
import { H1 } from "../elements"
import { Container, Post, FeatureImage, Seo } from "../components"

const singlePost = ({ data }) => {
  const featureImage = data.mdx.frontmatter.featureImage.childImageSharp.fixed

  const seoImage = data.mdx.frontmatter.featureImage.publicURL

  return (
    <Container>
      <Seo
        title={data.mdx.frontmatter.title}
        image={seoImage}
        description={data.mdx.frontmatter.excerpt}
      />
      <FeatureImage fixed={featureImage} />
      <Post>

{data.mdx.frontmatter.title}

        <MDXRenderer>{data.mdx.body}</MDXRenderer>
      </Post>
    </Container>
  )
}

export default singlePost

export const pageQuery = graphql`
  query SinglePostQuery($id: String!) {
    mdx(id: { eq: $id }) {
      body
      frontmatter {
        date
        excerpt
        slug
        title
        featureImage {
          childImageSharp {
            fixed {
              ...GatsbyImageSharpFixed
            }
          }
        }
      }
    }
  }
`

A: Your component must be named SinglePost instead of singlePost (notice the capitalization), so:
import React from "react"
import { graphql } from "gatsby"
import { MDXRenderer } from "gatsby-plugin-mdx"
import { H1 } from "../elements"
import { Container, Post, FeatureImage, Seo } from "../components"

const SinglePost = ({ data }) => {
  const featureImage = data.mdx.frontmatter.featureImage.childImageSharp.fixed

  const seoImage = data.mdx.frontmatter.featureImage.publicURL

  return (
    <Container>
      <Seo
        title={data.mdx.frontmatter.title}
        image={seoImage}
        description={data.mdx.frontmatter.excerpt}
      />
      <FeatureImage fixed={featureImage} />
      <Post>

{data.mdx.frontmatter.title}

        <MDXRenderer>{data.mdx.body}</MDXRenderer>
      </Post>
    </Container>
  )
}

export default singlePost

export const pageQuery = graphql`
  query SinglePostQuery($id: String!) {
    mdx(id: { eq: $id }) {
      body
      frontmatter {
        date
        excerpt
        slug
        title
        featureImage {
          childImageSharp {
            fixed {
              ...GatsbyImageSharpFixed
            }
          }
        }
      }
    }
  }
`

All React component names must start with a capital letter. Otherwise, it will be treated as a built-in element like a
 or a  (or another HTML tag). In JSX, rendering a component that begins with a lowercase letter compiles down to React.

Outside the scope of the question, check the importation/exportation of the components and it's naming, because this kind of issue is usually related to that (for future scenarios/issues). If a component is exported as default, it must be imported like:
import DefaultComponent from '../path/to/default/component'

Otherwise, it needs to be imported as:
import { NonDefaultComponent} from '../path/to/non-default/component'


text:
Q: Android: Installing the Market app on the emulator? I need to install the market app on the android emulator on Mac Os X. How can it be done?
Thanks

A: The Market is not available for the emulator. It is only available for hardware devices that meet the compatibility requirements.

A: Yes, you can.  See my answer to this question, re-quoted below:

This 2 part video walks you through
  how to get the marketplace and the
  gmail app onto an android 2.2
  emulator:
  http://www.youtube.com/watch?v=Xe-jA3l3QNA
This link also covers it
  (http://anythingsimple.blogspot.com/2010/09/how-to-use-android-market-on-android.html)
  but I found the video to be a bit more
  useful.


text:
Q: Decrypting DES encrypted data from Java to .Net I have a problem decrypting an encrypted string that was encrypted in Java using the DES algorithm. I think my main problem is, that I don't see any salt or IV specifications in the java code.
I have following information:
This HexSequence is the encrypted data I have to decrypt: 9465E19A6B9060D75C3F7256ED1F4D21EDC18BB185304B92061308A32725BE760F1847E3B19C1D3548F61165EA2E785E48F61165EA2E78
Algorithm: DES, Padding: DES/ECB/NoPadding, Key: TESTKEY123
After decryption I should get: 550000000018h000000273Al2011112214340600000000000000000000000000
The java-code used to encrypt the data looks like this:
public class Encryptor {

private SecretKey secretKey;
private Cipher cipher;

public Encryptor(String algorithmName, String paddingName, String key) {
    String keyHexCode = StringUtils.convertUnicodeToHexCode(key.getBytes());
    try {
        byte[] desKeyData = StringUtils.convertHexStringToByteArray(keyHexCode);

        DESKeySpec desKeySpec = null;
        try {
            desKeySpec = new DESKeySpec(desKeyData);
        } catch (InvalidKeyException e) {
            e.printStackTrace();
        }
        SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(algorithmName);
        try {
            secretKey = keyFactory.generateSecret(desKeySpec);
        } catch (InvalidKeySpecException e) {
            e.printStackTrace();
        }

        try {
            cipher = Cipher.getInstance(paddingName);
        } catch (NoSuchPaddingException e) {
            // TODO: handle exception
        }
    } catch (NoSuchAlgorithmException e) {
        // TODO: handle exception
    }
}

private void initEncryptor(int mode) {
    try {
        cipher.init(mode, secretKey);
    } catch (InvalidKeyException e) {
        // TODO: handle exception
    }
}

public String encrypt(String clearText) {
    initEncryptor(Cipher.ENCRYPT_MODE);
    try {
        // Encrypt the cleartext
        byte[] encryptedBytes = cipher.doFinal(clearText.getBytes());
        return StringUtils.convertUnicodeToHexCode(encryptedBytes).toUpperCase();
    } catch (IllegalBlockSizeException e) {
        // TODO: handle exception
    } catch (BadPaddingException e) {
        // TODO: handle exception
    }
    return "";
}

public String decrypt(String encryptedTextHex) {
    byte[] encryptedText = StringUtils.convertHexCodeSequenceToUnicode(encryptedTextHex);
    initEncryptor(Cipher.DECRYPT_MODE);
    try {
        // Decrypt the encryptedTextHex
        return new String(cipher.doFinal(encryptedText));
    } catch (IllegalBlockSizeException e) {
        // TODO: handle exception
    } catch (BadPaddingException e) {
        // TODO: handle exception
    }
    return "";
}
}

I tried to use following .net-code to decrypt the data:
public class URLDecryptor
{
public static string GetValue(string Data)
{
    DESCryptoServiceProvider cryptoProvider = new DESCryptoServiceProvider();
    byte[] bytes = System.Text.UnicodeEncoding.Unicode.GetBytes("TESTKEY123");
    byte[] salt = new byte[8];
    byte[] iv = new byte[8];
    Rfc2898DeriveBytes password = new Rfc2898DeriveBytes("TESTKEY123", salt);
    cryptoProvider.Key = password.GetBytes(8);
    cryptoProvider.IV = iv;
    cryptoProvider.Padding = PaddingMode.None;
    cryptoProvider.Mode = CipherMode.ECB;

    MemoryStream memStream = new MemoryStream(convertHexCodeSequenceToUnicode(Data));
    CryptoStream cryptoStream = new CryptoStream(memStream, cryptoProvider.CreateDecryptor(cryptoProvider.Key, cryptoProvider.IV), CryptoStreamMode.Read);
    StreamReader reader = new StreamReader(cryptoStream);
    string value = reader.ReadToEnd;

    reader.Close();
    cryptoStream.Close();

    return value;
}

private static byte[] convertHexCodeSequenceToUnicode(string hexCodeSequence)
{
    byte[] bytes = new byte[(hexCodeSequence.Length / 2) + 1]; //This is strange
    int index = 0;
    int count = 0;
    while (count < hexCodeSequence.Length) {
        string hexCode = hexCodeSequence.Substring(count, 2);
        bytes[index] = getHexValue(hexCode);
        count += 2;
        index += 1;
    }

    return bytes;
}

public static byte getHexValue(string hexCode)
{
    return byte.Parse(hexCode, System.Globalization.NumberStyles.HexNumber);
}
}

What's strange is that line:
byte[] bytes = new byte[(hexCodeSequence.Length / 2) + 1];

The data is 55 bytes long but I have to put it in 56 bytes. It appends a 0-byte to the and of the array, but if I don't do this the cryptostream throws an error that the data to decrypt is too short.
If I try it this way I only get garbage as output. I'm using a empty salt and IV because I can't see which salt and IV the java code is using. Are there any default values I don't know?
EDIT:
Java code to get the byte out of the hexCode:
private static byte getNegativeValueForHexConversion(String hexCode) {
int i = Integer.parseInt(hexCode, 16);
return (byte) (i > 127 ? i - 256 : i);
}

Looks like Java uses a signed byte and .Net uses an unsigned byte for all its functions. Is this maybe the problem?

A: DES is a block cipher with a 64-bit block size. Thus (in ECB mode at least) the ciphertext you have to decrypt must be a multiple of 64 bits (8 bytes) long. Yours is 55 bytes, so you do not have the full ciphertext - this is why you're having to add a zero byte. Have you run the Java code yourself and seen that the output is 55 bytes long? Is this a copy and paste error?
The exception to this would be DES used in a mode which effectively creates a key stream, that is then XORed with the plaintext to produce the ciphertext. This would include CFB, OFB and CTR modes. So one possibility is that decrypting with one of these would work (off the top of my head, I can't remember whether the .NET crypto libraries support CTR). Are you sure that ECB was specified in the Java code?
But also, you have the problem that the Java code looks like it's doing a straightforward text to hex conversion from the key text to get the key bytes, whereas the .NET code is doing an RFC-2898 compatible conversion, which will not give you the same key bytes.


text:
Q: Connecting to SQL Server with pyodbc over VPN I have some code that establishes a connection to SQL server using pyodbc. However, soon the SQL server will only accept connections from a VPN. I need to therefore modify the connection to go via a VPN.
How can I achieve that pyodbc?

A: The VPN connection will need to be established first, this isn't a problem that can be solved directly by pyodbc.


text:
Q: Direct link in pip requirements file How can I add the pip install torch_nightly -f https://download.pytorch.org/whl/nightly/cu90/torch_nightly.html to a requirements.txt?
I tried setting the version to the link as well as just adding the link and both are apparently incorrect
Edit: Won't let me add any more comments, but yeah I was trying to use the requirements file for a virtualenvwrapper environment. Wanted to pip3.6 freeze and copy over my brew python3.6 libs to a virtual env.


text:
Q: Как я могу привязать значение label к переменной в viewModel У меня есть viewModel, и в ней есть переменная.
Хочу, чтобы когда у меня меня менялось значение переменной, автоматом менялся label в viewController. Как мне это сделать? Без использования RxSwift или Combine.

A: Решение:
class Dynamic<T> {
    typealias Listener = (T) -> ()
  private var listeners: [Listener] = []
  init(_ v: T) {
    value = v
  }
  var value: T {
    didSet {
      for l in listeners { l(value) } }
  }
  func bind(_ l: @escaping Listener) {
    listeners.append(l)
    l(value)
  }
  func addListener(_ l: @escaping Listener) {
    listeners.append(l)
  }
}

infix operator >>>
func >>> <T>(left: Dynamic<T>, right: @escaping (T) -> Void) {
  left.bind(right)
}

func >> <T>(left: Dynamic<T>, right: @escaping (T) -> Void) {
  return left.addListener(right)
}

viewDidLoad:
viewModel.playerPoints >>> { self.label.text = "\($0)" }


text:
Q: NestJS - How to add a dynamic routing to the controller? I have the following problem. Let's say I have an array of routes & paths to static resources, e.g.
const routes = [{ url: '/', path: 'assets/www' }]

What I would like to do is to create a set of dynamic routes to serve static resources. In express application I would do smth like:
const router = express.Router();
routes.forEach(route => {
   router.use(route.url, express.static(path.join(__dirname, route.path)))
})

But is it possible to create such a logic inside a NestJS controller?
@Controller()
export class ItemsController {
  constructor() {}

  @Get()
  findAll() {}

  @Get(':id')
  findOne() {}

  ....
}

As far as I can see all HTTP request handlers should be predefined using the corresponding decorators.

A: I would opt for an approach where you create your controllers fully dynamic. This is not natively supported in Nest, but you can actually create dynamic controllers and dynamic services using a mixin approach (what is actually quite common), also see this answer at GitHub:
import { Post, Get, Controller } from '@nestjs/common';

interface Options {
  basePath: string
  entityName: string // you could even pass down DTO classes here, for maximum flexibility.
  providerName: string
}

// this service is generated dynamically as well
// preferably use a custom providerName.
interface DynamicService {
  foo: () => void
  bar: () => void
}

export const createDynamicController = (controllerOptions: Options) => {

  @Controller(controllerOptions.basePath)
  class MyController {

    constructor(
      @Inject(options.providerName) myProvider: DynamicProvider
    ){}

    @Get(options.entityName)
    findOne(){
      return this.myProvider.foo()
    }

    @Post(options.entityName)
    create(){
      return this.myProvider.foo()
    }

  }

  return MyController
}

Using that approach you can create all controllers in theory dynamically, but it asks a bit more about understanding of the NestJS dependency tree.
You can now create the controller like:
{
   controllers: [createDynamicController({
     basePath: 'foo',
     entityName: 'barz',
     providerName: 'custom-provider-name'
    })
   ]
}

A: What you could do is have a dynamic controller -> with say Parameters identifiers -> the as if it were like an event handler id... (not really just using that as an way to think of the process.)
Then in your the connected service -> you can have the 5 crud operations however in your service you inject the static resources -> and use that Identifier to route the call.
query dto

export class QueryDto {
  readonly params?: any[];
  readonly body: any;
}

controller

 @Post(':serviceId')
  async create(@Param('serviceId') serviceId: string, @Body() queryDto: QueryDto) {
    return await this.rootService.create(serviceId, queryDto);
  }

inside your root service
 // childService = used to route the request dynamically ->
 // body = your body or if you dont need a body this is where any parameters would go. which is why it's any (for if it was a get)
 // params last => incase your doing a put or something where you need a body and parameters -> but it also allows it to be optional.

 async create(childService: string, data: any, params: any[]): Promise<any> {
    if (!id) {
      return await this[childService].create(data.body, ...data.params).exec()
    }

just an idea, but if everything static then this should do it for you. just use the root service as a passthrough. from the single controller -> to the various services.


text:
Q: Convert string to datetime in mongodb I have some fields suppose to be datetime but some date values are inserted as string from the application so now the fields become mixed data type. The string format is like below:
"Tue May 13 00:00:00 CDT 2010".
I am trying to convert all the string type of the date to be datetime, I am using the following format, using CreateDate as the sample field with this problem:
db.Test.aggregate([
    { "$addFields": {
        "$CreateDate": {
            "$dateFromString": {
                "dateString": "$CreateDate",
                timezone: "America/Chicago"
            }
        }
    } }
])

But I am getting the following error:
errmsg" : "Error parsing date string 'Tue May 13 00:00:00 CDT 2010'"
I am using Mongo 3.6 version and format seems to be new in 4.0 only. Any help will be appreciated.

A: You should never store Date/Time values as string, use proper Date object. Your problem is yet another example of the validity of this statement.
Mongo version 4 would not help either. Month names are not supported, see Format Specifiers
I think you have to go for a 3rd party library, e.g. moment.js but you cannot use it directly, i.e. db.Test.aggregate([{$set: {CreateDate: moment("$CreateDate").toDate()}}])
You could correct wrong values with a loop like this:
db.Test.find({ CreateDate: { $not: { $type: "date" } } }).forEach(function(doc) {
    let d = moment(doc.CreateDate).toDate();
    db.Test.updateOne({ _id: doc._id }, { $set: { CreateDate: d } });
})


text:
Q: how to hi-light something in HTML with  i am trying to make something  that highlights text black but my code isnt working
is there any way to do this?
CODE:
CSS:
.highlight-black {
    background-color:black;
    color:white;
}

HTML:
<!DOCTYPE html>

            text to hilight

A: Update your CSS
#highlight-black {
    background-color:black;
    color:white;
}

Better idea if you want highlight more than one text in the same document to set the class rather than ID attribute update your HTML with the following code

   text to highlight

A: . is to target classes. # is to target id's.  Your div is using an ID.
So use this code:
#highlight-black {
    background-color:black;
    color:white;
}

A: you using id in ur div and u should use # .
for id in css #
for class in css .

class way / using .
html >>

     text to highlight

css >>
.highlight-black {
background-color:black;
color:white;
}

id way / using #
html >>

     text to highlight

css >>
#highlight-black {
background-color:black;
color:white;
}

And one more thing that may come in handy in the future ...
if u use bootstrap, bootstrap automatically will highlight the text are between the mark tags.
have nice time


text:
Q: Can I use developer tools in Chrome to hide all the images on a webpage? Is it possible to hide all the images on a webpage by putting a global class something like this:
img{
   display:none;
}

on the entire html document I visit in my browser? Is there a way I can visit a webpage, open up developer tools and override the css classes (locally of course) without having to say display: none for every element with the element.style class?

A: In Chrome Dev Tools (F12), click the plus in the top right, then use your selector. Keep in mind that when you refresh the page, this rule will disappear.

Otherwise you can disable images in Chrome's settings, click Show advanced settings, then under Privacy, click Content settings


text:
Q: Slow wired connection speed with Ubuntu 16.04 LTS I have an Acer Aspire One AOA150/ZG5
I'd like to understand if the connection speed is too slow - 25/30 Mbps
Also, how can I check if something is wrong?
I installed Ubuntu 16.04 LTS at the end of the year.
With Windows my connection speed is about 280/290 Mbps.

A: Same issue on my computer, somehow related to the IPv6 implementation.
Try this and check if there's a difference: https://askubuntu.com/questions/475493/ubuntu-14-04-lts-wired-internet-extremely-slow

A: I had the same issue with my ethernet. I checked the download speed on the Windows platform, it was showing around 1 Gbps. Then I checked on Ubuntu, and it was 6 Mbps, and the upload speed was around 500 Mbps. Trying so many solutions and not getting resolved was frustrating. Then I updated my Linux kernel from 5.0.0.32 to 5.4.0.70. Now it is working fine and the downloading speed is the same as Windows.


text:
Q: SQL Schema - Default of 1:Many How can I specify the default value of a 1:Many relationship ... for example take a user that has 5 phone numbers ... I need to record the "preferred" phone number. Should I use an attribute on the phone_number record to indicate the preferred one - or have a attribute of the user record (preferred_phone_number for example) that is the primary key from the phone_numbers table ?
Thanks

A: *

*User.preferred_phone: you have zero or one preferred numbers per user.

*Phone.is_preferred: you may have any amount of preferred numbers per user, without a way to choose the 'most preferred', and even 'preferred numbers' that no user relates to.
So I'd clearly stick with #1.


text:
Q: Citing equations from equation environment Suppose I have an equation at some point in my document say
\begin{equation}
equation 1
\end{equation}

and latter in my document I reference the equation writing (1). Is there a way to reference this equation so that if I add a new equation before it my reference will automatically update to (2)?

A: Here are a few variants. With the cleveref package, you don'rt even have to ype 'equation' or 'equations'. Note that if you load hyperref, it has to be loaded at the end of the preamble, but before cleveref:
\documentclass{report}

\usepackage[utf8]{inputenc}
\usepackage{mathtools}
\usepackage[colorlinks]{hyperref} %
\usepackage{cleveref}

\begin{document}

\begin{gather}
  \label{eq-1}
     I = \frac{1}{2}(a - b) \\
    J = \sqrt{x^2 + y^2 + z^2}
  \label{eq-2}
   \end{gather}

I want to reference eq.\,\ref{eq-1} or eq.\eqref{eq-1}, or reference \cref{eq-2}.

\Cref{eq-1,eq-2} show that…

\end{document}

A: Follow this:
         \begin{equation}
         \label{eq:equation1}
          equation 1
         \end{equation}

         The formula of X is shown in equation \eqref{eq:equation1}.


text:
Q: Subtle difference when searching multi value fields in Solr I have a very simple question but I don't understand exactly why it happens and what the difference is.
Take a simple Solr search on a multi value field:
field_name:ABC AND DEF
field_name:(ABC AND DEF)

They return quite different results. I understand the brackets are for grouping but I don't understand the difference. It seems quite subtle.
Many thanks.

A: The first query isn't doing what you think it's doing.
field_name:ABC AND DEF

This is parsed as:
field_name:ABC AND <default search field>:DEF

This is different from your second example, which is parsed as:
field_name:ABC AND field_name:DEF

In the first example the second part of your query is made against whatever field is defined as the default search field in your index (or in the query itself, if you've set df).


text:
Q: Who controls 'accepting of answers' for questions of deleted users I find several questions like mentioned here: Question of deleted user shown The question OP is not clickable (and often has a name like user123456) and is probably not existing anymore.
These questions become orphans with respect to control over the accepted answer when the OP is gone.
Often the orphans are ok, since the 'accepted answer' is (I believe) considered from the viewpoint of the person that asked the questions. So when that person is gone then we might say we do not care about the accepted answer.
(A bit of track: from my viewpoint the 'accepted answer' is not only about the benefit to the OP and it serves a wider purpose. Because of that it should in my opinion should be controlled by the community and not just a single person. This is especially the case when the OP that asked the question, is possibly having a knowledge gap, and may not always know what a good answer entails, especially what makes an answer a 'correct' answer. But that's a different issue)
What do we do with the control of these orphan questions, and especially when the accepted answer is false? (but there is no OP anymore to change this)
This question can be taken as an example case: Statistical language in "The Avengers" It's 3 years old and has an accepted and upvoted answer, but... does that close the case?

A: As answered by @JourneymanGeek:

No one does. The post has no owner. We treat it, well like the owner
  hasn't been back for a while.

However, it need not always be like this.  For example, this is a feature request that would allow acceptance of a question to "time out" when an asker leaves the site or loses interest in their question:
Keeping special status for Accepted Answers without sticking them to top forever?

A: I would add to others answers, even in case of a user that is not deleted, nothing can force him to change the accepted answer anyhow.
The fact it was accepted mean the answer was useful in that time. It's the big difference between some forums and here, here the answer mark is controlled by only the OP, which for me is important to stay it that way.
Upvoting the correct answer is the best thing to do.I would maybe suggest to make the most upvoted answer appear before the accepted answer when viewing the question would be a more acceptable compromise IMO.

A: No one does. The post has no owner. We treat it, well like the owner hasn't been back for a while.
I suspect the "best" way to deal with it is to create a question pointing out the answer for the other question dosen't work or is false, and maybe close as dupe the other way.
In some cases, historically, I've just posted an answer and figured voting and the user's common sense would lead them to the right one (which may or may not be mine)

A: Nobody controls the orphan questions and this should not be the case. For other questions the status of the 'accepted answer' can change so this should be a desirable possibility for orphan questions as well.
Either the 'accepted' should be removed or a feature should be build that the 'accepted' is controlled in some way by the community.


text:
Q: Attach an iCalendar event to a mail in Grails I've been working with Grails 3.x, specifically with mail and iCalendar plugins, I tried to attach an iCalendar event to my mail Service but it didn't work. I would appreciate so much if someone could help me to fix my code. Here it is:
** This part is my iCalendar structure ** https://github.com/saw303/grails-ic-alender
byte[] iCalendarFile
{
    render(contentType: 'text/calendar')
    {
        calendar
        {
            events {
                event(
                    start: new Date(),
                    end: new Date(),
                    description: 'Event',
                    summary: 'Some text here',
                )
            }
        }
    }
    calendar.toString.getBytes('UTF-8')
}

** And then I have my email structure **
def mailService

def emailSender()
{
    mailService.sendMail
    {
      multipart true
      to correo
      subject "Event"
      body "Some text here"
      attach "audiencia.ics", "text/calendar", iCalendarFile ()
    }
}

Both iCalendarFile and emailSender are in the same Service class.
Thanks for yout support. :)

A: This is the answer
import ch.silviowangler.grails.icalender.ICalendarBuilder

class NotifierService
{
    byte[] emailFile (**params**)
    {
        def archivo = new ICalendarBuilder()
        archivo.calendar {
            events {
                event( start: new Date(),
                   end: new Date(),
                   description: "Description",
                   summary: "Some text here",
                   utc: true // optional
                )
            }
       }
       archivo.cal.toString().getBytes('UTF-8')
    }

mailService.sendMail
{
    multipart true
    to email@email.com
    subject "Subject"
    body "Some text here"
    attach "event.ics", "text/calendar", emailFile(**params**)
}


text:
Q: memory instruments not working in xcode After some upgrades to Xcode i am experiencing a strange situation:
when i start instruments to profile my apps (both on ios or mac) it works well with all the instruments (for example cpu monitor, or i/o monitors) but i cannot use the memory management ones: Allocations, Leaks, Object graph. If i start the profile window by clicking on leaks it just opens an empty "Instruments document", and if i drag them from the library panel they don't show up, but all the others do. Anybody is experiencing this behaviour? Maybe some missing library?
My Xcode version is "Version 4.2 Build 4D199" and my instruments version is "Version 4.2 (4233)"

A: I solved this by updating Xcode to version 4.2.1 (Build 4D502).
One thing that I noticed, since I've installed Xcode using the Mac App Store, was that the update process behaves like the install - it downloads an app called "Install Xcode" which you run to install/update. So be sure to run the installation app after first time download or update.


text:
Q: From ajax call, setting session value in code behind gives error message At page load in code behind, the setting of session value working fine. But from the ajax call, it gives the error message as Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the <configuration>\<system.web>\<httpModules> section in the application configuration.
SessionData is Public Property SessionData(sessionVariableName As String) As String
Codebehind:
SessionData("UserRole") = "Supervisor"

A: I achieved by adding EnableSession:=True in the webmethod


text:
Q: How to intercept the onSuccess() method in GWT I need to do method interception for the onSuccess method in GWT.
I need to add some code before and after the calling of the onSuccess method in GWT? (I have many calls to the onSuccess method and I need to do this dynamically)
EDIT:
I need to add a progress bar in the right corner of the screen, that appears when the code enters the onsuccess method and disappears on the exit of onsuccess method.

A: From a visual perspective
void onSuccess(Value v) {
  showProgressBar();
  doLotsOfWork(v);
  hideProgressBar();
}

will be a no-op.  Browsers typically wait for event handlers to finish executing before re-rending the DOM.  If the doLotsOfWork() method takes a noticeable amount of time to execute (e.g. >100ms) the user will notice the browser hiccup due to the single-threaded nature of JavaScript execution.
Instead, consider using an incrementally-scheduled command to break the work up.  It would look roughly like:
void onSuccess(Value v) {
  showProgressBar();
  Scheduler.get().scheduleIncremental(new RepeatingCommand() {
    int count = 0;
    int size = v.getElements().size();
    public boolean execute() {
      if (count == size) {
        hideProgressBar();
        return false;
      }
      processOneElement(v.getElements().get(count++));
      setProgressBar((double) count / size);
      return true;
    }
  });
}

By breaking the work across multiple pumps of the browser's event loop, you avoid the situation where the webapp becomes non-responsive if there's a non-trivial amount of work to do.

A: Well, it is a generic non-functional requirement, I have done some research on this item, I have implemented a solution that Thomas Broyer has suggested on gwt group.. This solution has distinct advantage over other suggested solutions, You dont have to change your callback classes, what you have to do is just add a line of code after creation of async gwt-rpc service...
IGwtPersistenceEngineRPCAsync persistenceEngine = GWT.create(IGwtPersistenceEngineRPC.class);
     ((ServiceDefTarget) persistenceEngine).setRpcRequestBuilder(new ProgressRequestBuilder());

import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.RequestBuilder;
import com.google.gwt.http.client.RequestCallback;
import com.google.gwt.http.client.Response;
import com.google.gwt.user.client.rpc.RpcRequestBuilder;

public class ProgressRequestBuilder extends RpcRequestBuilder {

    private class RequestCallbackWrapper implements RequestCallback {

        private RequestCallback callback;

        RequestCallbackWrapper(RequestCallback aCallback) {
            this.callback = aCallback;
        }

        @Override
        public void onResponseReceived(Request request, Response response) {
            Log.debug("onResposenReceived is called");
            // put the code to hide your progress bar
            callback.onResponseReceived(request, response);

        }

        @Override
        public void onError(Request request, Throwable exception) {
            Log.error("onError is called",new Exception(exception));
            // put the code to hide your progress bar
            callback.onError(request, exception);

        }

    }

    @Override
    protected RequestBuilder doCreate(String serviceEntryPoint) {

        RequestBuilder rb = super.doCreate(serviceEntryPoint);
        // put the code to show your progress bar
        return rb;
    }

    @Override
     protected void doFinish(RequestBuilder rb) {
         super.doFinish(rb);
         rb.setCallback(new RequestCallbackWrapper(rb.getCallback()));

     }

}

A: You cant do that. The rpc onSuccess() method runs asynchronously (in other words, depends on the server when it completes, the app doesnt wait for it). You could fire code immediately after the rpc call which may/ may not complete before the onSuccess for RPC calls.
Can you explain with an eg why exactly do u want to do that? Chances are you might have to redesign the app due to this async behavior, but cant say till you provide a use case. Preferably any Async functionality should be forgotten after the rpc call, and actioned upon only in the onSuccess.


text:
Q: Failing to print query using Overpass API with Python This is my code so far, I am using the flickrapi to obtain images with lat and lon, then using the overpass api in flickr to find info about the nodes at this location.
import flickrapi
import overpy

api_key = "xxxxxxxxxxxxxxxxxxx"
secret_api_key = "xxxxxxxx"
flickr = flickrapi.FlickrAPI(api_key, secret_api_key)

def obtainImages():

    photo_list = flickr.photos.search(api_key=api_key, accuracy = 15, has_geo=1, per_page = 100, extras = 'tags, url_s')

    for photo in photo_list[0]:

        id = str(photo.attrib['id'])
        url = str(photo.attrib['url_s'])
        title = (photo.attrib['title']).encode('utf-8')

        photo_location = flickr.photos_geo_getLocation(photo_id=photo.attrib['id'])
        lat = float(photo_location[0][0].attrib['latitude'])
        lon = float(photo_location[0][0].attrib['longitude'])

        max_lat = lat + 0.25
        min_lat = lat - 0.25
        max_lon = lon + 0.25
        min_lon = lon - 0.25

        print lat
        print min_lat
        api = overpy.Overpass()
        query = "node(%s, %s, %s, %s);out;" % ( min_lat, min_lon, max_lat, max_lon )
        result = api.query(query)
        print query
        print len(result.nodes)

obtainImages()

The flickr api aspect is working perfectly, if I try to print any of the variables it all works. Also min_lat and min_lon all work when printed.
However although there are no errors, my query is returning no results.Lat and min_lat print once and only once and then the program continues running but does nothing else and prints nothing else
Has anyone any suggestions as to why this may be? Any help would be greatly appreciated as I am a newbie!

A: The problem is that you are querying huge datasets, this will make the query take a lot of time.
For example, I queried just one image from flickr, and your script produced  this query:
node(20.820875, -87.027648, 21.320875, -86.527648);out;

There are 51162 results. You are querying every available node in a 2890 square kilometers box, see here for an illustration: http://bl.ocks.org/d/3d4865b71194101b9473
To get a better understanding of how changes (even "little" ones like +/- 0.25) to longitude and latitude affect the outcome I suggest that you take a look at this post over at GIS Stackexchange: https://gis.stackexchange.com/a/8655/12310


text:
Q: Each extra-special group of order $2^{2n+1}$ is a central product of $D_8$s or of $D_8$s and a single $Q_8$. This is Exercise 5.3.7(i) of Robinson's, "A Course in the Theory of Groups (Second Edition)". According to this search, it is new to MSE.
This is a classification problem. This Wikipedia entry describes the result.
The Details:
Let $p$ be prime. A $p$-group is a group all of whose elements have order $p$.
Let $G$ be a finite $p$-group. Then $G$ is extra-special if $G'$ (the derived subgroup of $G$) and $Z(G)$ (the centre of $G$) coincide and have order $p$.
The quaternion group $Q_8$ is defined to be the group given by the presentation
$$\left\langle x,y\, \middle|\, x^{2^2}=1, y^2=x^2, y^{-1}xy=x^{-1}\right\rangle.$$
The dihedral group $D_8$ of order eight is the group given by the presentation
$$\left\langle r,s\,\middle|\,r^{2^2}, s^2, srs=r^{-1}\right\rangle.$$
Let $G$ be a group with normal subgroup $G_1,\dots, G_n$. Then $G$ is the central product $G_1\circ\dots\circ G_n$ of those normal subgroups if:

*

*$G=G_1G_2\dots G_n$,

*$[G_i, G_j]=1$ for $i\neq j$, and

*for all $i$, $$G_i\cap\prod_{j\neq i}G_j=Z(G).$$
Robinson claims that $Z(G_i)=Z(G)$.
The Question:
Paraphrased:

Consider an extra-special group $G$ of  order $2^{2n+1}$. Prove $G$ is a central product of the $D_8$s or a central product of $D_8$s and a single $Q_8$.

There is a hint (which I have paraphrased):

Prove that a central product of two $D_8$s is a central product of two $Q_8$s.

Thoughts:
I thought I'd rewrite the question in terms of group presentations, so I asked the following question:
Given $H=\langle X_H\mid R_H\rangle$ and $K=\langle X_K\mid R_K\rangle$, find a presentation for Robinson's $H\circ K$
It turns out that it is insufficient to know presentations of groups $H,K$ in order to find a presentation of $H\circ K$.

I don't know how to use the hint, let alone prove what it suggests I prove. My guess, though, is that the parity of $n$ determines whether there is a $Q_8$ term in the central product (since, if I'm right, we can replace an even number of $Q_8$s by the same number of $D_8$s in the central product). According to the Wikipedia entry (cited above), the number of $D_8$s in the central product does not depend on the parity of $n$.

If $G$ is an extra-special $2$-group of order $2^{2n+1}$, then $G'=Z(G)\cong \Bbb Z_2$.

Previous, relevant questions of mine include:

*

*Find the upper central series of $Q_{2^n}$.

*Showing ${\rm Aut}(D_{2^n})\cong{\rm Aut}(Q_{2^n})$ for $n\ge 4$.

*Showing ${\rm Aut}(Q_{2^n})\cong{\rm Hol}(\Bbb Z_{2^{n-1}})$ for $n>3$

Please help  :)

A: Let $Z:=Z(G) = \langle z \rangle$, with $z$ of order $2$.
Choose two non-commuting generators $a,b$ of $G$. Then $[a,b]=z$, and $H:=\langle a,b \rangle$ is extraspecial of order $8$, and hence is isomorphic to $D_8$ or $Q_8$.
Now let $c$ be another generator of $G$, not in $H$. If $c \not\in C_G(a)$, then $[c,a]=z$, so $[cb,a]=1$. Similarly, if $c \not\in C_G(b)$, then $[ca,b]=1$. So we can replace $c$ by an element in the same coset $cH$, to get $c \in C_G(H)$.
It follows that $G = HC_G(H)$. In fact this is a central product, and you can check that $C_G(H)$ is extraspecial of order $2^{2n-1}$. So, by induction, $C_G(H)$ is a central produce of groups isomorphic to $D_8$ or $Q_8$, and hence the same applies to $G$.
Now it should be clear that the result to be proved follows from $D_8 \circ D_8 \cong Q_8 \circ Q_8$.
I can't really give advice on proving the hint. They are both groups of order $32$, so you just have to work out an isomorphism (and you can check it in GAP).
BTW, this result is proved in various textbooks on group theory.


text:
Q: Cannot log back into desktop environment after running "setxkbmap il" and logging out On OpenSUSE Leap 42.3, with KDE desktop environment, I changed the X11 keyboard map by running $ setxkbmap il to type something on LibreOffice Writer with a local language. Then after a period of inactivity my desktop environment got locked automatically. Now, I'm not able to login to desktop environment because my keyboard layout is still set to il but my username and password are in us. What should I do?

A: To fix it:
Switch to a console (as suggested in the comment): Ctrl+Alt+F2, login, and then:

*

*kill the screenlock program (with htop, kill lockprogramname etc), or

*restart the display manager (systemctl restart display-manager.service), or

*try to run setxkbmap (env DISPLAY=:0 setxkbmap us), or

*reboot the system

To avoid it in the future:
Use multiple layouts in your setxkbmap command and set a group toggle key to switch between the layouts.  You can load up to 4 independent layouts this way.  See man xkeyboard-config for various grp: options.
$ setxkbmap -layout us,il -option grp:shift_caps_toggle

# grp:shift_caps_toggle    Shift+CapsLock
# grp:ctrls_toggle         Both Ctrl together
# grp:alt_caps_toggle      Alt+CapsLock
# grp:sclk_toggle          Scroll Lock


text:
Q: Asterisk 11 Who Hanged Up? I do have an Asterisk 11 PBX and I'm developing an Windows Service application using the github AsterNET.AMI Library to connect my PBX. Till here everything is working fine, I can send commands and read incoming event messages.
But now I need to develop a feature on my software based over one information that I thought it could be easy to retrieve. The information I'm looking for is - who hanged up?
I googled for it a lot and I could find a few answers, most of them talking about setup the G option on CDR but also some considerations about this approach. Still like this I couldn't grab any valuable information for my scenario.
Maybe if I tell you about my working scenario you could help me. Lets go, I'm going to bullet split this:

*

*I do have a caller calling from a cellphone and this calling are incoming to my internal PBX extension

*My PSTN trunk is a E1/R2 directly to my PBX

*No matter if caller or callee hangs up always I do have "normal clearing" message for hangup_cause

*I know I'm receiving from my service provider the information about the releasing device, because if I use my Siemens 3800 Hipath over CSTA I can retrieve this information.
So the gold question is: How can I retrieve who is the releasing device on this situation?

A: You can try a combination of g and F options in the Dial application. The g option allows dialplan execution when the called party hangs up, while the F option allows you to continue execution to a context,extension,priority of your choice if the caller hangs up.
So, you can understand which party is hanging up by the dialplan being executed after the call ended.
Find here more info on these options: https://www.voip-info.org/asterisk-cmd-dial/

A: The only way I could find after read Asterisk doc almost entirely was reading HangupRequest event messages.
As I'm using AsterNet.AMI library to connect and manage my Asterisk, so I change the source code a little bit to have an event handler do read HangupRequest event.
HangupRequest event writes the messages like the following one:
Event: HangupRequest
Privilege: call,all
Channel: SIP/8103-000001be
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum: 8103
CallerIDName: Agent 8103
ConnectedLineNum: 51999887766
ConnectedLineName: 51999887766
Language: en
AccountCode:
Context: from-internal
Exten: 8100
Priority: 1
Uniqueid: 1569618521.446
Linkedid: 1569618519.445

So accordly to HangupRequest Event Asterisk documentation I could notice the channel in the message is the channel related to the releasing device, also CallerIDNum and CallerIDName are related to.
This feature is not implemented right now on the github library, but I'm going to push over there and ask them to include on next release.
Yet I don't know where to read this information on FreePBX Admin.


text:
Q: how to make navigation Bar move above its position smoothly, I used UIScrolView to show the Contents(Images). I didn't use any third party code. My Scroller and zooming are working perfectly(which were not working before). Now I want to add a functionality, where after just touching the screen(i.e tapping once) the Navigation Bar goes up as shown in Picture2. I want to increase the size of the UIscrollview at the same time, as shown in Image 2. And If the user Tap Once again the Navigation Bar , come back to its original position and the scrollView gets back to its original size and shape. My scrollView is containing Images, that scrolls Horizontally.

One way to show animation for Navigation Bar, is that I make a custom View and add it on the place of Navigation Bar and Use following code for animation
For Moving Upward
    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:0.3];
    customNavigationbar_view.frame=CGRectMake(0, -66, 320, 65);
    [UIView commitAnimations];

Which will become too clumsy. Am even ready to do that. But how To increase my scrollview size with animation, so that It doesnt appear that Scrollview size increase immmidately my clicking something. If there's a third party that provide all the things I want like this, please let me know. Most of Third Party code is either to hard to get or they dont provide all the things I require in my project. And am sorry for the way I added Images.

A: You should use:
[self.navigationController setNavigationBarHidden: YES animated: YES];

See Apple Docs
To make your scrollView move with the navbar, you'll need to set your autoLayout to pin the top of the scrollView to the top of the viewContoller's view.

A: Animate the change in the scrollview frame:
Something like:
- (void) tap:(UITapGestureRecognizer *)gr {
    [self.navigationController setNavigationBarHidden: YES animated: YES];
    [UIView animateWithDuration:1.0 animations:^{
        CGRect frame = self.scrollView.frame;
        frame.origin.y = 0;
        frame.size.height = self.view.bounds.size.height; // or whatever you need to keep it from moving up
        self.scrollView.frame = frame;
    }];
}


text:
Q: application of omitting types theorem in graph theory or some other discrete structure? i'm looking for some applications of omitting types theorem in discrete structures like graphs...
for example something like end extension in PA....

A: Here's an example application: Suppose $G$ is a graph with the property that for any first-order formula $\varphi(x,y)$ in $2$ free variables, if there are any $a,b\in G$ such that $G\models\varphi(a,b)$, then there are some $a',b'\in G$ such that $G\models\varphi(a',b')$ and there is a path from $a'$ to $b'$. Then there is a connected graph which is elementarily equivalent to $G$.


text:
Q: Systemd get reason for watchdog timeout I have to debug an application that always gets killed via SIGABRT signal due to some mysterious watchdog timeout in systemd after exactly 3 minutes. Is there any logging etc. that helps me find out which of the many systemd parameters triggers the abort?

A: The application needs to notify watchdog messages to systemd. There are several ways of doing this.
The watchdog internal is set in the systemd service file, and the line looks like
WatchdogSec=4s

3 minutes seems like a long time, so it looks like the app is not feeding the watchdog.
See https://www.freedesktop.org/software/systemd/man/sd_notify.html for documentation on how to feed the watchdog.


text:
Q: Mail.app mailbox corruption Once a week or so, Mail.app will not display the contents of a mail message. Selecting Mailbox -> Rebuild fixes bandaids the issue until next time.
I only have one account in Mail.app, pointing to a Microsoft hosted Exchange server. This has happened consistently for the past 3 months.
What information would help to solve this problem, or what is a solution to this problem?

A: You could try deleting the "Envelope Index" files.
Run the following Terminal commands to backup and delete the files:
cd ~/Library/Mail/V2/
cp MailData MailData.old
cd MailData
rm Envelope\ Index Envelope\ Index-shm Envelope\ Index-wal

Alternatively…

*

*Quit Mail

*In Finder, press ⌘ cmd+⇧ shift+G
Copy and paste the following
~/Library/Mail/V2/MailData/

Press return or click Go

*Backup then delete/move these files to the Trash:

*

*Envelope Index

*Envelope Index-shm

*Envelope Index-wal

*Relaunch Mail and wait for messages to import.
Note: once in a while this causes a corrupted message or two to reveal itself, usually in the form of having no "From" or "Subject" in the list view of messages (at least in "Classic Layout" mode).
Sometimes a corrupted message can actually screw up the interaction between Mail and the server, even if message is corrupted not on Mac, but on the server itself! (seen happen w/ AOL).


text:
Q: Is there a file that can be used to monitor `/dev/sda`s only IO activity in Linux? I am familiar with iotop and those tools. But for some strange reason I have to write a Ruby program on my own to monitor only read and write activity of all the partitions on /dev/sda). I want to know how does iotop work.
I have the Kernel 4.20.13-arch1-1-ARCH
Is there a file that I can read with Ruby's IO.read('somefile') and do some formatting to get the IO details?
For further info, I want to know how does gnome-system-monitor monitor disk IO activities as a non-root user?


text:
Q: Is there any way to get last N changes for a user using drive.changes.list in one API call? We are trying to get the last N changes for a user, and currently do so by getting the largestChangeId, then subtracting a constant from that and getting more changes.
As an example, we typically are making API calls with the changestamp = largestChangeId - 300, with maxResults set to 300.
We've seen as few as half a dozen changes to 180 changes come back across our userbase with these parameters.
One issue that we're running into is that the number of changes that we get back are rather unpredictable, with huge jumps in change stamps for some users and so we've have to choose between two rather unpalatable scenarios to get the last N changes.

*

*Request lots of changes, which can lead to slow API calls simply because there are lots of changes.

*Requests a small set of changes, and seek back progressively in smaller batches, which is also slow as it results in multiple RPC calls, due to multiple API calls.
Our goal is to get the last ~30 or so changes for a user as fast as possible.
As a workaround, we are currently maintaining per user state in our application to tune the max number of changes we request up or down based on the results we got for a user the last time around. However, this is somewhat fragile due to how the rate of changes incrementing for users can vary over time.
So my question is as follows:
Is there a way to efficiently get the last N changes a user, specifically in one API call ?

A: ID generation is very complex, it's impossible to calculate the ID of the user's nth latest change :) Changes list actually has no features that'd be appropriate for your use case. In my  own personal opinion, changes list should be in the reverse chronological order, going to discuss it with the rest of the team.


text:
Q: How to run Ansible commands based on versions in single task? Can I perform these below in single task? If so, what shall be the approach?
- name: fetch configuration
  command: "oc get disk -n **xyz** -o json"
  when: vars.version == **"2.1"**
  register: oc_result

- name: fetch configuration
  command: "oc get disk -n **abc** -o json"
  when: vars.version == **"3.0"**
  register: oc_result

So, if the version is 2.1, then, the command should be run with xyz namespace, else with abc namespace.
The version will be from another YAML variable, which I will refer using {{ vars.version }}.

A: You could create a dictionary to match the version to a specific namespace.
And use a default for the cases not in the dictionary of versions.
For example:
- name: fetch configuration
  command: "oc get disk -n {{ _v[vars.version] | default('abc') }} -o json"
  register: oc_result
  vars:
    _v:
      '2.1': xyz


text:
Q: Form action problem I have a form for people to share an email on a page.  The forms pops up and users, in theory, can send an automated subject and message to a friend.  When I hit submit, however, the brower displays a 404, and I'm not sure why...
<div id="tellfriend" class="contact_form">
  <form id='tellafriend_form' method="post" action="#"  >

    <label for="name">Your Name: </label>
    <input class="std_input" type="text" id="name" name="name" size="40" maxlength="35" value="" />

    <label for="to">Friend's email: </label>
    <input class="std_input" type="text" id="to" name="to" size="40" maxlength="35" />

    <label for="subject">Subject: </label>
    <input class="std_input" type="text" id="subject" name="subject" size="40" value="subject line" />

    <label for="message">Message: </label>
    <textarea id="message" name="message" readonly="readonly" rows="18" cols="40">message here</textarea>

    <input type="submit" name="submit" class="form_but" value="Submit"/>
  </form>
</div><!-- #tellfriend -->

JS:
<script>
$(function() {
    $('#tellfriend').hide();
    $('#sendMessage').click(function(e) {
        $("#tellfriend").fadeToggle('fast');
    });

});
</script>

site (bottom of the page): http://naturesfootprintinc.com/mjf

A: Your form action is set to "#". You need to change it to some actual CGI page the browser can post to, like your page's URL if you're just trying to post back to that.

A: Replace the action = "#" with the page where the data is processed or leave it blank so that the data is processed in the same page.


text:
Q: How to collect latest Queries? I want to display the latest queries which have been run on my site using PHP
like
www.torrentz.com
We can see the latest searches..
So is this possible ?? to put it on my homepage ?

A: You could store them in a database and then query that table to take a sample of the most recent queries.
Something like
SELECT * FROM recent_queries ORDER BY timestamp DESC LIMIT 20

Would select the most recent 20 queries providing you save a time stamp of when the original search was made.


text:
Q: Playing audio from stream with HTML5 I've got problem with playing audio from stream in web browser. I am streaming voice via BinaryJS as 2048-length Int16 arrays to client's browser and I am getting very noisy output. This is how I am receiving the stream:
 var
    client,
    audioContext,
    audioBuffer,
    sourceNode,
    sampleSize = 2048,

  function main() {
    try {
        audioContext = new AudioContext();
    } catch(e) {
        alert('Web Audio API is not supported in this browser');
    }
    sourceNode = audioContext.createBufferSource();
    sourceNode.connect(audioContext.destination);

    connectClient();

    playSound();
  };

  function playSound() {

    sourceNode.start(0);

  };

   function onError(e) {
    console.log('error' + e);
  };

  function connectClient() {
    client = new BinaryClient('ws://localhost:3000');
    client.on('open', function() {
      console.log('stream opened');

    });
    client.on('stream', function(stream, meta){
      stream.on('data', function(data){
        var integers = new Int16Array(data);
        var audioBuffer = audioContext.createBuffer(1, 2048, 4410);
        audioBuffer.getChannelData(0).set(integers);
        sourceNode.buffer = audioBuffer;
        });
      });
    };

  main();

What should I do to get clean audio?

A: I think your playback technique here is causing the noise – first of all, can you ensure that your stream event fires often enough to provide continuous data for Web Audio? If it doesn't, then the noise you hear is the pops and clicks after each bit of audio stops playing. Also, updating the data by swapping ArrayBuffers on sourceNode isn't a good idea.
I would suggest using a ScriptProcessorNode with your desired buffer size – this gives you the ability to insert raw data into the graph at audio rate, which should reduce the noise. Look at this demo to see how to set up the node, basically you just need to fill the outputBuffer with your stream data.
This will only really help if your streaming is faster than the audio rate!
Good luck,
jakub


text:
Q: Why does Windows take so much time to connect to a wifi network? My Windows 7 laptop takes 1-2 minutes to connect to a wifi network. As a college student, my laptop goes in and out of sleep multiple times throughout the day. Having to wait a few minutes for internet each time I open it is getting annoying.
This happens when connected whether or not the power cable is plugged in.

A: EDIT: I'm still experiencing the same problem with this service enabled and running
Found the answer here

This is for XP/Vista,but hopefully ,7 will be similar.
You would be looking for wlan/or wzc AND some d-link wireless manager manager associated with the wireless card running simultaneously.
Check your Services are Started on all PCs:
•  COM+ Event System (for WZC issues)
•  Computer Browser
•  DHCP Client
•  DNS Client
•  Network Connections
•  Network Location Awareness
•  Remote Procedure Call (RPC)
•  Server
•  TCP/IP Netbios helper
•  Wireless Zero Configuration (XP wireless configurations)
•  WLAN AutoConfig (Vista wireless configurations) This would be the Vista default wireless manager,for example.
•  Workstation
Note: You can check the services in Control Panel, Administrative Tools, Services.
All of these services should be started, and their startup type should be automatic (or perhaps manual).
If a service is not running, open it's properties and check the dependencies. Check each of the dependencies and see which one is preventing the service from running. Checking the event log is also a good idea here, there may be clues to what is failing.

For me, it was simply a matter of starting the Computer Browser service and setting it to start automatically.

A: Try to update your network card drivers. But don't through Windows Update but looking for a suitable driver on you laptop manufacturer's website.
Does this happen when connecting to only one wifi network or does it connect with a lag to every wifi network you try to connect to?

A: I am going to assume for the rest of the answer that you only have a 2.4ghz card--as is common in Windows devices (and everything else really). If you do a search for Device Manager in the Start Menu you will be able to look through the list of devices and find your network adapter. Clicking this will bring up a General page and from there go to the Advanced tab. There are your settings. If there is no mention of 5ghz in the settings you don't have a capable adapter.
Since you are at college there is a good chance that this is an WPA Enterprise network (do you enter your uni log in information to connect?) and there are a few caveats. These networks broadcast both on 2.4ghz and 5ghz ranges and provide support for AGN networking. N has the capacity to support 5ghz (is able, doesn't always). I would shut off B if you can in your WiFi driver settings. This might help.
The problem here is that most devices only support 2.4ghz which means that network is very crowded. Schools look to setup connection rules that will encourage 5ghz devices to connect to that range first. This means that most 2.4ghz devices will always connect slower. The problem with this method is that some devices' connection attempts timeout before they can actually connect to the network. You could be in this group. Your computer would then reload the network and start all over.
Do everything else suggested and then look on Amazon for a 5ghz USB network adapter.

A: Turn off power saver on the nic.
For Windows 7 do the following:

*

*Click on the Windows Start button

*In the Search window type "network and sharing center"

*Press enter

*In the left pane of the NetWork and Sharing Center select "Change adapter settings"

*Right-Click your wireless device and select "Properties"

*Click "Configure"

*Select the "Power Mangement" tab

*Deselect "Allow the computer to turn off this device to save power"

*Click OK

Now the wireless nic will remain powered even when the system sleeps.
Keep in mind that this will mean reduced battery life.
If it is still an issue then you can always turn all Power Savers off for the laptop by typing in the Windows-Start-Search "Power Options", then select "Change when the computer sleeps", then for "Put the computer to sleep" chose "NEVER" for "On Battery" and "Plugged In".
Hope this helps someone.

A: I had the same problem then I switched off ip v6 in wifi properties and problem solved...

A: Usually turning off power saver on the your card (as mentioned above by John) will do the trick:
For Windows 7 do the following:
Click on the Windows Start button
In the Search window type "network and sharing center"
Press enter
In the left pane of the NetWork and Sharing Center select "Change adapter settings"
Right-Click your wireless device and select "Properties"
Click "Configure"
Select the "Power Mangement" tab
Deselect "Allow the computer to turn off this device to save power"
Click OK
But also do this:
Click on the Windows Start button
In the Search window type "network and sharing center"
Press enter
In the left pane of the NetWork and Sharing Center select "Change adapter settings"
Right-Click your wireless device and select "Properties"
Find check box that says Internet Protocol Version 6 (TCP/IPv6) and uncheck it. (make sure Internet Protocol Version 4 (TCP/IPv4) IS STILL checked)
Click OK
Still slow? Do this:
(but ONLY if your wifi is the only connection you use, as this may not connect to other wifi's properly after this step)
With your wifi actually connected, open up a command prompt by typing cmd in the search bar of your start menu. (a window will show up waiting for you to type commands in)
Type in:
ipconfig /all
All of you Network cards will be listed. Find the one for your wireless card and write down the IP it was assigned, subnet mask, default gateway, and the DNS server addresses. Usually 2 or 3 DNS servers:
EXAMPLE (it should look similar to this):
Wireless LAN adapter Wireless Network Connection
Write down the IP addresses are the numbers with periods that look similar to this:

*

*IPv4 Address.....: 192.168.1.24

*Subnet Mask......: 255.255.255.0

*Default Gateway..: 192.168.1.1

*DHCP Server......: 192.168.1.1

*DNS Servers......: 192.168.1.1

Open your network and sharing center.
Click on Change Adapter Settings.
Right click on your wireless adapter, and again go down to properties.
Select Internet Protocol Version 4 (TCP/IPv4) and click on properties.
Click the radio buttons to manually enter the addresses, and enter the numbers you wrote down. Select Ok, and then Ok again, and it should automatically disconnect then reconnect.
Restart Computer and put the computer to sleep, then wake it up and see if it made any difference.
To undo this step and set everything back to automatic connection so you can connect to other wifi networks just go back into Internet Protocol Version 4 (TCP/IPv4) properties and click the radio buttons back to Obtain IP Address Automatically, as well as Obtain DNS Server Address Automatically.
Click OK, and then OK again.
Restart Computer.
Hope that helps!

A: I had this same issue and fixed it by uninstalling and reinstalling the driver. (requires Admin)
I didn't want to turn off power-saver mode, as the others are suggesting. That means you don't have to reconnect because it never disconnects, but drains the battery by staying connected, and I like to leave my computer in sleep for long periods of time.

*

*Open Network and Sharing Center (can be found from the network status icon in the task bar, or from the Control Panel, or by searching the start menu)

*Click "Manage Adapter Settings" in the side bar.

*Right click on the troublesome adapter, and select "Properties". (For me, the adapter was labeled Wireless Network Connection.)

*Click on "Configure..."

*In the Driver tab, click "Uninstall". Then reboot your computer.

NOTE: This will disconnect you from the internet. When you reboot, the
  driver will reinstall itself, so make sure you don't check the 'remove
  driver from this computer' box.
Some people posting on other forums had luck simply rolling back the driver, or updating to the newest version. These options didn't work for me, but you might have better luck. They can be accessed from the same configuration menu.

A: After trying everything else, I found the (1 minute or so) delay was due to delay in reaching the DNS. Changed the DNS to one offered by by ISP, problem solved.

A: This Worked for me on Windows 10, Lenovo G50 Laptop
Check your Services are Started on all PCs: • COM+ Event System (for WZC issues)
Computer Browser
DHCP Client
DNS Client
Network Connections
Network Location Awareness
Remote Procedure Call (RPC)
Server
TCP/IP Netbios helper
Wireless Zero Configuration (XP wireless configurations)
WLAN AutoConfig (Vista wireless configurations) This would be the Vista default
wireless manager,for example.
Workstation


text:
Q: Update list column data via HTML form web part I'm trying to update list data on Sharepoint via HTML web part. This is my update function:
  function UpdateListItems( ids ) {

    var response = getNode(
        '<?xml version="1.0" encoding="utf-8"?>' +
        '<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">' +
        '<soap12:Body>' +
           '<UpdateListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/">' +
                  '<listName>' + wikiLibrary + '</listName>' +
                  '<updates>' +
                     '<Batch OnError="Continue" ListVersion="1">'
                        + ids +
                     '</Batch>' +
                  '</updates>' +
               '</UpdateListItems>' +
        '</soap12:Body>' +
        '</soap12:Envelope>'
        );
 alert( response.xml );

}
This results into this error:
0x8102000aInvalid URL Parameter. The URL provided containes an invalid Command or Value. Please check URL again
Any help will be highly appreciated!

A: Include Method and Field command inside batch command.
below is example,
 function UpdateListItems( ids ) {

var response = getNode(
    '<?xml version="1.0" encoding="utf-8"?>' +
    '<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">' +
    '<soap12:Body>' +
       '<UpdateListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/">' +
              '<listName>' + wikiLibrary + '</listName>' +
              '<updates>' +
                 '<Batch OnError="Continue" ListVersion="1">'
                  '<Method ID='+ ids + 'Cmd="Update">'+
                     '<Field Name="ID" >'+ids+'</Field>'+
                   ' </Method> '+
                 '</Batch>' +
              '</updates>' +
           '</UpdateListItems>' +
    '</soap12:Body>' +
    '</soap12:Envelope>'
    );

alert( response.xml );
Refer this for batch commands.

A: the problem was solved by targeting list items in getListItems function -
               k++;
               batchstring = batchstring + '<Method ID="' + k + '" Cmd="Update">';
               batchstring = batchstring + '<Field Name="ID">' + data.childNodes[i].attributes[j].value + '</Field>';
               batchstring = batchstring + '<Field Name="Date">' + dag + '</Field></Method>';

the batchstring = batchstring + '<Field Name="ID">' + data.childNodes[i].attributes[j].value + '</Field>'; was changed from batchstring = batchstring + '<Field Name="ows_ID">' + data.childNodes[i].attributes[j].value + '</Field>';


text:
Q: Google Charts - Dynamically rotate line points It's possible to rotate line chart points using Google Charts (https://developers.google.com/chart/interactive/docs/points#rotations). It's also possible to customize individual points (https://developers.google.com/chart/interactive/docs/points#individual).
I want to rotate points based upon the data passed to the table. The following code loads the custom point but does not rotate the triangle. Is this even possible?
google.setOnLoadCallback(drawChart);
  function drawChart() {
    var data = google.visualization.arrayToDataTable
        ([['X', 'Y', {'type': 'string', 'role': 'style'}],
          [1, 3, null],
          [2, 2.5, null],
          [6, 3, 'point {shape-type: triangle;  rotation: 180;}'],
          [7, 2.5, null],
          [8, 3, null]
    ]);

    var options = {
      legend: 'none',
      hAxis: { minValue: 0, maxValue: 9 },
      curveType: 'function',
      pointSize: 7
    };

    var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
    chart.draw(data, options);
}

In jsfiddle - https://jsfiddle.net/7bc691kr/
Thanks

A: In the individual points options it looks like the rotation option is called shape-rotation instead of just rotation.
Change your rotation: 180 to shape-rotation: 180 and it should work.


text:
Q: Moving GPO Deployed Software install files: user endpoints not updating A bunch of our software is deployed via GPO (both Assigned and Published), but the paths to said installers are on an old server \\foo.
I've set up DFS and want to move these installers to a new location \\domain\dfs\software. So I've followed the instructions outlined here to update the GPO's msiFileList value. Easy peasy.

I double check the GPO settings: looks good.

However, I log onto my test machine and try to install the software using "Install a Program from the Network", and see that it's still pointing to the old path:

OK, maybe the GPO hasn't been applied.

*

*gpresult /r: Yup, GPO is applied

*gpupdate /force: No errors.

*Reboot: done

Well now that I'm sure this GPO is applied, let's try again. Same thing. I can manually point to the new location, but that's not a reasonable solution when trying to deploy to more than a few computers.
So what am I missing? Is there a GPO cache I need to clear somewhere?
Version information

*

*Server: Windows 2008R2

*Test PC: Windows 10 Pro 1809

A: Sadly I was unable to find any resolution to this. The only thing that worked was to remake each GPO.


text:
Q: Design pattern for static fields of a subclass I'm creating a library, and I want there to be an abstract class called Optimizer. The user should be able to choose from a set of predefined Optimizers and if desired, use fluent methods to change certain fields.
Every Optimizer has a "learning rate", so I've defined learningRate as a field within that class as well as its fluent setter.
abstract class Optimizer {
    private double learningRate;

    public Optimizer withLearningRate(double learningRate) {
        this.learningRate = learningRate;
        return this;
    }
}

One type of Optimizer should be "Gradient Descent" (which has a default learning rate of 0.01 + more properties than just learning rate), so I defined OptimizerGD accordingly:
public class OptimizerGD extends Optimizer {
    private double momentum = 0; // default momentum
    private boolean nesterov = false; // default nesterov

    public OptimizerGD() {
        withLearningRate(0.01); // default learning rate
    }

    public OptimizerGD withMomentum(double momentum) {
        this.momentum = momentum;
        return this;
    }

    public OptimizerGD withNesterov() {
        this.nesterov = true;
        return this;
    }
}

And I want the user to be able to select this Optimizer in a simple way, like Optimizer.GD, so I added this line to my Optimizer class:
public static final OptimizerGD GD = new OptimizerGD();
Allowing for:
model.compile().withOptimizer(GD.withNesterov());

Here are my concerns with my current design pattern, and any ideas I have for possible solutions:

*

*IntelliJ warns me that "Referencing subclass OptimizerGD from superclass Optimizer initializer might lead to class loading deadlock".

My idea for this is to make another class called Optimizers to contain the static field for GD (and other ones I add later), although I think I would prefer to keep this stuff in Optimizer because that seems more conventional? I suppose this doesn't make too much of a difference from the user's POV though.

*

*My fluent setter for learning rate returns Optimizer instead of the specific subtype of Optimizer, meaning that it always has to be called last when I chain setters (GD.withNesterov().withLearningRate(0.5))

My idea for this is to remove withLearningRate from Optimizer, and instead have it implemented in each subclass I make so that it can return the subtype. The reason I hesitate to embrace this is because I'm repeating the same code with just a different return type.

*

*I don't want the user to be able to implement their own Optimizer or instantiate OptimizerGD. I want them to always use GD followed by any setters they may wish to use. I believe I've prevented Optimizer implementations by making it package-private, but OptimizerGD has to be public, it seems, for the setters to be accessible.

Don't know what to do here. Maybe my design pattern needs to use enums?
I've asked several things here but they're all connected to my one main question, which is what the design pattern of my code should be given my goals and specifications.

A: The idea of providing a static instance of OptimizerGD (which is just a singleton in disguise) looks flawed, since optimizers are stateful. Assume one wants one OptimizerGD object "without Nesterov", and a second one "with Nesterov" - in the current design, this would not be possible, since there would always be only one OptimizerGD object with either nesterov set to true or to false.

I don't want the user to be able to [...] instantiate OptimizerGD

But why? I think if I would have to implement this, I would actually want the user to do exactly this - create individual Optimizer (or OptimizerGD) objects with individual settings (and so remove the necessity of having a static instance Optimizers.GD at all). That would solve two of your three issues just by removing overcomplicated stuff.
For the problem of mixing inheritance with fluent interface, I found this short article. It shows how to utilize generics for solving the problem. Applied to your case, this results in something along the lines of
public class Optimizer<T extends Optimizer<?>> {

  protected final T self;

  protected Optimizer(final Class<T> selfClass) {
    this.self = selfClass.cast(this);
  }

   public T withLearningRate(double learningRate) {
      this.learningRate = learningRate;
      return self;
   }
}

However, an even simpler solution to this could be sticking to the KISS principle and not to use a fluent interface at all. Sure, the API then may look a little bit more "conventional", maybe "boring", but think twice if you are sure the "fluent interface" is really important for the users of your API, or if they may also almost equally be happy with a non-fluent one.

A: Abstract classes should not depend on concrete classes. Furthermore, this would be against the open/close principle: every time you'd create a new kind of optimizer, you'd need to update the base class to create a new static member.
Isolating these static optimizers in a separate class would decouple the things a little more.  But you would have to create optimizers without even being sure that you need them.
So there are two possibilities:

*

*either you let the user instantiate the desired optimizer;

*or you use a Factory to instantiate the optimizer.

According to the DRY principle, it would not be such a nice idea to redefine a common setter in every subclass, doing the same thing again and again, just for the sake of having a covariant return type for method chaining. On the other hand, keeping it as it is, forces users to remember which setter is common and which is specific. This goes against the principle of the least knowledge.
So, if whatever you do there are drawbacks, are the chained setters really worth the additional constraints ? I'd recommend not to use them to keep it simple.