text:
Q: Intel compiler with openCV how does it work I have a C# project, a CLI/C++ project which wraps a C++ project.
I have compiled openCV 3.0.0 and I'm using full static link( *.lib without *.dll files)
since I want to use Intel IPP i want to use the intel Compiler in order to compile the C++ project.
at first I tought I will have problems since the OpenCV libs aren't compiled with the Intel compiler(they are compiled with VS2012 compiler).
So just for trying I switch the toolset flag to Intel Compiler 14.0 and it worked, I can run my app... and use openCV and IPP.
Can you please explain a little bit about why is this possible? is it the same for dynamic loading(*.dll)? or if I use openCV with dynamic loading I will need to compile them with Intel Compiler?
Thanks

A: Roughly. The compiler used to generate a given machine code does not really matters (except for the quality of the code). What is important is that some conventions are respected : format of object code files, naming external objects and ABI (the way functions are called).


text:
Q: how to make my ios App bigger(disk size) For some reason my boss think the bigger an IOS app is, the better it will be. I finish the app he wants but he thinks it's not good enough because it's on 13M. So what should I do, put a music in project?

A: You could add a big file that would not be used in app, an image, or just a data file with random data in it.
Or you could explain to your client that a smaller app is easier to download for the end user.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Adding [not just enabling] SeDebugPrivilege Having a terrible problem with both IE and Firefox on Win7, a few minutes after cold start or after exiting sleep, beginning a minute or two of intense disk activity, shutting out all other processes, even stopping cursor movement. Can't get to Task Manager to identify culprit, though it has to be IE or Firefox. Want to write a program that watches processes and pauses any process that hijacks the machine. Can EnumProcesses but cannot do OpenProcess or other SeDebugPrivilege related functions because my token, despite being administrator, does not have SeDebugPrivilege. That of course means AdjustTokenPrivileges is ineffective because it can't add privileges, just manipulate existing ones. Several threads on StackOverflow discuss this issue, one mentioning program RunWithDebugEnabled. All I want to do is the same as Visual Studio does: debug another process. How can I put SeDebugPrivilege into my existing token? Norton finds nothing; Norton forums not helpful. MalwareBytes finds nothing. Thanks.

A: Local Security API. Had to burn an MSDN support ticket to learn this. Seems incredible no one else was aware of it.


text:
Q: sitemap localization not working Strange things happening. If I have only one file filename.en-US.resx file in App_GlobalResources. Sitemap(Which is referring as "$resources:Web.sitemap,key") is throwing error that object or key couldnt find. But when i have two files filename.en-US.resx and filename.resx[this has no keys it is empty], sitemap is working fine. Please need some explanation.

A: I think you need to have a filename.resx that acts as the normal (invariant) resource before adding culture/language specific resource files.


text:
Q: Nvidia graphic drivers slowing system I installed ubuntu 12.10 first, and tried for 2 days.... everything looks great and problem started after I installed graphic drivers. I installed "additional drivers" software from software manager, and installed recommended drivers from there. After that it started slowing down my system frequently. It works fine for some time when I restart, I dont know why and when it starts again but it makes very slow like i have to wait 2 min to open my firefox browser completely.
I formatted my  system(only Linux) then installed 12.04. I am getting same problem here also after  installing graphic card drivers.
my system config: 2GB RAM, core2duo processor 2.80GHz, 500GB, NVIDIA GE force 9600GT(512mb) graphic card. I am using dual boot mode with Windows8
What could be the problem?
thanks


text:
Q: check whether json data array is empty or not This is my ajax code, I need to check whether json data has an array or not?
How can I?
I have tried this but yet it shows me wrong output.
$.ajax({
        url: url,
        type: 'POST',
        data: {'data': data},
        dataType: "json",
        success: function (data) {
          if(data)
          {
            console.log('data is there');
          }
          else
          {
            console.log('data is not there');
          }

This is response I am giving in return to ajax.
<?php
$json_data_array = '[]';
return $json_data_array;
?>

How can I check?

A: You need to check it's length. Array in condition if(array) is true when it has no items.

if([]) {
    console.log('True');
}

Check the length property

if([].length) {
   console.log('True');
}

A: In javascript you can check the length
  var size= myarray.length;
    if(size>=1)
    {
       alert("not empty");
    }
    else
    {
        alert("empty");
    }

In php you can check with the following method
if(!empty($myarray))
{
    echo "Not Empty";
}
else
{
    echo "Empty";
}

A: First you need to json encode your return value from php like this
<?php
$json_data_array = '[]';
return json_encode($json_data_array);
?>

Then you have to check the length of returned array at javascript side like this
if(data.length > 0){
  console.log('data is there');
}else{
  console.log('data is not there');
}

A: You can check by using below method:
if( Object.prototype.toString.call( your_variable ) === '[object Array]' ) {
    alert( 'Array' );
}else{
    alert('Not Array');
}

A: use and  echo json_encode($json_data_array);
build a normal array and then convert it to json it will be easier
<?php
$json_data_array = array();
echo json_encode($json_data_array);
?>

in your jquery use
if($.isEmptyObject(data))

A: In javascript empty array ([]) return true. You should check array.length


text:
Q: Copy the header for non blank values in the column by using R I have data set like

A header
Another header
Another header

1
6
NA

NA
Na
NA

5
NA
7

NA
NA
NA

NA
3.5
NA

Result I want is get copy headers for all non-blank values

header
Another header
Another header

header
Another header

header

Another header

Another header

Can any one help to get the codes for this problem

A: Maybe you can try the following base R option
df[] <- ifelse(!is.na(df), names(df)[col(df)], "")

which gives
> df
  A B C
1 A B
2
3 A   C
4
5   B

** Dummy Data**
> dput(df)
structure(list(A = c(1, NA, 5, NA, NA), B = c(6, NA, NA, NA,
3.5), C = c(NA, NA, 7, NA, NA)), class = "data.frame", row.names = c(NA,
-5L))


text:
Q: How to create the circumference simultaneously by defining the radius in SVG? I want to create a circle simultaneously by drawing the radius.
The following code draws the radius.
What do I need to add to the code, so that it creates the circle (with no fill etc. just the circumference with a black stroke) simultaneously as the radius is being defined ?

d3.select('body').append('svg');

function add(ink) {
  var c, p, rf = false,
    r = d3.svg.line().x(function(d) {
      return d[0];
    }).y(function(d) {
      return d[1];
    });

  ink.on('mousedown', function() {
    rf = true;
    c = d3.mouse(this);
    p = d3.select('svg').append('path').attr('d', r([c, c])).style({
      'stroke': '#000'
    });

  }).on('mouseup', function() {
    rf = false;
  }).on('mousemove', function() {
    if (rf) {
      l = r([c, d3.mouse(this).map(function(x) {
        return x - 1;
      })]);

      p.attr('d', l);
    }
  });
}

d3.select('svg').call(add);
<script src="https://d3js.org/d3.v3.min.js"></script>

A: I made a few updates to your code for the circle with radius of the current length of the line.

*

*add a new variable for the circle e.g. foo

*draw the circle on mousedown with radius of 1 (so it is not visible) - you can style with no fill and black stroke etc

*in the mousemove handler, compute the distance between the origin and the current mouse point (less 1) and make that the radius of the circle.

d3.select('body').append('svg');

function add(ink) {
  var foo; // some variable for your circle
  var c, p, rf = false,
    r = d3.svg.line().x(function(d) {
      return d[0];
    }).y(function(d) {
      return d[1];
    });

  ink.on('mousedown', function() {
    rf = true;
    c = d3.mouse(this);
    p = d3.select('svg').append('path').attr('d', r([c, c])).style({
      'stroke': '#000'
    });
    // create a circle with radius 1 on mousedown
    foo = d3.select('svg').append('circle')
      .attr('cx', c[0])
      .attr('cy', c[1])
      .attr('r', 1)
      .attr('fill', 'none')
      .attr('stroke', '#000');

  }).on('mouseup', function() {
    rf = false;
  }).on('mousemove', function() {
    if (rf) {
      // pt0 is origin; pt1 is mouse location -1
      var pt0 = c;
      var pt1 = d3.mouse(this).map(function(x) {
        return x - 1;
      });

      // your new line
      l = r([pt0, pt1]);
      p.attr('d', l);

      // formula for distance between two points
      var dx = Math.abs(pt1[0] - pt0[0]);
      var dy = Math.abs(pt1[1] - pt0[1]);
      var d = Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2));

      // set circle radius to distance between two points
      foo.attr('r', d);
    }
  });
}

d3.select('svg').call(add);
<script src="https://d3js.org/d3.v3.min.js"></script>


text:
Q: CSS selector performance - pseudo selectors CSS Selectors are parsed right to left, and then displayed.
With this in mind, based on this code:

Which is more performant?:
.myImage img

or
.myImage img:only-child

Does :only-child help specificity in selector selection? So instead of initially matching all  in the document then looking for the parent class, does it only match 's that are the only child (thereby reducing the pool of selections)?
reference read: http://csswizardry.com/2011/09/writing-efficient-css-selectors/
EDIT
Found further reading:

The sad truth about CSS3 selectors is that they really shouldn't be
  used at all if you care about page performance. Decorating your markup
  with classes and ids and matching purely on those while avoiding all
  uses of sibling, descendant and child selectors will actually make a
  page perform significantly better in all browsers.

-David Hyatt (architect for Safari and WebKit, also worked on Mozilla, Camino, and Firefox)
Source: http://www.stevesouders.com/blog/2009/03/10/performance-impact-of-css-selectors/

A: Alright, so this depends completely on the use case. What I'm going to do is handle cases.
Point 1 - Concerning given example

Case A
Say your code is simply:

In this case .myImage img and .myImage img:only-child will have essentially identical performance hits. Reason being is as follows:
CSS performance hits are derived from having to style or re-style boxes. What CSS does is affect your graphics processor, not the CPU, so we only care about visual updates. And styling things again with duplicate properties DOES cause a redraw (By this I mean duplicate properties that are applied at a later time, which selectors generally cause).
Usually, .myImage img would style ALL s in .myImage. While using the only-child selector may not style all (obviously).
But in this example, both .myImage img and .myImage img:only-child would do identical things, since they would both cause 1 draw/redraw on the same box.

Case B
But suppose we have:

Here though, we have a different story.
In this example, only-child wouldn't work at all, since  is not the only child.

Case C
Finally, suppose you have this, but you only want to style the  under the :

In this case, using the only-child selector would be significantly better performance-wise, since you only will style one element, instead of three.

Conclusion and Takeaway
Basically, remember a few things.

*

*CSS selectors help you with writing code because you get to add less IDs and Classes, however, they are almost always less efficient than using all IDs and Classes, because using selectors will causes extra redraws. (Since you'll inevitably style multiple elements with some selector, and then re-style other things with IDs or classes, causing unnecessary redraws)

*only-child is NOT faster than .class child if that .class only has one child.

*Technically what you are comparing are two completely different things, used for different purposes.
Conclusion
In final answer to your question. In your shown example, neither is more efficient than the other since they cause identical redraws.
However, as

"Does :only-child help specificity in selector selection?"

goes: Yes, that's the point of the selector. See: http://www.w3schools.com/cssref/sel_only-child.asp
Sources:
I am a significant volunteer developer for Mozilla Thunderbird and the Mozilla project and work in the CSS area.
FYI
There are of course weird exceptions to this, but I won't go over them here since I think your exact question doesn't give a brilliant example.
Point 2 - Concerning speed of find selectors
I am purposely trying to drive home the point that it is the drawing the causes the CSS perf hit, not finding the selectors. However, the reason I say this is not because finding selectors takes no time, but instead because it's time is miniscule to the time caused by drawing. That said, if you did have 5,000
s or something, and attempted to style a few using pseudo selectors, it would definitely a little longer than using CSS classes and IDs.
Again though, in your example it would make no difference, since it would look through each element anyway. Why only-child is helpful perf-wise is because it would stop searching for some element after it finds more than one child, whereas simply doing class child would not.
The problem with pseudo selectors is that they usually require a lot of extra searching AND it happens after IDs, classes, and such.
The links you provided are actually very helpful and I'm surprised they didn't answer your question.
One thing I should point out is that many selectors believed to be slow may be vastly improved now. See: http://calendar.perfplanet.com/2011/css-selector-performance-has-changed-for-the-better/
Remember selector performance is only important on very large websites.


text:
Q: stm32f103 ADC sampling rate I set adc sample time cycles here :
ADC_RegularChannelConfig(ADC1, ADC_Channel_17, 1, ADC_SampleTime_71Cycles5);

How to calculate sampling rate of ADC from that in stm32f103 ?

A: You haven't provided enough information to give an exact number. But here what you should know.
You have selected the sampling time to be 71.5 ADC clock cycles.
The ADC clock is generated by PCLK2 via the ADC prescaler. The ADC prescaler is in the RCC_CFGR register.
For example, if PCLK2 is 72MHz and ADC prescaler is 6, ADC clock is 12MHz. And the sampling time is 71.5 cycles which translates to 71.5/12 ~ 6us

A: Sample time for every channel can be calculated from ADC CLK as described in section "Channel-by-channel programmable sample time" of reference manual:

ADC samples the input voltage for a number of ADC_CLK cycles which can
  be modified us- ing the SMP[2:0] bits in the ADC_SMPR1 and ADC_SMPR2
  registers. Each channel can be sampled with a different sample time.
  The total conversion time is calculated as follows: Tconv = Sampling
  time + 12.5 cycles Example: With an ADCCLK = 14 MHz and a sampling
  time of 1.5 cycles: Tconv = 1.5 + 12.5 = 14 cycles = 1 μs

In scan mode sampling rate for one ADC is:

1/(summ of Tconv for every enabled channel)

To set "particular" sample time you can use external trigger conversion with timer update event as trigger.


text:
Q: Get radio button value onload and hide or show div I have the following jsfiddle setup:
http://jsfiddle.net/cvn6n/
Based on the radio selection a div is hidden or displayed (if audi is selected the div is hidden and if any other value is selected the div is displayed). The problem that I have is that I need to detect the initial value (onload) of the radio button and accordingly hide or display the div.
Audi <input type="radio" name="car" id="audi" value="3" checked="checked" onclick="toggle(this)">

Merc <input type="radio" name="car" id="merc" value="3" onclick="toggle(this)">

BMW <input type="radio" name="car" id="bmw" value="3" onclick="toggle(this)">

Not Audi

var t = document.getElementById('testdiv');

t.style.visibility = 'visible';
function toggle(switchElement) {
    if (switchElement.id != 'audi'){
        t.style.display = 'inline';
    }else{
        t.style.display = 'none';
    }
}

Thanks for the help in advance.
ps. no jquery please just pure js solution

A: [].forEach.call( document.forms.carform.car, function(radio){
      if( radio.checked ) {
          toggle( radio );
      }
});

http://jsfiddle.net/cvn6n/1/

A: From your example, noticed I moved the active value to Merc, also notice you should set display: none on your testdiv when you initialize it:
Audi <input type="radio" name="car" id="audi" value="3" onclick="toggle(this)">

Merc <input type="radio" name="car" id="merc" value="3" checked="checked" onclick="toggle(this)">

BMW <input type="radio" name="car" id="bmw" value="3" onclick="toggle(this)">

Not Audi

For the javascript, you can put the section I added to window.onload or at the bottom of your page, so it fires after the DOM has finished loading.  Basically, it goes through the list of provided ids to check, and sets toggle() for the active one.
var t = document.getElementById('testdiv');

t.style.visibility = 'visible';
function toggle(switchElement) {
    if (switchElement.id != 'audi') {
        t.style.display = 'inline';
    }else{
        t.style.display = 'none';
    }
}

var listOfIds = new Array("audi", "merc", "bmw");
for (x in listOfIds) {
    var element = document.getElementById(listOfIds[x]);
    if (element.checked) {
        toggle(element);
    }
}


text:
Q: Why pagination shows all the records of the table on every page? I have added pagination as follows to my laravel project. But all the pages display the same content.
Think that there are 8 records in the employee table. When I added the below code, on the first page it displays all 8 records, and on the second page also it displays the same 8 records.
It doesn't break the first 5 records to the first page and last 3 records to the second page.
controller
public function all()
{
    $data = DB::table('employees')->paginate(5);
    $employeeshow = employee::all()->toArray();
    return view('employee.index', compact('employeeshow', 'data'));
}

index.blade.php

           First Name
           Last Name

       @foreach($employeeshow as $row)

           {{$row['firstname']}}
           {{$row['lastname']}}

       @endforeach

      {{ $data->links() }}

I want to display the first 5 records on the first page, next 5 records on the second page likewise. Help me. Thank you

A: Your code does not make much sense, you are fetching all employees from the database with $employeeshow and looping through them, but then you are getting a different set of employees from the database with $data and paginate them, so it does not matter which page you open, you are always looping through $employeeshow which will always contain the same employees.
I would do the following instead:
Controller:
public function all()
{
    $employees = employee::paginate(5); // why is your model lowercase?

    return view('employee.index', compact('employees'));
}

View:

            First Name
            Last Name

        @foreach($employees as $employee)

                {{ $employee->firstname }}
                {{ $employee->lastname }}

        @endforeach

    {{ $employees->links() }}

You can read more about pagination in the docs.

A: Instead of using $employeeshow please try $data in your foreach loop.
Your paginated value stored in $data not in the $employeeshow.


text:
Q: Derivative of distributions inner product The dot product of two distributions $u(s)$ and $v(s)$, for $s$ the parametric coordinates, is written as $u(s)^{\intercal} \, v(s)$. What would a closed form for the derivative $\frac{\partial}{\partial s} \left( u(s)^{\intercal} \, v(s)\right)$ be? My confusion constitutes on the following, for i from 1 to the dimension of $s$:
$\frac{\partial}{\partial s_i} \left( u(s)^{\intercal} \, v(s)\right) = \sum\limits_i \left[\left(\frac{\partial}{\partial s_i} u_i\right) \, v_i + u_i \, \left(\frac{\partial}{\partial s_i} v_i\right) \right]$
Example: $\frac{\partial}{\partial [x \, y]^{\intercal}} \begin{bmatrix} x & y \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} 2x \\ 2y \end{bmatrix}$

A: The derivative $\frac{\partial f}{\partial s}$ of $f(s) = u(s)^\top v(s)$ can be presented either as a row vector or a column vector. If it is presented as a row vector, then we have
$$
\frac{\partial f}{\partial s} = \pmatrix{\left[\frac{\partial u}{\partial s_1}\right]^Tv + u^T\left[\frac{\partial v}{\partial s_1}\right] &
 \cdots &
\left[\frac{\partial u}{\partial s_d}\right]^Tv + u^T\left[\frac{\partial v}{\partial s_d}\right]}.
$$
We note that
$$
\left[\frac{\partial u}{\partial s_k}\right]^Tv + v^T\left[\frac{\partial u}{\partial s_k}\right] = \sum_{i=1}^d \left(\frac{\partial u_i}{\partial s_k}v_i + u_i\frac{\partial vI}{\partial s_k} \right).
$$
This can also be written as
$$
\frac{\partial f}{\partial s} = \left[\frac{\partial u}{\partial s}\right]^Tv + u^T\left[\frac{\partial v}{\partial s}\right],
$$
where $\frac{\partial u}{\partial s}$ denotes the matrix
$$
\frac{\partial u}{\partial s} = \pmatrix{\frac{\partial u}{\partial s_1} & \cdots & \frac{\partial u}{\partial s_d}}.
$$


text:
Q: I have been trying to log request/response using Play Framework but i am not able to log response but request in logging This the filter i am using.

package filters;
import java.util.concurrent.CompletionStage;
import java.util.function.Function;
import javax.inject.Inject;
import akka.stream.Materializer;
import play.Logger;
import play.mvc.*;

public class LoggingFilter extends Filter {

    @Inject
    public LoggingFilter(Materializer mat) {
        super(mat);
    }

    @Override
    public CompletionStage<Result> apply(
            Function<Http.RequestHeader, CompletionStage<Result>> nextFilter,
            Http.RequestHeader requestHeader) {
        long startTime = System.currentTimeMillis();
        return nextFilter.apply(requestHeader).thenApply(result -> {
            long endTime = System.currentTimeMillis();
            long requestTime = endTime - startTime;

            Logger.info("{} {} {} took {}ms and returned {}",
                    requestHeader.method(), requestHeader.getHeaders().toMap(), requestHeader.uri(), requestTime, result.status());

            return result.withHeader("Request-Time", "" + requestTime);
        });
    }

    public CompletionStage<Result> Response(
            Function<ResponseHeader, CompletionStage<Result>> nextFilter,
            ResponseHeader responseHeader) {
        long startTime = System.currentTimeMillis();
        return nextFilter.apply(responseHeader).thenApply(result -> {
            long endTime = System.currentTimeMillis();
            long responseTime = endTime - startTime;

            Logger.info("{}  took {}ms and returned {}",
                    responseHeader, responseTime, result.status());

            return result.withHeader("Request-Time", "" + responseTime);
        });
    }

}

I know i created wrong method for response but i also new to this java and filter. but i am stuck here if anyone aware of mdc/interceptor method for play framework kindly help for the same.
Thanks


text:
Q: Many to many SQL generation statements in Django 1.4 The django1.4 release notes say:

*

*The many to many SQL generation functions on the database backends will be removed.

Can somebody point me to these functions? Where are they located?
thanks!

A: It was removed in django 1.4, but you can see the code (and deprecation warning) in the django 1.3 source code.


text:
Q: How to easily test cocoa app on different version of mac osx? I have a macbook air 2011 version and have 10.8.x installed on it. I used xcode 4.6 to develop an app, I tested it using this machine and worked perfectly fine.
I want my app to support 10.6 (snow leopard) and 10.7 (lion) as well (I set my deployment target to 10.6 and base sdk to 10.7) , so in order to test it, I compiled my app using my macbook (again, 10.8 mountain lion) and copy the app to my other 10.6 machine (hackintosh).
Testing on 10.6 is a pain in the butt, I have learnt a few tricks tried to make the testing easier (ie. implementing redirectConsoleLogToDocumentFolder so that all NSLog will be added to the console.log), however sometimes my app will cause a segmentation fault, which can't be caught by try catch, and I really had no clue what caused the problem.
My questions are:
1. how to easily test my app (with ARC enabled) on a 10.6 machine without xcode? I have installed xcode 4.2 on snow leopard, however it doesn't support arc and couldn't compile, even I downloaded the 10.7 sdk and put it into my xcode folder.

2. are there any other tricks you can share with me, to make the testing on 10.7/10.6 easier?


text:
Q: Double unquoting for dynamically generated macros Given the following:
  for fn_name <- [:foo, :bar, :baz] do
    defmacro unquote(fn_name)(do: inner) do
      fn_name = unquote(fn_name) # <--- Why?
      quote do
        IO.puts "#{unquote(fn_name)} called"
        unquote(inner)
      end
    end
  end

What's the reason for fn_name = unquote(fn_name)? If I omit this line, it's a compile error. What's the reason for this "double" unquoting?

A: Let's simplify the example a little bit:
for fn_name <- [:foo, :bar, :baz] do
  defmacro unquote(fn_name)(do: inner) do
    fn_name = unquote(fn_name) # <--- Why?
    quote do
      {unquote(fn_name), unquote(inner)}
    end
  end
end

In the example above, because quote is returning a tuple with two unquoted elements, it is equivalent to:
for fn_name <- [:foo, :bar, :baz] do
  defmacro unquote(fn_name)(do: inner) do
    fn_name = unquote(fn_name) # <--- Why?
    {fn_name, inner}
  end
end

Now it is easier to understand what happens if you don't unquote(fn_name) before: the variable fn_name simply wouldn't exist inside the macro definition. Remember that all defs (def, defp, defmacro, etc) start a new variable scope, so if you want to use fn_name inside, you need to define it somehow.
The other property we are seeing in this code is that Elixir will stop unquoting when it sees a quote. So in the quote above, unquote won't be unquoted when the macro is defined but rather when the macro is executed, which also explains why the variable is required to be defined inside the macro.

A: It's because of Hygiene.
Elixir has the concept of macro hygiene. Hygiene means that variables, imports, and aliases that you define in a macro do not leak into the caller's own definitions.
for fn_name <- [:foo, :bar, :baz] do
    defmacro unquote(fn_name)(do: inner) do
      fn_name = unquote(fn_name) # <-- This is macro's context
      quote do
        IO.puts "#{unquote(fn_name)} called" # <-- This is caller's context
        unquote(inner)
      end
    end
  end

You should read Hygiene Protects the Caller's Context from Chris McCord's Metaprogramming Elixir book


text:
Q: react navigation type for typescript in component screen props I have a warning or error for navigation props in component screen
export default function FoodMenuList({ navigation }) {}

because I dont assign type for navigation
Binding element 'navigation' implicitly has an 'any'
I tried to search navigation props type for react navigation, but I dont find
what is react-navigation navigation props type?
or may be?
export default function FoodMenuList({ navigation }: {navigation: {navigate:Function}}) {}

or may be there is better solution?

A: According to the documentation provided by react-navigation https://reactnavigation.org/docs/typescript/#type-checking-screens

To type check our screens, we need to annotate the navigation prop and the route prop received by a screen. The navigator packages in React Navigation export a generic types to define types for both the navigation and route props from the corresponding navigator.

For example, you can use NativeStackScreenProps for the Native Stack Navigator.
import type { NativeStackScreenProps } from '@react-navigation/native-stack';

type RootStackParamList = {
  Home: undefined;
  Profile: { userId: string };
  Feed: { sort: 'latest' | 'top' } | undefined;
};

type Props = NativeStackScreenProps<RootStackParamList, 'Profile'>;

This allows us to type check route names and params which you're navigating using navigate, push etc. The name of the current route is necessary to type check the params in route.params and when you call setParams.

Then you can use the Props type you defined above to annotate your component.
For function components:
function ProfileScreen({ route, navigation }: Props) {
  // ...
}

A: try the useNavigation hook from @react-navigation/native, check the docs useNavigation

useNavigation is a hook which gives access to navigation object. It's useful when you cannot pass the navigation prop into the component directly, or don't want to pass it in case of a deeply nested child.

you can also write
interface Props {
  navigation: NavigationType;
}

FoodMenuList({ navigation }: Props)

if you're using class component or you don't wont to use useNavigation


text:
Q: Добавить a href Есть код, как добавить к  $('#openphone').html(data.phone); ссылку на телефон
 $('.btn-phone').click(function (e) {
        var el=$(this);
        var id=el.attr('id');
        var href=el.attr('href');
        if(href == '#'){
            $.ajax({
                type: "GET",
                url: TPL_PATH + "ajax_data/phone/",
                cache: false,
                data: 'data='+id,
                success: function(data){
                    if(data){
                        if(data.hide == '1'){
                            alert(TPL_L_00);
                        }else{
                            if(data.phone != ""){
                                $('#openphone').html(data.phone);
                            }
                        }
                    }
                }
            });
            e.preventDefault();
        }

    });

A: Я не знаю, правильно ли отрабатывает весь код, но ссылку на телефон надо добавлять с приставкой tel
...
$('#openphone').html('' + data.phone + '');
...

A:
$('#openphone').html(data.phone);

$('#openphone').html($('').attr('href', 'tel:' + data.phone).text(data.phone));


text:
Q: How to reference go-flag IsSet, functional code example needed New to Go, and having a basic conceptual problem (I think)...
Trying to use github.com/jessevdk/go-flags and have it mostly working.  --help and whatnot are working fine, flags are being passed, etc.
I need to understand if a option was set via a flag or via go-flags parser using the provided default value.  It appears go-flags has an "IsSet" function, but I'm clueless how to reference it.  Presume:
var opts struct {
    Port int `short:"p" long:"Port" description:"IP port" default:"1111"
}
_, err := flags.Parse(&opts)

I can reference the value via "opts.Port", but how can I find out if the option was set via a flag or default?   Many thanks in advance!

A: Figured this out:
parser := flags.NewParser(&opts, flags.Default)
o := parser.FindOptionByLongName("Port)
if o.IsSet() {}
Problme is that IsSet() is true if the flag was used on the command line OR if it was set via the default.
So solved the surface problem of referencing IsSet() but still hunting for an ability to tell which occured, since I want the flag defaults to show in --help.

A: Go newbie here as well. IsSetDefault() is also available. (Perhaps, it was added since you asked and answered your question.)


text:
Q: What "visitors" count towards the publicity badges? I was just thinking about these badges and how exactly your number of visitors is calculated. Really, this boils down into three key groups which you could gain counts from:

*

*New visitors: Those who are viewing it for the first time, never seen it before.

*Old visitors: Those who have viewed it before, but not via your referral link.

*Bots: Automated services that just crawl links.
So thinking about this, what visitors actually count towards the badges? Do they have to be new visitors which haven't been counted in the views total for the question yet? Do bots count? Theoretically everyone could get ~10 easy views just by posting the link anywhere and letting Google, Yahoo, etc crawl their link and "view" the page, even though they may have already crawled and indexed that page many, many times before that.
The only thing I've seen is that referral hits that come from the Stack Exchange network do not count. Is there any other kind of limitation?


text:
Q: Comparing regression coefficients across groups in multinomial logistic regression Suppose that I fit a Bayesian multinomial logistic regression model where the dependent categorial variable indexes $x$ groups, and the predictors are the same across groups. I now have $x - 1$ sets of $p$ regression coefficients and want to compare the regression coefficients of one of the groups to the two others. One simple ad hoc way to do this is to compare the posterior distributions of the coefficients. But I'm sure there is a better way. Thanks.

A: It's not quite clear to me how you've set things up, but I have a feeling that you've bumped into this problem in which case the different sets of coefficients are not necessarily comparable at all without extra assumptions about the unobserved heterogeneity.


text:
Q: read from .txt the third coordinate using c++ I have a .txt file with the real coordinates of points. The scenario is the camera facing a wall; between them I have a box.
I want to get in the .txt only the points refering to the box, so I want to read the third component from coordinates, meaning depth value and if it's bigger than a certain distance to supprime all the line.
file.txt
0.005545 0.06564 1.6354
0.235443 0.35464 2.6575
if(value>2.5)
{
   delete line from .txt completely
}
all the coordinates are separated with a white space and lines with an intro.
thanks

A: I think this will work:
#include <fstream>
#include <vector>
#include <iterator>
#include <algorithm>

#define THRESH 2.5f

using namespace std;
int main()
{
    vector<float> DataArray;

    ifstream myfile("test.txt");

    copy(istream_iterator<float>(myfile),
         istream_iterator<float>(),
         back_inserter(DataArray));
    myfile.close();

    ofstream newfile("test.txt");

    for(int i = 2; i < DataArray.size(); i += 3)
    {
        if(DataArray[i] < THRESH)
        {
            for (int j = i-2; j <= i; ++j)
                newfile << DataArray[j] << "  ";
            newfile << endl;
        }
    }

    myfile.close();
    return 0;
}

A: Use the std::ifstream to read from a file.
std::string line;
std::ifstream input_file;

input_file.open("input_file.txt");

// Read the file one line at a time
while (std::getline(input_file, line))
{
    // Do your thing
}

input_file.close();

Hint: Write a new file and rename later.


text:
Q: Docker Swarm : how to fix a swarm network name I'm using Docker swarm ,
There , within my docker-compose file i'm declaring a netwrk configuration:
services:
  myservice:
    ...
    networks:
     - myNetwork
    ...
networks:
  myNetwork:
     driver : overlay

After that i'm running : docker stack deploy myStack -c myComposefile.yml
The probleme that the resulting network is this :
    NETWORK ID          NAME                  DRIVER              SCOPE
    nu0iykhv5ewn        myStack_myNetwork     overlay             swarm

My problem is in the name of this network : "myStack_myNetwork"
How may i fix it to be only : "myNetwork"
Since i'm reusing this network in other stacks.
Suggestions ?

A: Create your shared network with docker network create (doc here) and define the network in the docker compose file as external (doc here)


text:
Q: Gradle copy task after build In Gradle it is easy to define tasks to run after the build.
task finalize1 << {
    println('finally1!')
}
build.finalizedBy(finalize1)

This works as expected. But now I want to execute a copy task at the end.
task finalize (type: Copy) {
    def zipFile = file('data/xx.zip')
    def outputDir = file("data/")
    println('Unzip..')
    from zipTree(zipFile)
    into outputDir
}
build.finalizedBy(finalize)

This does not work anymore. I see the "Unzip" output at the beginning of the build (I need the extract at the end).
Unzip..
:clean
:compileJava
:processResources
:classes
:findMainClass
:jar
:bootRepackage
:assemble
...

<< does the trick it seems but how I can I merge these two?

A: You don't have to. You see Unzip... at the beginning of the build, but it does not mean that Gradle is executing your task at that moment.
This message is printed in console when Gradle starts to configure your copy task, e.g. adding paths to inputs and outputs. Real execution is done after build. To verify that you can use doLast closure:
task finalize (type: Copy) {
   doLast { println 'running now' }
   ...
}

Code inside doLast block will be executed after build.
P.S. Don't move the rest of your task code (from zipTree(zipFile), etc) inside doLast closure, it won't work.


text:
Q: Parse.com ListView OnClickListener Passes Dynamic ImageView I am facing a problem with onItemClickListener. I have a ListView which contains strings as well as two images from parse.com table. I want to show the strings and images (that i have pushed in parse.com database) in another activity after I click on any item. I successfully get all the strings using getIntent() but I'm not able to find the solution to fetch the images from ListView item dynamically.
What is the best way to acomplish this?

A: In this case, the click event can provide the file Url's string value to another activity via the putExtra
look at the docs for calling $FileObj.'getUrl' that retrieves url as Type string
working with images in persistence you should store both full-sz and thumb-sz, working with the thumb in list-adapter context.
So, if u have store the bitmap for the thumbs file on parse, with "getUrl" you can operate on the URL value of the file( its useful in frameworks like 'Volley')
Read up on using adapters particularly "getView" to load the bitmap whenever you need to provide the bmp to a list adapter from your image lib.
Pass the File-Url-string to new activity in "Extra String Value"
Use Volley for your networking/file retreival and bitmap caching. bit of a guess but Volley and parse should be OK.


text:
Q: VB.NET 2013 Crystal Report print to printer directly without displaying I am working on VB.Net 2013 + Crystal Reports project. The task is to fetch invoice data from MSSQL as per user criteria and directly print it to a pre-defined printer. While doing that the layout of the invoice is to be used as provided by the client. So this was done in Crystal Reports.
The issue is how to print a crystal report directly to a printer without displaying any report on screen.
Please advise.

A: I found an alternate solution to this question. I used Commandline Switches for Adobe Acrobat from this site:  https://www.robvanderwoude.com/commandlineswitches.php#Acrobat
Using this switch, I can send a PDF to a any physical printer. The PDF creation however is done using BullPDF printer (http://www.bullzip.com/products/pdf/info.php) which is a Free PDF printer application.
So the full logic is as follows:

*

*Have a custom report designed per customer specifications in Crystal Reports 2013

*Print the report from Crystal Reports to a PDF Printer using the following code:
Private Sub RunReport()
        Dim CryRpt As New ReportDocument
        Dim crTblLogInfos As New TableLogOnInfos
        Dim crTblLogInInfo As New TableLogOnInfo
        Dim crConInfo As New ConnectionInfo
        Dim crTables As Tables
        Dim crTable As Table
    With crConInfo
        .ServerName = ServerName
        .DatabaseName = DBName
        .UserID = UID
        .Password = Pwd
    End With

    CryRpt.Load(FPath & "rptLink.rpt")

    crTables = CryRpt.Database.Tables
    For Each crTable In crTables
        crTblLogInInfo = crTable.LogOnInfo
        crTblLogInInfo.ConnectionInfo = crConInfo
        crTable.ApplyLogOnInfo(crTblLogInInfo)
    Next
    CryRpt.PrintOptions.PrinterName = "Bullzip PDF Printer"
    CryRpt.PrintToPrinter(1, False, 0, 0)

    OrdersLinking.DocPrinted = True
    Me.Close()

End Sub

*The above step would save the report as a PDF to a pre-defined folder as mentioned in Bull PDF Printer. Now send the PDF Files to the physical printer using the following commands as mentioned on https://www.robvanderwoude.com/commandlineswitches.php#Acrobat
Print a PDF file silently:
AcroRd32.exe /N /T PdfFile PrinterName

Mission Accomplished.


text:
Q: Node js - Encrypt and Decrypt File
I want to encrypt File on client side and send it to server side and
  decrypt

But When I am using node js inbuilt crypto I am getting Error
client.js
const crypto = require('crypto');
const cipher = crypto.createCipher('aes192', 'a password');
const encInput = fs.createReadStream("abc.txt");
const encOutput = fs.createWriteStream("abc.txt.enc");

       encInput.pipe(cipher).pipe(encOutput).on('close', function() {
         // DATA SENT TO SERVER SIDE
         //USING PIPELINE TO SEND DATA TO SERVER
       });

This part is done perfectly it creates an ecrypted file on client side and sends it to server side
Server.js
//receive Data
//AFTER RECEIVING FILE ON this side I run decrypt script
const crypto = require('crypto');
const decipher = crypto.createDecipher('aes192', 'a password');

const decInput = fs.createReadStream("abc.txt.enc");
const decOutput = fs.createWriteStream("abc.txt");
decInput.pipe(decipher).pipe(decOutput);

And this gives an error
Error: error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length
    at Decipher._flush (internal/crypto/cipher.js:141:28)
    at Decipher.prefinish (_stream_transform.js:141:10)
    at Decipher.emit (events.js:182:13)
    at prefinish (_stream_writable.js:630:14)
    at finishMaybe (_stream_writable.js:638:5)
    at afterWrite (_stream_writable.js:481:3)
    at onwrite (_stream_writable.js:471:7)
    at Decipher.afterTransform (_stream_transform.js:94:3)
    at Decipher._transform (internal/crypto/cipher.js:136:3)
    at Decipher.Transform._read (_stream_transform.js:190:10)
    Emitted 'error' event at:
    at Decipher.onerror (_stream_readable.js:687:12)
    at Decipher.emit (events.js:182:13)
    at done (_stream_transform.js:208:19)
    at _flush (_stream_transform.js:142:7)
    at Decipher._flush (internal/crypto/cipher.js:143:5)
    at Decipher.prefinish (_stream_transform.js:141:10)
    [... lines matching original stack trace ...]
    at afterWrite (_stream_writable.js:481:3)

I know there is no problem on client side it is working perfectly sending data using pipeline socket
**No problem in receiving data too on server side only the decryption is creating problem and idk why **

Anything else you want to know about my code please tell
Using Node v10.6.0

A: Try with initialization vector and base64 file storage format:
const crypto = require('crypto');
const path = require('path');
const fs = require('fs');
const base64 = require('base64-stream');
const iv = new Buffer('1065faf25ac8560968c58ce6dc0ae36f', 'hex'); // 16 byte iv
const kk = new Buffer('84521db468d282c4ce21cdde65e508ce3d1924d1be5c4754', 'hex'); // 24 byte key (192 bits)
const cipher = crypto.createCipheriv('aes192', kk, iv, { encoding: 'base64' });
const encInput = fs.createReadStream(path.join(__dirname, "abc.txt"));
const encOutput = fs.createWriteStream(path.join(__dirname, "abc.txt.enc"));

encInput.pipe(cipher).pipe(encOutput).on('close', function () {
    const decipher = crypto.createDecipheriv('aes192', kk, iv);
    const decInput = fs.createReadStream(path.join(__dirname, "abc.txt.enc"));
    const decOutput = fs.createWriteStream(path.join(__dirname, "abc.txt.dec"));
    decInput.pipe(base64.decode()).pipe(decipher).pipe(decOutput);
});


text:
Q: Best practice for Oracle DBMS_CRYPTO AES encryption I'm tasked to create encryption/decryption methods inside an Oracle database. By researching I came up to this SO discussion which provides a great code example using the DBMS_CRYPTO package.
However there is a security concern: in this design, the KEY/IV pair, the encryption algorithm, and the encrypted data are all stored in one place (the database). Making it too easy for gathering all the necessary pieces to get the real value.
For some reason the management turned down the option to store the keys outside Oracle db. The reason is occasionally we need to provide a data dump to the client. They cannot have encrypted data and they cannot decrypt it. The data dump is done by SQL so the decryption can be performed in the SELECT query.
Is there a best practice for this scenario?
Thank you for your time.


text:
Q: Send/recieve data with Quectel Bt client and a device Good morning.
I have a Quectel MC60 bt and a pulsioxymeter which has a service with two characteristics.
If I send the command "AA14EB00000000C6" to write charasteristic from my mobile, the pulsioxymeter responds me with the next general data.
Now I need to replicate exactly this but using Quectel MC60 Bt as client.
I have followed all the steps in the datasheet and I able to scan near devices, connect to my pulsioxymeter, list and check every services/feature, register to recieve notificacions and send the command to see the general data but in this point I don´t recieve data/notifications like in my mobile.
I add the secuence I´m using it.
AT+QBTGATCREG=1,"B001"
+QBTGATCREG: 1,0,"B001"
OK

AT+QBTGATCSCAN=1,"B001"
+QBTGATCSCAN: 1,0,"B001"
OK

+QBTGATCSCAN: "B001",1681EFC323DB,74,02010604FF4EF3000C094F78796669742032313835

AT+QBTGATCSCAN=0,"B001"
+QBTGATCSCAN: 0,0,"B001"
OK

AT+QBTGATCCON=1,"B001",1681EFC323DB,1
OK

+QBTGATCCON: 1,0,"B001",1681EFC323DB,1
+QBTGATCCON: 1,0,"B001",1681EFC323DB,2
+QBTGATCCON: 1,0,"B001",1681EFC323DB,3
+QBTGATCCON: 1,0,"B001",1681EFC323DB,4
+QBTGATCCON: 1,0,"B001",1681EFC323DB,5
+QBTGATCCON: 1,0,"B001",1681EFC323DB,6
+QBTGATCCON: 1,0,"B001",1681EFC323DB,7

AT+QBTGATCSS="B001",1
OK

+QBTGATCSS: 0,"B001",1,"0018",0,1
+QBTGATCSS: 0,"B001",1,"0118",0,1
+QBTGATCSS: 0,"B001",1,"59FE",0,1
+QBTGATCSS: 0,"B001",1,"0A18",0,1

+QBTGATCSS: 0,"B001",1,"3923CF407316429A5C417E7DC49A8314",0,1

AT+QBTGATCGC="B001",1,"3923CF407316429A5C417E7DC49A8314",0,1
OK

+QBTGATCGC: 0,"B001",1,"3923CF407316429A5C417E7DC49A8314",0,1,"A3E1260AEE9AE9BBB0490BEBE7AC008B",0,4

AT+QBTGATCGD="B001",1,"3923CF407316429A5C417E7DC49A8314",0,1,"579A054352CDB1A61A4BE7A84A593407",0
OK

+QBTGATCGD: 0,"B001",1,"3923CF407316429A5C417E7DC49A8314",0,1,"579A054352CDB1A61A4BE7A84A593407",0,"0229",0

AT+QBTGATCRN=1,"B001",1681EFC323DB,"3923CF407316429A5C417E7DC49A8314",0,1,"579A054352CDB1A61A4BE7A84A593407",0

+QBTGATCRN: 1,1,"B001",1681EFC323DB,"3923CF407316429A5C417E7DC49A8314",0,1,"579A054352CDB1A61A4BE7A84A593407",0
OK

AT+QBTGATCWD="B001",1,1,"3923CF407316429A5C417E7DC49A8314",0,1,"579A054352CDB1A61A4BE7A84A593407",0,"0229",0,"0100",0
OK

+QBTGATCWD: 0,"B001",1,"3923CF407316429A5C417E7DC49A8314",0,1,"579A054352CDB1A61A4BE7A84A593407",0,"0229",0

AT+QBTGATCRC="B001",1,"3923CF407316429A5C417E7DC49A8314",0,1,"A3E1260AEE9AE9BBB0490BEBE7AC008B",0,0
OK

+QBTGATCRC: 0,"B001",1,"3923CF407316429A5C417E7DC49A8314",0,1,"A3E1260AEE9AE9BBB0490BEBE7AC008B",0,"AA"

AT+QBTGATCWC="B001",1,1,"3923CF407316429A5C417E7DC49A8314",0,1,"A3E1260AEE9AE9BBB0490BEBE7AC008B",0,"C600000000EB14AA",0
OK

+QBTGATCWC: 0,"B001",1,"3923CF407316429A5C417E7DC49A8314",0,1,"A3E1260AEE9AE9BBB0490BEBE7AC008B",0

AT+QBTGATCRD="B001",1,"3923CF407316429A5C417E7DC49A8314",0,1,"579A054352CDB1A61A4BE7A84A593407",0,"0229",0,0
OK

+QBTGATCRD: 0,"B001",1,"3923CF407316429A5C417E7DC49A8314",0,1,"579A054352CDB1A61A4BE7A84A593407",0,"0229",0,"0000"

When i read the value of the descriptor it is "0000" when it should be "0100" that is the value that i wrote in the previous step.
I have tried to send the command to other characteristic, send other command, modify the secuence of at command, reverse the characters of command.
Thank you for your time and help.


text:
Q: Using `ResHelper` to get resource string uses thread culture not LocalizationContext Using Kentico CMS with a multi culture site, we have custom code to get a resource string,  when we use ResHelper.GetString("someKey") it does not use LocalizationContext.CurrentCulture version of the string, it is always defaulting to the US culture.
When I pass in the culture code to use as the second parameter using Localization.CurrentCulture.CultureCode it returns the correct string?
Using a quick watch and breakpoint at the code, I can see that Thread.CurrentThread.CurrentCulture and CurrentUICulture are both set to US whilst LocalizationContext.CurrentCulture is set to which ever version of the website we are viewing.
Why wouldn't Kentico set the Thread culture if resource strings rely on it?
We have used many resource strings throughout the site, some are using built in cms controls <cms:LocalizedLabel ResourceString="someKey" /> - how do these controls work?
Thanks


text:
Q: VMware player unity with ubuntu 11.10 guest on W7 host - empty applications start menu I am trying to run Ubuntu 11.10 as a guest on Windows 7. When I enter into unity mode, the menu for the guest os, next to the Windows start menu is empty. I have searched around the web for a fix for this, but there doesn't seem to be anything that works.
I have tried restarting the guest os several times, I am running VMware player as an admin, but the guest start menu in unity mode is still empty.
I have tried clearing the VM cache.
I have installed all the Ubuntu updates and the VMware tools.
Has anyone had this problem?

A: I had this issue as well and clearing the cache did not help. However I re-installed the vmware tools on the guest OS and then after a reboot and enter of unity mode the menu in the host OS started displaying the items again.
The guest OS was installed using easy mode so the vmware tools were automatically installed, while the menu worked for a short while originally the only way I could get them to reappear after the disappearance was to manually re-install them.


text:
Q: How do I control how a Xamarin Forms button scales its Image property? I'm updating our app from Xamarin Forms 2.1.0.6524 to 2.3.4.224. There were some minor UI glitches I've been able to fix, but one is stumping me.
Part of our app displays several buttons that have an Image property set. The images are all 90x90 pixels. In Xamarin Forms 2.1.x, it seems like the image was scaled down to fit a height that is reasonable for the text, roughly 40 pixels. In 2.3.4.224, the image is displayed at its natural size of 90px which is way too big.
I'm trying to figure out why this changed, it feels like the original code was wrong and we should've done something to constrain the size of the images. I don't see any convenient way to control the size or scale of the image in the Button control. Is there away around this? Did I find a bug, or were we a victim of a bug before?
(So far it seems unique to iOS, but we have a custom renderer for this button type on Android and it does look like we do some voodoo for scaling there. When I tried an experimental new application what I found was:

*

*Android displayed the image with 90px whether I used old or new XF.

*iOS displayed with 40px if I used old XF and 90px with new XF.)

A: I think the constrained size must have been a bug in the older version of Xamarin Forms. I think there are multiple ways to fix the problem:

*

*Recreate the real images to proper size

*Create a custom renderer for iOS as well with custom sizing options

*Use ImageButton from XLabs: https://github.com/XLabs/Xamarin-Forms-Labs/wiki/ImageButton

*Use other elements instead of Button. For example Horizontal StackLayout with Image and Label inside and make a TapGestureHandler for the StackLayout (you won't get the button animations then though)

*Constrain the height with HeightRequest on the Button element (clips the image, not a good solution)

My suggestion is to go with the first option if possible. Properly sized real images give the best look. Scaling images in an application will always make them look worse.


text:
Q: Ethernet Frames and CSMA/CD I'm learning about Ethernet and I'm wondering if with several stations within the same Ethernet collision domain like pictured below, is it possible that a frame sent by station A is fully received by station B before a collision is detected (due to C or some other station also transmitting) and a jam signal is sent? In other words, can a station receive the same frame multiple times due to retransmissions?
-----------------------
|   |                 |
A   B                 C

A: Note that this is a historic issue without any significance to modern network infrastructures. Ethernet networks are typically built with switches / bridges which create a single Ethernet collision domain for each connected station and typically operate in full-duplex mode, without ever employing CSMA/CD. Ethernet standards newer than 1000BaseX have dropped CSMA/CD and half duplex operation entirely.
But concerning the core of your question: there are a number of factors defined in the Ethernet standards preventing this from ever happening:

*

*the minimal frame length for Ethernet, which is 64 Bytes for everything up to 100BaseX, resulting in at least 512 bit times of transfer and is extended by padding to 512 Bytes for 1000BaseX (carrier extension)

*the maximum span for an Ethernet collision domain (2500m for 10Base5 and 205m for 100BaseT)

*the minimum nominal velocity of propagation for the signal in Ethernet cabling

*the maximum number of repeaters between every two Ethernet stations (4 with 10BaseX, 2 with 100BaseX)

*the maximum latency induced by a single repeater

Combined, this would ensure that a frame's transmission is never more than half finished before the frame start has reached the farthest edge of the Ethernet collision domain. The other half of the transmission time is being reserved for the collision signal to propagate back through the network, so collision detection is guaranteed to work under all circumstances.
Further reading: Charles E. Spurgeon, Ethernet: The Definitive Guide; Vijay Moorthy, Gigabit Ethernet


text:
Q: Keep Sidebar From Pushing Down Content, Put in Middle on Small Screens I'm having trouble with a right-sidebar of varying heights pushing down other content that's on the left, like this:
.
My main content is in a col-md-9 div, the sidebar is in a col-md-3 div, and comments should be right below the main content in another col-md-9 div. Right now if the sidebar is extra long, the comments get pushed down so they start on the left where the sidebar ends on the right. However, when I make the screen small, the flow is correct: main content, content from sidebar, and comments, like this:
.
I've tried adding rows, getting rid of rows, changing up the order of the divs, and changing float directions. What can I do to get rid of the extra space and to still have the three divs go into the right order on smaller screens when the sidebar is long, like this:

This is the code in general:

  MAIN CONTENT

Sidebar

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat."

Conversation:

COMMENTS COMMENTS COMMENTS COMMENTS COMMENTS COMMENTS COMMENTS COMMENTS COMMENTS COMMENTS COMMENTS COMMENTS COMMENTS COMMENTS COMMENTS COMMENTS COMMENTS COMMENTS COMMENTS COMMENTS COMMENTS COMMENTS COMMENTS COMMENTS COMMENTS COMMENTS

Here is a CodePen I've been playing with.

A: You have to rearrange your divs to fix that problem. Also you should give importance to sidebar last.

      Content

     Comment

  Sidebar


text:
Q: Consider the real-valued function $M:=\{(x,y,z)| (2 - (x^2 + y^2)^{1/2})^2 + z^2=1\}$ defined on $\mathbb{R}^3-\{(0, 0, z)\}$. Show that the manifold $N=\{(x,y,z)\in \mathbb{R}^3|x^2+y^2= 4\}$ is transverse to M. Identify the resulting manifold $N\cap M$.
My Attempt:
Pardon me for something vacuous, as I am a beginner in differential topology.
All I know is that it's intersection is union of two disjoint circles. It's clear to me that $M$ is the equation of a torus. Now, substituting the value $x^2+y^2=4$ in the equation $M$, we get two circles each $x^2+y^2=4$ one at $z=1$ and the other at $z=-1$. By definition of transversality,we should have $T_p(M)+T_{p}(N)=T_{p}\mathbb{R}^3\simeq\mathbb{R}^3,\forall p\in M\cap N$. But then I don't understand how the tangent spaces spans $\mathbb{R}^3$ being parallel(I guess)??

A: To find whether or not intersection of these surfaces $T^2=\lbrace (x,y,z): (2-\sqrt{x^2+y^2})+z^2=1\rbrace$ and $C=\lbrace (x,y,z): x^2+y^2=4\rbrace$ is transverse, lets first look at the intersection. So
\begin{align}T^2\cap C&=\lbrace\ (x,y,z): x^2+y^2=4\text{ and }(2-\sqrt{x^2+y^2})+z^2=1\rbrace\\
&=\lbrace\ (x,y,z): x^2+y^2=4\text{ and }(2-\sqrt{4})+z^2=1\rbrace\\
&=\lbrace\ (x,y,z): x^2+y^2=4\text{ and } z^2=1\rbrace
\end{align}
so they intersect in circles of radius 2 at heights $z=\pm 1$. Now suppose that $(x,y,1)$ is on the top circle and $x$ is positive. Then we can locally parametrize $T^2$ near $x$ with $\phi$ by solving for $z$ and choosing the positive branch. This gives $\phi:U\to\mathbb{R}^3$ by
$$\phi(x,y)=\left(x,y,\sqrt{1-(2-|r|)^2}\right)\quad (\text{where $r^2=x^2+y^2$})$$
Let $\psi:V\to\mathbb{R}^3$ be the local parametrization of $C$ around $(x,y,1)$ given by
$$\psi(x,z)=(x,\sqrt{4-x^2},z)$$
Then the tangent space of $T^2$ at $(x,y,1)$ is the image of $d\phi_{(x,y)}$ and the tangent space of $C$ at $(x,y,1)$ is the image of $d\psi_{(x,1)}$. These are
$$d\phi_{(x,y)}=\begin{bmatrix}
1 & 0 \\
0 & 1 \\
\frac{x(2-|r|)}{|r|\sqrt{1-(2-|r|)^2}} & \frac{y(2-|r|)}{|r|\sqrt{1-(2-|r|)^2}} \\
\end{bmatrix}$$ and $$d\psi_{(x,1)}=\begin{bmatrix}
1 & 0 \\
\frac{-x}{\sqrt{1-x^2}} & 0 \\
0 & 1 \\
\end{bmatrix}$$
But remember that $x^2+y^2=4$ for $(x,y,1)$. That is, $r=2$. So the above $d\phi_{(x,y)}$ becomes
$$d\phi_{(x,y)}=\begin{bmatrix}
1 & 0 \\
0 & 1 \\
0 & 0\\
\end{bmatrix}$$ So the spanning set is $\lbrace d\phi_{(x,y)}(\vec{i}), d\phi_{(x,y)}(\vec{j}), d\psi_{(x,1)}(\vec{j})\rbrace=\lbrace\vec{i},\vec{j},\vec{k}\rbrace$


text:
Q: clojure nthrest and nthnext argument order The nthrest function is called like : (nthrest coll n).
The nthnext function is called like : (nthnext coll n).
I thought that the rule was that coll was the last argument (as in map, reduce, filter...). At least that's how I think about it, especially when using the ->> macro.
So, why does nthrest fo things differently, especially given that it was introduced in version 1.3 ?
Also see (from clojuredocs) :
(nthrest (range 10) 5)   ;;=> (5 6 7 8 9)
(drop    5 (range 10))   ;;=> (5 6 7 8 9)

Is it because it looks closer to rest in this case ? And if yes, what would it mean that there is another, stronger "rule" superseding the one I mentioned above that I am unaware of ?

A: I actually think it makes sense now.  Yes it would be nice for threading if the collection was always in the same position, but threading isn't the only concern.
For example, the partial function is only capable of partially-filling arguments at the start of a function's parameter list, and doesn't have a partial-last that works the other way round. I've rarely made a function using partial which takes a collection and returns a fixed key's value from it, but I've often made one which takes a key and returns its value from a fixed collection.
Functions such as map or reduce make sense if you think in terms of transducers.  Creating a transducer by omitting the collection is a conceptually sensible thing to do - it's nice not to couple my mapping call with the collection I want to run it on.  I like to think of the single-arity version of map (and similar transducer-returning versions of other collection functions) as being the default, with a convenience arity that allows me to specify the collection for those situations where I don't want to reuse my transducer elsewhere.  In this context, it makes sense to have the collection last.
Essentially, it's a question of taste - do you prefer a bias towards threading (which is very nice), higher-order functions or something else?  I'd recommend using as-> and not worrying too much about it!


text:
Q: Proof of Matrix Norm Inequality (Hadamard product) Let $◦$ be the entry-wise (Hadamard) product operator, where for two matrices
$$A = (a_{ij} )_{1≤i≤n,1≤j≤m}, B = (b_{ij} )_{1≤i≤n,1≤j≤m}∈ R^{n×m}$$
we define $$A ◦ B := (a_{ij} b_{ij} )_{1≤i≤n,1≤j≤m} $$
Show that $$ ||A ◦ B||_2 ≤ ||A||_2 · ||B||_2 $$
where 2-norm is defined as the matrix norm induced by the vector norm.
For a normal matrix product I know : $$\sup_x \frac{||ABx||}{||x||} $$ $$ ≤\sup_x \frac{||A||· ||Bx||}{||x||}$$ $$≤||A||·||B||$$
Not sure how to deal with Hadamard products. Any help appreciated

A: The easiest approach is to observe, with $\big \Vert \mathbf x_k\big \Vert_2, \big \Vert \mathbf y_k\big \Vert_2 = 1$ and using the operator 2 norm (i.e. Schatten $\infty$ norm) for our matrices
$\text{max:  }\mathbf x_1^*(A \otimes B)\mathbf y_1 =\big \Vert A \otimes B\big \Vert_2 = \sigma_1^{(A)}\sigma_2^{(B)} = \big \Vert A \big \Vert_2 \big \Vert B\big \Vert_2 $
where $\otimes$ denotes Kronecker Product
Then observe that $(A \circ B)$ is a principal submatrix of $(A\otimes B)$  so
$\big \Vert A \circ B\big \Vert_2 = \text{max:  }\mathbf x_2^*(A \circ B)\mathbf y_2 \leq \text{max:  }\mathbf x_1^*(A \otimes B)\mathbf y_1$
The Hadamard Product is rather hard to work directly with.  The Kronecker Product is quite easy to work with, so it's desirable to prove an awful lot of HP inequalities via use of the KP.


text:
Q: Configuration changes with git webhook, spring cloud bus and application autorefresh If i have three spring boot applications like Person, Customer, Order with spring.application.name as person, customer, order and each application has configuration in the github Person.yml, Customer.yml, Order.yml. And each application has two instances running like Person1, Person2, Customer1, Customer2, Order1, Order2 and all these are setup to read config from github and also have spring cloud bus dependencies using rabbitmq with which they all subscribe to rabbitmq broker
There is like Spring cloud config server setup to run with Spring cloud bus using rabbitmq and to read config from the above github repository.
And there is github webhook to the /monitor endpoint of the config server.
When i make configuration changes to Person.yml and save it, github will do a post to the /monitorendpoint of configserver. And config server will now post those changes to the rabbitmq broker.
At this point since all the applications are subscribing to rabbitmq would all application instances be triggered so that person1, person2, customer1, customer2, order1, order2 will all try to hit the config server and only person1 and person2 will be updated with the changes.
Or only person1 and person2 applications are triggered and they hit config server since changes are only to Person.yml.


text:
Q: I Need Some Advice on Creating a Document Repository We have an HTML based help system, maintained with RoboHelp, that our call center staff use while fielding phone calls. It contains about 2000 individual documents that are indexed, keyworded and cross-referenced using RoboHelp's tool suite. For a number of reasons, the company has decided to eliminate RoboHelp and merge this data into SharePoint. I see so many different options to do this, and I am having a really hard time wrapping my head around what's going to work best for us. I'd love to hear any input from anyone who's experienced a similar migration. I found this question, and while mine's similar, I'm at a place where I need practical advice about more detailed circumstances.
A few notes on our environment and restrictions:
1.) We're taking advantage of this opportunity to clean up the documents, but we'll likely still end up with no less than 1750 documents.
2.) We're also taking advantage of this opportunity to analyze if the current system has optimal functionality, or if we need to design something from scratch. My guess is that our current system meets about 80% of the needs, and we'll be making some minor tweaks, but no major redesign.
3.) The current system is based on two frames: the left has a search box and a Javascript index generated out of RoboHelp's index list. To the right is the individual document. Clicking on the left nav search term or index term updates the document displayed in the right frame.
4.) Help documents are frequently cross-referenced with each other.
5.) I'm doing this project as part of a user area and am restricted in how much I can manipulate SharePoint beyond out-of-the-box client-side functionality. I do not have .NET or Designer, and am supposed to get special dispensation if I want to use CSS or Javascript to manipulate data. Preference is given to techniques that exist on the Site Administrator menu of options.
6.) SharePoint was chosen as the platform because of its low cost ($0 in additional licensing costs), ease of use, familiar look and feel of the ribbon interface, agility when making changes, change management tracking, and ease of roll-out.
Here's where things get muddled. I can see the following solutions, the associated pros and cons, but am really looking for some outside perspective to help me make sense of it all.
1.) SP Wiki. PROS: ease of interlinking and cross-referencing, ease of maintenance, ability to grow organically as procedures and policies change. CONS: Converting this volume of pages to rudimentary wiki pages seems easy; is re-creating the linkages between documents as daunting as it seems it would be?
2.) Custom List. PROS: The form-based interface for entering new data is very useable and clear for users. The "preview view" is VERY similar in functionality to the current system. CONS: no way to cross reference documents with each other, no provisions for images.
3.) Document library. PROS: Flexibility to store documents as Word or HTML. Image publishing is easier.  CONS: Same import issues that I have with the Wiki. With the document library option, I'm also suffering indecision about whether Word or HTML is the best choice. HTML is, IMHO, more universal than word. However, HTML isn't in the users' skill sets as much as Word. HTML can be edited in the web-part, but Word needs to open an external program (e.g., MS-Word)
So that's where we are. Does anyone have any advice from their similar projects? Are there best practices for this type of documentation repository? I'd love to hear your thoughts!

A: Ok, this is a huge question but I'd like to address your 3 options specifically.
1) Wiki:
A Wiki would be ideal for this task. You are trying to create a sound knowledge base. You would have to convert each document to a web page, however this is made easier with automation. Check this out:
Enable document converters for a Web application
2) Custom List:
A custom list would allow for easy creation of new documents, but this might be overkill. A document library or wiki is more ideal for this.
That being said, there's no reason you couldn't have embedded images in your article, just use a Multiline Text field with rich text formatting. It's an OOTB option. This article shows some screen shots of how you would flip this on for a list field (you can even enable this on fields in Picture and Document Libraries via SharePoint Manager):
Rich Text Fields in SharePoint Document and Picture Libraries
3) Document Library:
An additional benefit of using a document library for your solution would be versioning for content editing in these documents, making it easier to track revisions as well as seeing historic versions of each document.
Why would it need to be one or the other, HTML vs. MS Word? You could have both and link to either from either. The URL structure is the same regardless. And you can open Word documents in the browser, and set this as the default behavior for all Word documents on the site. Microsoft would love it if the life cycle of the document was entirely within SharePoint.
To set this as the default behavior for MS Word see: Configure the default open behavior for browser-enabled documents (Office Web Apps)
General Concerns
As far as the daunting task of relinking all of the documents... yes, it is daunting and will have to be done manually... for all 1700 documents. You'll have to do that with any of these options. Guess that will be the fun part.

A: I'd probably lean to the document library approach.  You can add a Related Documents column that simply looks up to that list where people can add references to those documents.
You can create a template in Word for users to easily create new documentation.
Metadata in the ribbon of the Word Client (Wikis can have metadata too) lets people add information that can be turned into search scopes.
If you upgrade SP down the line, you can utilize Office Web Applications and give users browser based Word editing.
Wikis are just OK in my opinion, they are far from anything wikilike except for the doublet bracket syntax.  The rest you can do in Word and better.

A: You have to ask yourself what's most important? For me, it would be usability.
I would bite the bullet and do the SP Wikis for the ability of cross references, but that's just my opinion. The are easy to manage, searchability is strong, and readability would be easier than Custom Lists or the Document Libraries. As long as we are talking a long-term solution.
Also, if this is a solution that you are spending money on, you might as well spend money for third-party tools to convert your Word documents into Wiki pages, and such.


text:
Q: How to get profile data from various social media plateforms My requirement is to search profile data based on some parameters from various social media plateforms like instagram, facebook, youtube, twitter.
How to get  no of posts, followers, profile links, following and many more of any user profile from instagram, facebook, twitter
I have tried instagram api, facebook graph api for getting profile details.
https://www.instagram.com/developer/
https://developers.facebook.com/
They all are asking for login and access token.
How can i get profile details without login.

A: I'm not sure if I understood your question, but I'm gonna assume that you're looking for YouTube and Instagram's APIs to get the information you mentioned.
You can find YouTube API here.
I'm not sure if Instagram will let you get that information tho, check it out here.
Hope my answer was what you're looking for.


text:
Q: Calculating inverse of a very large matrix I am trying to calculate inverse of a very large matrix (11300x21500) in C++. So far I have tried Eigen and Armadillo libraries but both failed at initialization stage, saying that there is not enough memory. Can there be any way to overcome this situation?
Thanks in advance
P.S
I should correct the size of the matrix to 21500x21500. As UmNyobe suggested, this is not a square matrix. It is actually the observation matrix, X, and I am trying to calculate (XTX)-1
I have a 8GB memory(in a 64bit system), but I don't think I am making use of all of this memory space. The task manager shows that the memory usage at the time of error is 1GB. Maybe there is a OS command in Windows7 that closes an application when its memory usage exceeds 1GB.
By the way, my original purpose is to run a regression over this observation matrix.
One more thing: most columns in each row of the observation matrix X are zero. Can there be a way to take advantage of this, to limit the memory usage in the inverting operation?

A: Supposing the matrix is square, what you're probably looking for is an in-place matrix inversion algorithm.
You should check out this.

A: You cannot inverse a non-square matrix.
http://en.wikipedia.org/wiki/Invertible_matrix

A: Assuming a (11300 x 11300) Matrix of integer (32 bits), you have
4*(11300^2)/(1024^3) = 0.4757 GB

If you are using double precision then double this number.
If the library is using the Strassen algorithm, which requires additional memory of the same magnitude, then you double the previous number.
So inverting a double-based matrix of this size with Strassen or gaussian will cost you 1.9 GB.

A: I'd like to propose another solution, which only works if you are not interested in the inverse of the matrix itself but in the product of the inverse with a vector. For example, assume that you would like to find the product of your inverse times a vector v, i.e. w := (X^T X)^{-1} v. In this case, you are actually looking for a solution to the problem
Find w such that (X^T X) w = v

Using iterative algorithms, it is possible to find w given X and v in the equation above without inverting X. One possibility that comes to my mind is using the Method of Conjugate Gradients. This algorithm can be implemented in roughly 10 lines and only requires to be able to compute the product (X^T X) y with a given vector y. In our case, this can even be done in two steps, i.e. compute z := X y and in a second step X^T z, which will save space as you do not need to store the product X^T X.

A: Although you're compiling your program on a 64-bit machine, you should also make sure that you are using the correct 64-bit libraries. Otherwise, the program may be compiled in 32-bit and you'll still get the same memory problems.
As for the computation of the inverse, the inverse function of OpenCV may help. Make sure to use the DECOMP_SVD inverse, as I found it to be more effective with near singular matrices.


text:
Q: Error accessing packages placed in sys.path array I have created a custom package which has a single function.
On adding the path of this module to the sys.path array, I am unable to access it.
How to access package once its path has been added to the sys.path array object ?
Here's the screenshot of the code I have typed

A: If you have a file name hello_world.py and you already add the path to the folder containing that file to system path, you can import it directly without the folder's name, meaning:
import hello_word


text:
Q: Python - How to copy a ImmutableDict to a mutable dict? I'm trying to do a hard copy on a dictionary to avoid modifying the values of original one.
Here is my code:
import copy
d1 = {1: 1}
d2 = copy.deepcopy(d1)
d2[1] = None

What if d1 is a ImmutableDict? How can I copy one and allow it to be modified?
import immutabledict
d1 = immutabledict.immutabledict({1: 1})
d2 = copy.deepcopy(d1)
d2[1] = None  # TypeError: 'immutabledict' object does not support item assignment

A: Calling dict will create the copy and allow you to mutate d2
import immutabledict
d1 = immutabledict.immutabledict({1: 1})
d2 = dict(d1)
d2[1] = None

This correctly updates d2 and does not change d1.

A: If you really need to copy use
d2 = {**d1}


text:
Q: When/Why Does Mutual Left Recursion Happen in Antlr? I have an expression that is a collection of my other top-level things. In expression I have math that is expression (op) expression. With this I get
The following sets of rules are mutually left-recursive [expression, math]
compileUnit : expression EOF;

expression
    : parens
    | operation
    | math
    | variable
    | number
    | comparisonGroup
    ;

math : expression op=( ADD | SUBSTRACT | MULTIPLY | DIVIDE ) expression     #mathExpression;

HOWEVER!
This is not a problem-
expression
    : parens
    | operation
    | expression op=( ADD | SUBSTRACT | MULTIPLY | DIVIDE ) expression
    | variable
    | number
    | comparisonGroup
    ;

And neither is this!-
math : op=( ADD | SUBSTRACT | MULTIPLY | DIVIDE ) expression expression     #mathExpression;

So why is it that my first code block behaves differently than the other two examples?

A: Antlr4 can handle direct left recursion, but not indirect left recursion, where a left recursive rule is defined as a rule that "either directly or indirectly invokes itself on the left edge of an alternative" (TDAR; pg 71).
When, as in the first example, the #mathExpression alternative is factored out of the expression rule and into a separate math rule, the left direct recursion becomes indirect, i.e., the rules are 'mutually left-recursive'.
As realized in the second and third examples, a typical solution is to simply combine the indirect left-recursive rules in a single rule.


text:
Q: Managed Package Upgradation I have an App "XYZ" in my Production org, need to upgrade it with latest version is there will be any loss of data while upgrading.

A: Depends on the App.   I would do a test in a full sandbox if possible to verify.   Most apps do not destroy data and are more likely to abandon data and objects it does not need anymore.


text:
Q: Angular 2 in spring tools suite As you know a week ago Google released a official version of Angular 2. I want to setup my STS to create Angular2/typescript projects. I read some article but I'm not pretty sure which is the best way to do it.
Can you give me some advices what should I install to be able to write Angular 2 / Typescript in STS?
Best regards.

A: Since STS is an Eclipse-based package, you can install regular Eclipse plugins into it. For AngularJS I would recommend to use https://github.com/angelozerr/angularjs-eclipse.
Hope this helps!!!


text:
Q: SignalR cannot send a message to all connected clients I am trying to using SignalR to send a message to all connected clients.
I have found several examples and added what I think to be all the required bits. I did successfully get my client to connect to my Hub. I cannot get my server to connect to my Hub and send a message to all the connected clients.
When I call DatabaseChangeListener::Notify() it never hits the code in the Hub.
Can anyone suggest what else I need to do?
I am using .NET Core 2.1 preview 2 in web application with React and Redux.
I am using SignalR 1.0.0-preview2-final
I am using SignalR.Client 1.0.0-preview2-final
In Startup.cs
    public void ConfigureServices(IServiceCollection services)
    {
      // remove all other code for this question
      services.AddSignalR();
    }

    public void Configure(IApplicationBuilder app)
    {
      // remove all other code for this question
      app.UseSignalR(routes =>
      {
        routes.MapHub<SignalRHub>("/hubs/update");
      });
    }

My Hub
    [Authorize]
    public class SignalRHub : Hub
    {
        public async Task Send(string message)
        {
            await Clients.All.SendAsync("SendMessage", Context.User.Identity.Name, message);
        }
    }

My class to notify clients
public class DatabaseChangeListener : IDatabaseChangeListener
{
    private readonly IHubContext<SignalRHub> _hubContext;

    public DatabaseChangeListener(IHubContext<SignalRHub> hubContext)
    {
            _hubContext = hubContext;

    }

    public void Notify()
    {
      _hubContext.Clients.All.SendAsync("SendMessage", "something changed, Yo");
    }
}

A: You need to make the connection to the hub via client side and then by using your _hubContext, you should be able to send a message to the client based off of the connection made to the hub.
Connection to the hub from client side using JS.
    const connection = new signalR.HubConnectionBuilder()
        .withURL("/YourHub")
        .build();

Then after the connection is made, you can make the method to send a message to the client from the server using JS as well.
    connection.on("SendMessage", message => {
        document.getElementById("IdOfElementToDisplayMessage").innerHTML = message;
    });

Finally add:
    connection.start().catch(err => console.error(err.toString()));

Now you have established the connection to the hub via client side and can now reference the connection to the hub from the IHubContext.
To send a message from the server to the client you can use _hubContext.
In your case you can call Notify() and then await _hubContext.Clients.All.SendAsync("SendMessage", "something changed, Yo"); which should send your message to the SendMessage method created in JS: connection.on("SendMessage", message => { ...
If your _hubContext variable is null during the execution then the injection of the IHubContext needs to be checked.


text:
Q: Visual Studio 2010 hangs on trace point The Problem:
Whenever I try to break or set a Trace-point in the debugger, our application and visual studio freezes completely. After detaching the debugger the application continues.
This problem is probably related to WPF. We have migrated our WinForm application to WPF. Since then this problem occurs. But I'm not able to find the specific part of the code which causes the problem. I have already rolled back hundreds of commits but without success.
It might also be related to the UI thread. If the breakpoint is set somewhere away from the UI logic the application will not freeze or it will not freeze as often as it does somewhere in the UI Thread.
[Edit:]
I use Windows 7. 64bit with Visual Studio 2010
[Update:]
When Visual studio hangs, and i try to detach before the breakpoint is displayed, the Message "Unable to detach from one or more processes. All outstanding func-evals have not completed". But i have disabled all func evaluation in the debugging options.
I think my problem is caused by a func_evaluation which can not complete or which runs into a timeout.
Is there a way to see on which func_evaluation visual studio is hanging?
Example:
class SomeUiViewPresenterExample
{
   private Timer m_Timer;

public void Init()
{
    m_Timer = new Timer();
    m_Timer.Elapsed += ElapsedFoo();
    m_Timer.AutoReset = false;
    m_Timer.Interval = 200;
}

private void ElapsedFoo(object sender, ElapsedEventArgs elapsedEventArgs)
{
    // there is no code inside this method
    // On the next line a trace point with "---> ElapsedFoo called" will freeze the debugger
}

What I have already tried: (without success)

*

*enable / disable the host process

*tried to debug x86 and x64 processes

*launched visual studio with /SafeMode

*NGEN update

*disabled "property evaluation and other implicit function calls" in Debugging options

*disabled symbol servers

*disabled symbol loading

*deleted WPF font cache

*Marked several UI elements with 'DebuggerDisplay("some text without expression")'

(Ticket Microsoft Connect)
Probably related problem:
Because our application uses .NET Remoting to communicate with another process, my problem my be something similar as here. I have placed all registrations to remoted events in a own Task, but without success.
Debugger Output from debugged visual studio:
I have attached a debugger to visual studio and have observed some exceptions,(80010005)
but I have no idea whether they are relevant for my problem or not:
(18d8.1708): C++ EH exception - code e06d7363 (first chance)
(18d8.1708): C++ EH exception - code e06d7363 (first chance)
..... // snip
(18d8.18dc): **Unknown exception - code 80010005 (first chance)
..... // 20 seconds freeze until breakpoint hit in IDE

(18d8.18dc): Unknown exception - code 80010005 (first chance)
(18d8.18dc): C++ EH exception - code e06d7363 (first chance)
ModLoad: 365f0000 36665000 C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Packages\Debugger\mcee.dll

// after continue execution debugger and debugged process freezes forever

(18d8.18dc): Unknown exception - code 80010005 (first chance)
ModLoad: 00000000`02b90000 00000000`02c1c000 C:\Windows\SysWOW64\UIAutomationCore.dll
(18d8.1a8c): CLR exception - code e0434352 (first chance)
(18d8.1a8c): CLR exception - code e0434352 (first chance)
(18d8.1a8c): CLR exception - code e0434352 (first chance)
(18d8.1a8c): CLR exception - code e0434352 (first chance)
(18d8.1a8c): CLR exception - code e0434352 (first chance)
(18d8.1a8c): CLR exception - code e0434352 (first chance)
(18d8.1a8c): CLR exception - code e0434352 (first chance)
(18d8.1a8c): CLR exception - code e0434352 (first chance)

A: The more I look at this, the more I suspect it's because you're not using the WPF timer. If you try to use the regular Timer class rather than the WPF Dispatcher timer, you run the risk of trying to update the UI on a non-ui thread - which could potentially be the cause of your problem (Since the DataContext is part of the UI technically).
More info here:
DispatcherTimer vs a regular Timer in WPF app for a task scheduler

A: You can use the windebug tool from this below url to better debugging and sort it out the solution
http://msdn.microsoft.com/en-us/windows/hardware/gg463009.aspx

A: Thanks for your hints. Finally I have installed VS 2012 and the debugger now behaves as normal. It seems there is really a bug / performance issue in the visual studio 2010 debugger.


text:
Q: Can I re-submit the same version of my app in google play? I have accidentally uploaded a wrong version of my app in google play. Its version is 1.0. Now I am trying to upload the updated apk file using the same version which is 1.0. Is it still possible?
I tried but I always got this error message:

You need to use a different version code for your APK because you already have one with version code 1.

I try to unpublish it but I think I still need to wait for few hours. Most of the time, how long would this take?

A: Inside the AndroidManifest.xml file, there are two lines at the top one for versionCode and one for versionName.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.myapp"
    android:versionCode="1"
    android:versionName="1.0" >

The one for versionName doesn't actually matter what is there, it is for mainly the developer and consumers to know which version the app is on. The versionCode is intended for the developer only, as it is the only number that matters. The versionCode must increment on every release to the Play Store. Generally, the versionCode is either a plain number that increments with every release, or has a specific style to it, such as YYYYMMDD, as this number will always increment with the passing days.
Hope this helps!

A: Yes, you can still use the same version. What it's asking for is versionCode, which you can increment from 1 to 2 in your AndroidManifest.xml (look for something like android:versionCode="1").
There's more information here: http://developer.android.com/tools/publishing/versioning.html

android:versionCode — An integer value that represents the version of the application code, relative to other versions.
The value is an integer so that other applications can programmatically evaluate it, for example to check an upgrade or downgrade relationship. You can set the value to any integer you want, however you should make sure that each successive release of your application uses a greater value. The system does not enforce this behavior, but increasing the value with successive releases is normative.
Typically, you would release the first version of your application with versionCode set to 1, then monotonically increase the value with each release, regardless whether the release constitutes a major or minor release. This means that the android:versionCode value does not necessarily have a strong resemblance to the application release version that is visible to the user (see android:versionName, below). Applications and publishing services should not display this version value to users.


text:
Q: Having problems while trying to populate a todo listview using a custom adaptor? I want a user to input data through an editable text and I want to receive that data through a custom made listview, for that I am trying to use a custom adapter to add a textfield into my listview, through the tostring() method I have converted the data from the editable textview to a string and I am adding that string within my custom adapter to an Arraylist variable values and I'm trying to display that data through get(0) but either the Arraylist is not populating correctly or the data is not displaying properly because whenever I type something within my editable text and press the add button nothing happens, before this I added the string to an Array Adapter and the listview was populating normally, what am I doing wrong?
public class todoFragment extends ListFragment {

private EditText mToDoField;
private Button mAdd;
UsersAdapter mAdapter;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getActivity().setTitle(R.string.todo_title);
}

public class UsersAdapter extends ArrayAdapter<String> {

    public Context context;
    public ArrayList<String> values;

    public UsersAdapter(Context context, ArrayList<String> values) {
        super(context, 0, values);

        this.context = context;
        this.values = values;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        LayoutInflater inflater = (LayoutInflater) context
                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);

        convertView = LayoutInflater.from(getContext()).inflate(R.layout.todo_list, parent, false);

        TextView todoTextView = (TextView) convertView.findViewById(R.id.todo_TextView);

        todoTextView.setText(values.get(0));

        return convertView;
    }
}

@TargetApi(9) // remember this for isEmpty()
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.fragment_todo, container, false);

    ArrayList<String> todoList = new ArrayList<String>();
    mAdapter = new UsersAdapter(getActivity(), todoList);
    ListView listViewToDo = (ListView) v.findViewById (android.R.id.list);
    listViewToDo.setAdapter(mAdapter);

    mToDoField = (EditText) v.findViewById(R.id.todo_editText);

    mAdd = (Button)v.findViewById(R.id.add_button);
    mAdd.setOnClickListener(new View.OnClickListener() {
        @Override
            public void onClick(View view) {

            String toDo = mToDoField.getText().toString().trim();

            if (toDo.isEmpty()){
                return;
            }

            mAdapter.values.add(toDo);

            mToDoField.setText("");
        }
    });

    return v;
}

}

A: When you manually update the data don't forget to call:
mAdapter.notifyDataSetChanged();

A: Firstly, you should not be doing
todoTextView.setText(values.get(0));

Because this will always return the first element of the values list. You should do
todoTextView.setText(values.get(position));

Secondly,
mAdapter.values.add(toDo);

is not really right. It will work, but its not the best practise. Try using something like
mAdapter.add(toDo);

or
values.add(toDo);

Now once you've added the data to the list, you need to notify the adapter that the data set has been changed. This is done by
mAdapter.notifyDataSetChanged();

A: Instead of  mAdapter.values.add(toDo); UsemAdapter.add(toDo);
Look at the Add Method Of ArrayAdpter Class, it Itself use notifyDataSetChanged() so need to write any extra line of code:
public void add(T object) {
    synchronized (mLock) {
        if (mOriginalValues != null) {
            mOriginalValues.add(object);
        } else {
            mObjects.add(object);
        }
    }
    if (mNotifyOnChange) notifyDataSetChanged();
}


text:
Q: preg_replace add ; to javascript function I have a javascript which contains something like this
var f = function(){
    if(){
    }else{
    }
}

and I need to add ; at the end, like this
var f = function(){
    if(){
    }else{
    }
};

I need some help to get the closing function } tag and not the } tags from inside the function.
Thanks

A: You can't, if all you can use is regex. It'd be very much like parsing HTML with regex.
Instead, see if you can find an AST parser for javascript in PHP - that's what you'll need to be able to find the appropriate closing bracket.


text:
Q: PHP readfile for force downloading files and images I want to send files through php using readfile()
What i've noticed is that readfile forces a download, but what if i want to show an image in the browser and not force a download?
Would readfile still force download even if the file is an image?
If it does, is there a solution so i can use  tags with it when the file is an image?
Thanks!

A: You need to set the MIME type with the header() function. There should be info in the comments. Something like:
<?php
header('Content-type: image/png');
?>


text:
Q: Add a Value Automatically to a Cell Based on Another Cell I want to add a value to a cell based on another with VBA but I'm not sure how. I already searched on internet about it but can't find anything.
I have a table, and on the Column C, if any cell contains the text "MAM" (because it might have MAM-565), then change the value from Cell A to "Wrong", but if it contains "NAC", then change value to "Correct". It should be in the same row as the text found.
Also, I want to add the date automatically to cell E every time Cell in D is filled.
This the code I have already:
Private Sub Worksheet_Change(ByVal Target As Range)

'Add Issue Type'
Dim Code As Range
Set Code = Range("C2:C100000")

For Each Cell In Code
If InStr(1, Cell, "NAC") Then
Range("A2:A10000").Value = "Correct"
ElseIf InStr(1, Cell, "MAM") Then
Range("A2:A10000").Value = "Wrong"

End If
Next

End Sub

This how my table looks like:
Table
Thanks in advance guys :)

A: To automatically add the datestamp:
Private Sub Worksheet_Change(ByVal Target As Range)
    Dim rng as Range
    Set rng = Intersect(Target, Me.Range("D:D"))
    If rng Is Nothing Then Exit Sub

    On Error GoTo SafeExit
    Application.EnableEvents = False

    Dim cell as Range
    For Each cell in rng
         If Not IsEmpty(cell) Then ' don't do anything if cell was cleared
             cell.Offset(,1).Value = Date
         End If
    Next

SafeExit:
    Application.EnableEvents = True
End Sub

As far as the Correct/Wrong, this can easily be done with a formula (ISNUMBER(SEARCH(...)). I don't see the need for VBA here.
Even better, create a table using Ctrl+T. Excel will automatically add the formula in column A in new rows.