text:
Q: Drag and Drop xcopy I need a batch script in which I can put files or directorys and they become copied to my NAS. I want to drag the file(s) or folder on the batch and then it does his job. Existing files or dirs should be override and i don't want to get some questions for override or sth. else. Also I want to intigrate this script after this in the Send to dialog of windows. I hope u can help :)
My biggest problem is the drag and drop function.
Thank you
PS:
This code I found in internet for drag and drop but I don't understand -.-
    @echo off & setlocal
set "Ein=meinedatei.txt"
set "Aus=meinedatei.dat"

if exist "%Aus%" del "%Aus%"
set Zuletzt=-
for /f "tokens=2" %%i in ('findstr ".rst .pop" "%Ein%"^|sort') do call :ProcessLink "%%~i"
goto :eof

:ProcessLink
if %1==%Zuletzt% goto :eof
set Zuletzt="%~1"
 (echo /%~1)>>"%Aus%"

A: @echo off
:a
cls
set /p file=::drag and drop file you want to copy here::
if not exist "%file%" echo file does not exist && pause && goto :a
set /p dest=Destination path/folder:
if not exist "%dest%" echo path does not exist && pause && goto :a
copy /y %file% %dest%
if %errorlevel%==0 echo copy successful && pause && goto :a
echo copy failed.
pause
goto :a

Also, if you want to easily include a path/drive/folder in your send to menu:
1)open cmd and type: start %appdata%\microsoft\windows\sendto
2)right-click in the folder interior and select new and click shortcut and type the location of the item in the dialog.

A: Next script shows batch parameter handling; allows up to 255 parameters supplied via

*

*copy & paste (select some files and folders, right click any of selected, choose Copy. Then right click the batch file, choose Paste), or

*drag & drop (procedure conformable to the one mentioned above), or

*using sendto menu, if you have placed the .bat file (or its shortcut) into the shell:sendto folder, or

*line parameters, e.g. drag-drop_30401166.bat files "b c".

You could replace echo folder, echo   file and echo unknown lines with code snippets suitable for your requirement (e.g. xcopy, copy, robocopy etc).
@echo OFF >NUL
SETLOCAL enableextensions
echo(
echo before any shift [%~0] [%~1] [%~2] [%~3] [%~4]
echo   all %%* = %*
echo(
set /A "ii=1"
:loopfor
  If exist "%~1\" (
      echo folder  %%%ii% = %1
  ) else (
      If exist "%~1" (
          echo   file  %%%ii% = %1
      ) else (
          echo unknown %%%ii% = %1
      )
  )
  SHIFT
  set /A "ii+=1"
  if not [%1]==[] goto :loopfor
echo(
shift
echo after all shifts [%~0] [%~1] [%~2] [%~3] [%~4]
echo   all %%* = %*
pause
goto :eof

Output sample:
before any shift [D:\bat\StackOverflow\drag-drop_30401166.bat] [D:\bat\runcmd.vb
s] [D:\bat\crlferror.bat] [D:\bat\UnASCII Names] [D:\bat\Unusual Names]
  all %* = D:\bat\runcmd.vbs D:\bat\crlferror.bat "D:\bat\UnASCII Names" "D:\bat
\Unusual Names"

  file  %1 = D:\bat\runcmd.vbs
  file  %2 = D:\bat\crlferror.bat
folder  %3 = "D:\bat\UnASCII Names"
folder  %4 = "D:\bat\Unusual Names"

after all shifts [] [] [] [] []
  all %* = D:\bat\runcmd.vbs D:\bat\crlferror.bat "D:\bat\UnASCII Names" "D:\bat
\Unusual Names"
Press any key to continue . . .

Output (parameters supplied in command line):
==>drag-drop_30401166.bat files "b c"

before any shift [drag-drop_30401166.bat] [files] [b c] [] []
  all %* = files "b c"

folder  %1 = files
unknown %2 = "b c"

after all shifts [] [] [] [] []
  all %* = files "b c"
Press any key to continue . . .

Resources (required reading):

*

*(command reference) An A-Z Index of the Windows CMD command line

*(additional particularities) Windows CMD Shell Command Line Syntax

*(%~0 etc. special page) Command Line arguments (Parameters)


text:
Q: collect logs from bash each 24 hours my idea is to collect logs each 24 hours ,mail it
and flush them after that
i wrote some scatch
for example
1.var/log/auth
{some info}
2.var/log/something.log
 {some info}
list="$(find /var/log -name *.log )"
for file in $list;do
echo  '#############################'
onehourago=$(date --date='1 hours ago' +"%b%e %H:%M:%S")
echo $onehourago | cat $file - |sort| sed "1,/$onehourago/d"
done

but still could not understand the problem

A: Why aren't you using logrotate?  It even has an option to mail the log to you.

redpajama_set_name: RedPajamaStackExchange


text:
Q: import webkit fails with an ImportError When I import webkit on Ubuntu 10.04 I get the following error:
Traceback (most recent call last):
  File "test.py", line 1, in <module>
    import webkit
  File "/usr/lib/pymodules/python2.6/webkit/__init__.py", line 19, in <module>
    import webkit
ImportError: /usr/lib/pymodules/python2.6/webkit/webkit.so: undefined symbol: webkit_web_frame_get_global_context

I think all the packages I need are installed. Does anyone have an idea of why this is failing?

A: Your /usr/lib/pymodules/python2.6/webkit/webkit.so is probably linked against an older version of libwebkit. In that case you'll need to install the correct versions of both software packages.


text:
Q: ASP.NET linq Select with multiple joins I've this database from EF code first, and now i have a difficult time getting my data.
I have the following entities:
Program : is a workout program that contains Workouts.
Workout : is a day routine that contains a list of Sets.
Set     : is an Exercises repeated x times with y load.
Exercise: is an gym exercise which contains a Region.
Region  : is a region on the human body and contains Muscles.
Muscle  : is a muscle on the human body.
Model examples
Here are 3 model examples
    public class Workout
{
    [Key]
    public int WorkoutId { get; set; }
    public string Name { get; set; }
    public string Description { get; set; }
    public virtual ICollection<Set> Sets { get; set; }
}
 public class Set
{
    [Key]
    public int SetId { get; set; }
    //Foreign key for Exercise
    public int ExerciseId { get; set; }
    [ForeignKey("ExerciseId")]
    public Exercise Exercise { get; set; }
    public decimal Load { get; set; }
    public decimal Order { get; set; }
}

    public class Exercise
{
    [Key]
    public int ExerciseId { get; set; }
    public string Name { get; set; }
    public string Description { get; set; }
    //Foreign key for Region
    public int RegionId { get; set; }
    public Region Region { get; set; }
}

And the scaffolded controller
// GET: api/Workouts
    public IQueryable<Workout> GetWorkouts()
    {
        return db.Workouts;
    }

So that only gives me a Workout object with its iCollection Sets is null.
// GET: api/Workouts
    public IQueryable<Workout> GetWorkouts()
    {
        return db.Workouts.Include(w => w.Sets);
    }

By including Sets i can get the corresponding Sets.
But what if i would like to get a Workout, including the Sets, and those Sets would include Exercises, and those Exercises would include Regions which in the end had a list of Muscles?
And what if i want a workout from id, like this:
        [ResponseType(typeof(Workout))]
    public IHttpActionResult GetWorkout(int id)
    {
        Workout workout = db.Workouts.Find(id);
        if (workout == null)
        {
            return NotFound();
        }

        return Ok(workout);
    }

How will i then include Sets?
EDIT
And from the Visual Studio Template /Help page, i can see the following:
GET api/Workouts/{id}

Should provide med with:
{
   "workoutId": 1,
   "name": "sample string 2",
   "description": "sample string 3",
   "sets": [
   {
     "setId": 1,
     "exercise": {
     "exerciseId": 1,
     "name": "sample string 2",
     "description": "sample string 3",
     "regionId": 4,
     "region": {
     "regionId": 1,
     "regionName": "sample string 2",
     "muscles": [
        {
          "muscleId": 1,
          "latinName": "sample string 2",
          "dkName": "sample string 3",
          "enName": "sample string 4",
          "description": "sample string 5"
        },
        {
          "muscleId": 1,
          "latinName": "sample string 2",
          "dkName": "sample string 3",
          "enName": "sample string 4",
          "description": "sample string 5"
        }
      ]
    }
  },

But it just wont happen, im open for anything that returns me a full Program in JSON. skype, teamwievr, stack, another solution, anyhting.

A: And finally i got it:
 public class Exercise
 {
     [Key]
     public int ExerciseId { get; set; }
     public string Name { get; set; }
     public string Description { get; set; }
     //Foreign key for Region
     //public int RegionId { get; set; }
     public virtual Region Region { get; set; }    //had to be virtual -.-
 }

A: If you have the models set up correctly, chaining the Include() methods should work.
public IQueryable<Workout> GetWorkouts()
{
    return db.Workouts.Include(w => w.Sets.AsQueryable().Include(s => s.Excercises.AsQueryable().Include(e => e.Regions.AsQueryable().Include(r => r.Muscles))));
}


text:
Q: Python Using Keyword and variable number of arguments in same function I am wondering if there is a way to do something like this in python 2.7.12
def saveValues(file,*data,delim="|"):
    buf=""
    for d in data:
       buf+=str(d) + delim
    open(file,"w").write(buf[:-1])

So that I have the option to pass delim, or take the default.

A: It's possible in Python 3.0+, after implementation of PEP 3102 -- Keyword-Only Arguments.  The syntax would be exactly how you've shown it, in fact.
The usual workaround for Python 2 is this:
def saveValues(file, *data, **kwargs):
    delim = kwargs.pop('delim', '|')
    ...


text:
Q: How can i load javascript after some time? i have a file which is executing javascript.I want it to load after some time.For eg- my script is <script>document.write("hello")</script> and it is loading directly when i am opening the file i want it to come after some time approx 5sec. Can you help me out as i am beginner in Javascript.Please help me to do this.Thanks in advance

A: You can use setTimeout function like this:
setTimeout(function() {
      // Do something after 5 seconds
}, 5000);

and one thing that @mplungjan mentioned in comments that when document.write executes it wipes the document and all scripts will be removed so you should not use document.write, instead of that use some alternate way as @mplungjan posted.

A: You cannot document.write after the page has loaded. If you do, the page is wiped.
It is quite easy to change the script to execute later. For example wrap the contents in a function and change any document.write inside it (show us the code please) to string concatenations
function concatIt() {
  var text = "";
  text += "some string previously written with document.write";
  text += "some string previously written with document.write";
  text += "some string previously written with document.write";
  return text; // send text to calling statement
}

window.onload=function() { // when page has loaded
  setTimeout(function() {
    document.getElementById("somecontainer").innerHTML=concatIt();
  },10000); // insert after 10 seconds
}

A: You can use -
setTimeout(function() {

document.getElementsByTagName('body')[0].appendChild('<script>document.write("hello")</script>');

}, 5000);

Based on comments-
As a suggestion, you should not be adding such a script after the document loads. This is because if you use 'document.write('something')', it will remove the previous content in the document and just write 'something' into it.


text:
Q: install4j: compilation failed. Reason: java.io.IOException: Negative seek offset I have an install4j project that is compilation and building absolutely fine on windows.  When I try this on linux however I receive the error stated in the title.  I've turned verbose mode on but I don't receive anything more helpful than that.  As the code is obfuscated I can't even make a guess about what might be wrong.
Is there some other kind of logging I can add to get more information about what might be going wrong during compilation?
 [exec]   Compiling launchers:
 [exec] com.A.B.E: java.io.IOException: Negative seek offset
 [exec]     at com.A.B.D.R(ejt:2613)
 [exec]     at com.install4j.B.E.F.C(ejt:1892)
 [exec]     at com.install4j.B.E.B.b(ejt:3208)
 [exec]     at com.install4j.B.F.i(ejt:1193)
 [exec]     at com.install4j.B.F.J(ejt:2499)
 [exec]     at com.install4j.B.A.m(ejt:3411)
 [exec]     at com.install4j.B.B.?(ejt:311)
 [exec]     at com.install4j.B.B.?(ejt:1515)
 [exec]     at com.install4j.B.B.H(ejt:2287)
 [exec]     at com.install4j.Install4JApplication.?(ejt:436)
 [exec]     at com.A.M.?(ejt:2208)
 [exec]     at com.install4j.Install4JApplication.main(ejt:1879)
 [exec]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 [exec]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
 [exec]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 [exec]     at java.lang.reflect.Method.invoke(Method.java:601)
 [exec]     at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)
 [exec]     at com.install4j.runtime.launcher.Launcher.main(Unknown Source)
 [exec] Caused by: java.io.IOException: Negative seek offset
 [exec]     at java.io.RandomAccessFile.seek(Native Method)
 [exec]     at com.A.B.A.H.A(ejt:1114)
 [exec]     at com.A.B.A.H.S(ejt:179)
 [exec]     at com.A.B.A.H.K(ejt:2639)
 [exec]     at com.A.B.A.H.<init>(ejt:2868)
 [exec]     at com.A.B.D.e(ejt:3063)
 [exec]     at com.A.B.D.R(ejt:3485)
 [exec]     ... 17 more
 [exec] install4j: compilation failed. Reason: java.io.IOException: Negative seek offset


text:
Q: PowerPoint VBA Recognizing Shapes in a Grouping I am trying to create a simple PowerPoint file to capture a series of milestones for a project portfolio. I have created the following Macro to create the milestone visual and group the shapes. However, I am looking to create another macro for updating/statusing the milestone. Specifically, I want the user to select the group and then run a macro to that will allow the user to update the date and move the shapes accordingly or, if the task is complete, fill in the shape.
I struggle with the initiation of the update macro to identify the shapes and its' content to complete the calculation. For example, I don't know how to read in the date in to move the milestone left/right based on the new date. Any help is appreciated!
Code:
Private Sub EnterTask_Click()

Dim Sld As Slide
Dim shapeMile As Shape
Dim shapeTask As Shape
Dim shapeECD As Shape
Dim dateECD As String
Dim taskText As String

Dim StatusBox As Shape

dateECD = "6/12/18"
taskText = "Task #1"

Set Sld = Application.ActiveWindow.View.Slide

With Sld

'Create shape with Specified Dimensions and Slide Position
Set shapeMile = Sld.Shapes.AddShape(Type:=msoShapeIsoscelesTriangle, _
    Left:=25, Top:=150, Width:=15, Height:=15)

    With shapeMile
        .Rotation = 180
        .Tags.Add "Milestone", "Bug"
        .Line.Visible = msoTrue
        .Fill.Visible = msoFalse
        .Shadow.Visible = msoFalse

    End With

Set shapeECD = Sld.Shapes.AddTextbox(msoTextOrientationHorizontal, _
    Left:=8, Top:=165, Width:=50, Height:=30)

    With shapeECD
        .Tags.Add "Milestone", "ECD"
        .Line.Visible = msoFalse
        .Fill.Visible = msoFalse
        .Shadow.Visible = msoFalse
        .TextFrame.TextRange.Characters.Text = dateECD
        .TextFrame.TextRange.Paragraphs.ParagraphFormat.Alignment = ppAlignCenter
        .TextFrame.VerticalAnchor = msoAnchorTop
        .TextFrame.HorizontalAnchor = msoAnchorCenter
        .TextFrame.TextRange.Font.Size = 8
        .TextFrame.TextRange.Font.Name = "Arial"
        .TextFrame.TextRange.Font.Italic = msoFalse
        .TextFrame.TextRange.Font.Color.RGB = RGB(0, 0, 0)
    End With

Set shapeTask = Sld.Shapes.AddTextbox(msoTextOrientationHorizontal, _
    Left:=8, Top:=135, Width:=50, Height:=30)

    With shapeTask
        .Tags.Add "Milestone", "Task"
        .Line.Visible = msoFalse
        .Fill.Visible = msoFalse
        .Shadow.Visible = msoFalse
        .TextFrame.TextRange.Characters.Text = taskText
        .TextFrame.TextRange.Paragraphs.ParagraphFormat.Alignment = ppAlignCenter
        .TextFrame.VerticalAnchor = msoAnchorTop
        .TextFrame.HorizontalAnchor = msoAnchorCenter
        .TextFrame.TextRange.Font.Size = 8
        .TextFrame.TextRange.Font.Name = "Arial"
        .TextFrame.TextRange.Font.Italic = msoFalse
        .TextFrame.TextRange.Font.Color.RGB = RGB(0, 0, 0)
    End With

.Shapes.Range(Array(shapeMile.Name, shapeECD.Name, shapeTask.Name)).Group

End With

End Sub


text:
Q: Recursive select in mysql I have a table with following format
TaskID  ParentTaskID
1       1
2       1
3       2
4       2
5       2
10      10
11      11
12      11
13      0
14      14

I want the result as below,if taskid is 1
TaskID
1
2
3
4
5

if its 2 then
Taskid
2
3
4
5

if its 10 then 10
means I want to select rows having taskid =1 with rows having parenttaskid=1
with rows having parenttaskid in above selection & so on........
please use this fiddle http://sqlfiddle.com/#!2/9db0c3/6

A: MySQL does not support recursive select.
But, the query below should do trick that you are looking for
SELECT t.TaskID
FROM task AS t
INNER JOIN (
    SELECT DISTINCT a.TaskID
    FROM task AS a
    INNER JOIN (
        SELECT TaskID
        FROM task
        WHERE TaskID = 11 OR ParentTaskID = 11
        UNION ALL
        SELECT ParentTaskID
        FROM task
        WHERE TaskID = 11 OR ParentTaskID = 11
    ) AS s ON s.TaskID = a.ParentTaskID
) AS s ON s.TaskID = t.TaskID

A: As Mike already said, MySQL does not support recursive select or recursive functions.
If you have a maximum logical limit on your task concatination (like 5) you can use hard coded self joins.
SELECT
t1.taskid as taskid1,
t2.taskid as taskid2,
t3.taskid as taskid3,
t4.taskid as taskid4,
t5.taskid as taskid5
FROM task t1
LEFT JOIN task t2 ON t2.parenttaskid = t1.taskid
LEFT JOIN task t3 ON t3.parenttaskid = t2.taskid
LEFT JOIN task t4 ON t4.parenttaskid = t3.taskid
LEFT JOIN task t5 ON t5.parenttaskid = t4.taskid

Which will produce this result: http://sqlfiddle.com/#!2/c9f80/1/0
By the way you have some self referencing tasks in your input data which would produce an infinity loop with recursion.


text:
Q: Cannot use a constant reference of experimental::optional when using clang & libstdc++ I'm taking a constant reference of an experimental::optional<> variable, but when I use operator->() on it, I have a compile error, but only when using clang++ and libstdc++.
#include <experimental/optional>
#include <iostream>
#include <vector>

int main(void)
{
    std::experimental::optional<std::vector<int>> opt;
    const auto &rf = opt;

    opt.emplace();
    opt->push_back(1);

    std::cout << "opt->size() = " << opt->size()
              << " rf->size() = " << rf->size() << "\n";

    return 0;
}

Running this program:
$ clang++ -W -Wall -std=c++14 -stdlib=libc++ test.cc && ./a.out
opt->size() = 1 rf->size() = 1  # OK

$ g++ -W -Wall -std=c++14 test.cc && ./a.out
opt->size() = 1 rf->size() = 1  # OK

$ clang++ -W -Wall -std=c++14 test.cc
In file included from test.cc:1:
/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/experimental/optional:576:16: error: call to '__constexpr_addressof' is ambiguous
      { return __constexpr_addressof(this->_M_get()); }
               ^~~~~~~~~~~~~~~~~~~~~
test.cc:14:40: note: in instantiation of member function 'std::experimental::fundamentals_v1::optional<std::vector<int, std::allocator<int> > >::operator->' requested here
              << " rf->size() = " << rf->size() << "\n";
                                       ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/experimental/optional:173:20: note: candidate function [with _Tp = const std::vector<int, std::allocator<int> >, $1 = <>]
    constexpr _Tp* __constexpr_addressof(_Tp& __t)
                   ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/experimental/optional:180:17: note: candidate function [with _Tp = const std::vector<int, std::allocator<int> >, $1 = <>]
    inline _Tp* __constexpr_addressof(_Tp& __t)
                ^
1 error generated.

This error occurs whenever I use a constant reference: apparently non-constant references are OK.
I'm using Linux Mint 18 with these versions of g++/libstdc++ 5.4.0 and clang++ 3.8.0:
$ g++ --version
g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ dpkg-query -s libstdc++-5-dev
...
Version: 5.4.0-6ubuntu1~16.04.4
...

$ clang++ --version
clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

Is this a bug in my program, libstdc++, or clang++?
Update: The problem goes away with clang 3.9.0.  (As explained below by Richard Smith and Ville Voutilainen, it seems that libstdc++ is expecting the compiler to behave in a certain way that doesn't match clang 3.8.0.)

A: That certainly looks like a clang bug to me, because the overloads it diagnoses as ambiguous have mutually-exclusive enable_if constraints, so it shouldn't be possible that they are ambiguous.


text:
Q: NSFetchRequest - can it return an array of properties? Unless I have missed something in the documentation, I can't see if it is possible to execute an NSFetchRequest so that it returns an array of properties of objects, instead of the objects themselves.
For example, I have:
@interface SaleDate {
NSDate *open;
NSDate *close;
Sale *sale;
}

I want to query something like close >= $today. However, this gives me an array of SaleDate, when what I really want is a distinct array of Sale. I am using this with a NSFetchedResultsController and so need it to deal with Sale object.
Incidentally, I have another (preferred) query working when using a binary store - it's the SQLite store that is making me go though hoops to find an alternate but equivalent query.

A: iPhone OS 2.x and Mac OS X 10.5 do not have this functionality.
See the NSFetchRequest documentation for iPhone OS 3.0, which does.
In particular, you want to look at
-setResultType:
-setReturnsDistinctResults:
-setPropertiesToFetch:

A: If you have an array of SaleDate and want an array of Sale, just write:
NSArray *arrayOfSale = [arrayOfSaleDate valueForKeyPath:"@sale"];

This assumes that SaleDate is KVC-compliant for the "sale" member. If SaleDate is a managed object and "sale" is a modeled property, this is already the case.


text:
Q: How to change SNMP community name of a Zebra ZM600 printer? I want to change SNMP community Name in Zebra ZM600 printer from public to private for ex:
snmpwalk -v1 -c public "address IP" enterprises.10642.20.10.10.5
when I walk the MIB tree I use public like a name of community , put I want change it to private or other name

A: Hi all I found the solution for this issue,
first I create file with ZPL II commands and I called it  test.zpl, inside the file I wrote this command :
^XA
^NN,,,test,test,test
^XZ

second I send this file to the printer by FTP with command line:
c:> put c:\test.zpl

third I restart the SNMP into the printer by telnet, and run the MIB tree.
snmpwalk -v1 -c CommunityNameHere "address IP" enterprises.10642.20.10.10.5


text:
Q: Simple chair anatomy? Do most people call it "the chair face"? This question is about "Simple chair anatomy?"
Most people know what are "the legs or the back of the chair"
I found this picture on the internet

Look at the picture on the right. They call it "the face of the chair" which is the part of the chair that people sit on.
My question is that:
is "the face of the chair" a common term just like its counterparts "the legs or the back of the chair"?
Most people say "the legs or the back of the chair" but I haven't heard "the face of the chair"?
Could we say "Do not put your feet on the face of the chair"?

A: Could we say "Do not put your feet on the face of the chair"?
We could, but no one would know what we were talking about. The part of a chair that we sit on is called the seat, as your left-hand drawing indicates.
The clue here is the source of your right-hand drawing. Notice that at the bottom are the words "I am Prikle." This is the title of a series of on-line comic strips, apparently now defunct (although the google will still find images upon request). Because it's a comic strip, it's references are supposed to be humorous and are not to be taken seriously. In fact, this particular "joke" may be intended as slightly off-color, but I'm far too old to either understand or be amused by online anything.
The only thing harder than properly understanding humorous language is spotting it in the first place.
By the way, Rowan is a line of chairs, and the title "Anatomy of  Rowan" plays on the fact that  many parts of chairs share names with body parts.

A: The part of the chair on which you sit is almost exclusively called the seat of the chair. Calling it the face of the chair is highly unusual - this is the first I have heard it. Most English speakers would be unlikely to immediately understand what was meant if it was referred to as the face.
Wikipedia's article on chairs has a section devoted to chair seats. In the article it is only referred to as the seat. https://en.wikipedia.org/wiki/Chair#Seats

A: The part of a chair, a stool, or an armchair on which you seat is called a seat. A seat is the part you seat on because you seat on it. There isn't any part of a chair that is referred to as "the face".


text:
Q: What is the difference between Minimum number of tasks and Desired number of tasks in ECS? I'm sorry if this question sounds shortsighted but I cannot get my head around the difference between these two parameters.
AWS docs don't give me the answer either:

For Minimum number of tasks, enter the lower limit of the number of tasks for Service Auto Scaling to use. Your service's desired count is not automatically adjusted below this amount.

For Desired number of tasks, this field is pre-populated with the value that you entered earlier. You can change your service's desired count at this time, but this value must be between the minimum and maximum number of tasks specified on this page.

Can someone help me understand this please. I'm using Fargate launch type BTW.

A: These two can appear to be similar values, however there's quite a major difference.
Minimum number of tasks is the small number of tasks that should ever exist. If this is 3 and it falls below 3 task then there are big problems (such as an AZ failure or host failure). This value should be able to cope with the minimal amount of load that you expect, in addition try to ensure it is highly available to support a single node failure.
Desired number of tasks is the amount of tasks ECS would like to be running, this will be in between the range of min and maximum but never exceeding the boundaries. This is not equal to the number of tasks running, it is simply the amount tasks that should be running (you may see this number increase before the autoscaing action kicks in).

A: I have observed even if desiredCount is set to be 1 and min = 6 and max =30 then after deployment desiredCount is set to 6.
This corresponds to the docu.

the service scheduler respects the desired count at all times, but as
long as you have active scaling policies and alarms on a service,
Service Auto Scaling could change a desired count that was manually
set by you.
If a service's desired count is set below its minimum capacity value,
and an alarm triggers a scale-out activity, Service Auto Scaling
scales the desired count up to the minimum capacity value and then
continues to scale out as required, based on the scaling policy
associated with the alarm. However, a scale-in activity does not
adjust the desired count, because it is already below the minimum
capacity value.


text:
Q: Can't 'file.open.read' a url within a ruby if-block I want to create a ruby script which will take barcodes from a text file, search a webservice for that barcode and download the result.
First I tried to test the webservice download. In a file when I hardcode the query things work fine:
result_download = open('http://webservice.org/api/?query=barcode:78686112327', 'User-Agent' => 'UserAgent email@gmail.com').read

It all works fine.
When I try to take the barcode from a textfile and run the query I run into problems.
IO.foreach(filename) {|barcode| barcode

website = "'http://webservice.org/api/?query=barcode:"+barcode.to_str.chomp + "', 'User-Agent' => 'UserAgent email@gmail.com'"

website = website.to_s

mb_metadata = open(website).read
}

The result of this is:
/home/user/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/open-uri.rb:37:in `initialize': No such file or directory @ rb_sysopen - http://webservice.org/api/?query=barcode:78686112327', 'User-Agent' => 'UserAgent email@gmail.com' (Errno::ENOENT)

I can't figure out if this problem occurs because the string I generate somehow isn't  a valid url and ruby is trying to open a non-existent file, or is the issue that I am doing all this in a for loop and the file/url doesn't exist there. I have tried using open(website).write instead of open(website).read but that produces the same error.
Any help would be much appreciated.

A: The error message you get explicitly states, that there is no such file:
http://webservice.org/api/?query=barcode:78686112327', 'User-Agent' => 'UserAgent email@gmail.com'.
You try to pass all the parameters to open method using 1 big string (website), which is wrong. You should do it like that.
IO.foreach(filename) do |barcode|
  website = "http://webservice.org/api/?query=barcode:#{barcode.to_str.chomp}"
  mb_metadata = open(website, 'User-Agent' => 'UserAgent email@gmail.com').read
end


text:
Q: Optimal restricted permutation Let L be a list of N items, from K < N different categories. For example, the string aababaaabaabb, where N=13, K=2. Let's suppose only swapping of consecutive elements is allowed, and only once per item, so items in the transformed list are never more than one position away of their original position. Swapping is costly, so there may be a limited swapping budget of M operations. These are the constraints.
I would like to obtain the list with the maximal structure, and the sequence of operations that lead to it. The "structure" can be objectively measured by a positive scalar function of the current state of the list.
I don't think the details are important, what matters is that for a given arrangement of elements in the list there is a single value that characterises the arrangement. To make it concrete it could be for example the class entropy of the partition of the list in blocks of consecutive elements of the same type (as described here or here).
The entropy of a partition P = {p1,p2,...,pn} with 0 < pi < 1 and sum(pi) = 1 is (pi is the fraction, frequency or probability of each component):
H(P) = -sum(pi * log(pi))

I think this could be cast as an optimisation problem, a MIP perhaps, and solved that way, though I haven't been able to formulate it properly.  This approach does not really attract me because the sequences I have are longer than the toy example, with more classes, and I have to do this a large number of times. There must be a more elegant solution. A greedy algorithm does not work either because this is a combinatorial problem and the global optimum (even within constraints) may not be reachable by a sequence of locally optimal moves.
I have a couple of questions:

*

*Does this (type of) problems have a name or class that would help me find algorithmic solutions ? Can someone provide any helpful pointer ?

*Is a brute force approach feasible ? The constraints severely restricts the search space but not to the point of trivialness... Any tip here ? (edited)
To end with the concrete example above, the non-redundant possibilities that make longer and more uniform blocks within the constraints are aaabbaaabaabb and aabbaaaabaabb (swapping 3 with 4 or 4 with 5, there are other equally good as the first). The initial partition would be {aa,b,a,b,aaa,b,aa,bb}, the  fraction of each block {2/13, 1/13, 1/13, 1/13, 3/13, 1/13, 2/13, 2/13}, the  fraction of each block within its class {2/8, 1/5, 1/8, 1/5, 3/8, 1/5, 2/8, 2/5} (the size or number of elements of class a is 8, and b is 5), and the class entropy H_0 the weighted sum of entropy for class a and b:
H_a = - 2/8*log(2/8) - 1/8*log(1/8) - 3/8*log(3/8) - 2/8*log(2/8)
    = 1.3208883

H_b = - 1/5*log(1/5) - 1/5*log(1/5) - 1/5*log(1/5) - 2/5*log(2/5)
    = 1.332179

H_0 = 8/13 * H_a + 5/13 * H_b
    = 1.3252309

while the entropy for the two possibilities above would be (lets call them H_1 and H_2)
H_a1 = - 3/8*log(3/8) - 3/8*log(3/8) - 2/8*log(2/8)
H_b1 = - 2/5*log(2/5) - 1/5*log(1/5) - 2/5*log(2/5)
H_1 = 8/13 * H_a1 + 5/13 * H_b1
    = 1.071705

H_a2 = - 2/8*log(2/8) - 4/8*log(4/8) - 2/8*log(2/8)
H_b2 = - 2/5*log(2/5) - 1/5*log(1/5) - 2/5*log(2/5)
H_2 = 8/13 * H_a2 + 5/13 * H_b2
    = 1.0455667

From these solutions the largest reduction in entropy is achieved by case 2, at the cost of 1 swap. There are two other solutions as good as case 1, but at a cost of 2 swaps.
Thanks a lot.
Edit 1 On the question of brute force and enumerating moves, it is actually simple.  Swaps can only occur at a class boundary in the list.  If there are J boundaries, then the total number of choices is upper bounded by:
Sum_i C_J,i <= 2^J - 1

where C_n,k is combination of n taken k at a time, and the sum goes from i = 1 to min(J,M).   In the example, J = 7.


text:
Q: Why does std::fstream use char*? I'm writing a small program that reads the bytes from a file in binary file in groups of 16 bytes (please don't ask why), modifies them, and then writes them to another file.
The fstream::read function reads into a char * buffer, which I was initially passing to a function that looks like this:
char* modify (char block[16], std::string key)

The modification was done on block which was then returned. On roaming the posts of SO, I realized that it might be a better idea to use std::vector<char>. My immediate next worry was how to convert a char * to a std::vector<char>. Once again, SO gave me an answer.
But now what I'm wondering is: If its such a good idea to use std::vector<char> instead of char*, why do the fstream functions use char* at all?
Also, is it a good idea to convert the char* from fstream to std::vector<char> in the first place?
EDIT: I now realize that since fstream::read is used to write data into objects directly, char * is necessary. I must now modify my question. Firstly, why are there no overloaded functions for fstream::read? And secondly, in the program that I've written about, which is a better option?

A: fstream() functions let you use char*s so you can point them at arbitrary pre-allocated buffers.  std::vector<char> can be sized to provide an appropriate buffer, but it will be on the heap and there's allocation costs involved with that.  Sometimes too you may want to read or write data to a specific location in memory - even in shared memory - rather than accepting whatever heap memory the vector happens to have allocated.  Further, you may want to use fstream without having included the vector header... it's nice to be able to avoid unnecessary includes as it reduces compilation time.
As your buffers are always 16 bytes in size, it's probably best to allocate them as char [16] data members in an appropriate owning object (if any exists), or on the stack (i.e. some function's local variable).
vector<> is more useful when the alternative is heap allocation - whether because the size is unknown at compile time, or is particularly large, or you want more flexible control of the memory lifetime.  It's also useful when you specifically want some of the other vector functionality, such as ability to change the number of elements afterwards, to sort the bytes etc. - it seems very unlikely you'll want to do any of that so a vector raises questions in the mind of the person reading your code about what you'll do for no good purpose.  Still, the choice of char[16] vs. vector appears (based on your stated requirements) more a matter of taste than objective benefit.

A: To use it with a vector, do not pass a pointer to the vector.  Instead, pass a pointer to the vector content:
vector<char> v(size);
stream.read(&v[0], size);


text:
Q: How to add external CSS files - styleUrls - Angular 5 component I have an Angular 5 application in a subdirectory of another parent application.
The parent application is a set of JSP, and other angularJs applications... etc.
What I'm trying to do is include a CSS file, from this parent application, into a component of the Angular 5 application.

@Component({
  selector: 'app-my-form',
  templateUrl: './my-form.component.html',
  styleUrls: [....] //Here
})

Is it possible ?
I looked at this question : Load external css style into Angular 2 Component
 already asked, but it does not correspond to my case.
Thanks for your help

A: Try the following:
@Component({
  selector: 'app-my-form',
  templateUrl: './my-form.component.html',
  styleUrls: ['my-form.css']
})

Your file will be a SCSS file: myform.scss.
And then you can import an external css file like this:
@import "my-external-stylesheet.css"; // this on the top of `my-form.scss`

A: your styleUrls can be the default one:
styleUrls: './my-form.component.css'

while in your my-form.component.css you can import the CSS files you want:
@import ".../component.css";

A: In the .angular-cli.json file of your child application look for the styles property of your app. Add the path to your parent CSS in there.
Here is an example of the JSON config.
 "apps": [
    {
      "styles": [
        "../../../../apec-template-bootstrap-responsive/src/main/resources/css/old-apec.css",
        "styles.css"
      ],
    }
  ],

This should give your child application any style you require from the parent.


text:
Q: Wifi stopped working without apparent reason I'm using Linux Mint 17.3 Rosa in a Dell Inspiron 1525 laptop. Wireless connection has been working for years in this laptop in different linux distros with proprietary Broadcom driver. I formated my computer 14 days ago, and wireless was working fine after that. I have been alternating between cabled and wireless connection. Yesterday, after disconnecting my cable connection, suddenly I could not use wireless anymore. The wifi networks are listed, but I cannot connect to them. I have confirmed (with other computer) that the network is working properly. I checked the packages that were installed or updated since last time wifi was working, and there were none.
My kernel version is
$ uname -a
Linux mycomputer 3.19.0-32-generic #37~14.04.1-Ubuntu SMP Thu Oct 22 09:37:25 UTC 2015 i686 i686 i686 GNU/Linux

Here is my wireless card:
$ lspci -knn | grep Net -A2
0b:00.0 Network controller [0280]: Broadcom Corporation BCM4312 802.11b/g LP-PHY [14e4:4315] (rev 01)
Subsystem: Dell Wireless 1395 WLAN Mini-Card [1028:000b]
Kernel driver in use: wl

Here is my dmesg output:
$ dmesg | grep wl
[   11.216767] wl: module license 'MIXED/Proprietary' taints kernel.
[   11.225409] wl: module verification failed: signature and/or  required key missing - tainting kernel
[   11.476882] wlan0: Broadcom BCM4315 802.11 Hybrid Wireless Controller 6.30.223.248 (r487574)

Here is the output of iwconfig:
$ iwconfig
wlan0     IEEE 802.11abg  ESSID:"housenet"
      Mode:Managed  Frequency:2.462 GHz  Access Point: 20:CF:30:C6:32:A5
      Retry short limit:7   RTS thr:off   Fragment thr:off
      Power Management:off

lo        no wireless extensions.

eth0      no wireless extensions.

Here is ip output (I don't know why it has state DORMANT and mode DORMANT):
$ ip link show wlan0
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state DORMANT mode DORMANT group default qlen 1000
link/ether 00:23:4d:a8:e4:77 brd ff:ff:ff:ff:ff:ff

Also, rfkill seems to show no problem.
$ rfkill list all
0: phy0: Wireless LAN
    Soft blocked: no
    Hard blocked: no
1: brcmwl-0: Wireless LAN
    Soft blocked: no
    Hard blocked: no

I've tried changing the driver from bcmwl-kernel-source to firmware-b43-installer, reboot the computer, but the problem persists. Strangely, the same problem is now happening in the USB-live version of LM 17.3.

A: I solved my similar issue, maybe this applies to you too.
It appears I had accidentally pressed Fn + F2, which in this Fujitsu Siemens turns off the wifi. And, surprise-surprise, it remembers the choice even after a shutdown.
Check to make sure there isn't a physical button or shortcut combo like mine which deactivates your wifi. Apparently this persists between reboots.


text:
Q: Make polygonal hole in QImage alpha channel I'm trying to make polygonal hole in QImage alpha channel.
My current implementation use deprecated 'alphaChannel' method and works slow (because it use containPoint for every image pixel instead of draw polygon).
QImage makeImageWithHole(const QImage & image, const std::vector<QPoint> & hole_points)
{
  QImage newImage = image.convertToFormat(QImage::Format_ARGB32);

  QImage alpha = newImage.alphaChannel();
  QPolygon hole(QVector<QPoint>::fromStdVector(hole_points));
  for (int x = 0; x < image.width(); x++)
  {
    for (int y = 0; y < image.height(); y++)
    {
      if (hole.containsPoint(QPoint(x, y), Qt::OddEvenFill))
      {
        alpha.setPixel(x, y, 0);
      }
    }
  }
  newImage.setAlphaChannel(alpha);

  return newImage;
}

I was also trying to implement it using painter and proper composition mode, but in result I have white artifacts on polygon borders.
QImage makeImageWithHole(const QImage & image, const std::vector<QPoint> & hole)
{
  QImage newImage = image.convertToFormat(QImage::Format_ARGB32);

  QPainter p(&newImage);
  p.setCompositionMode(QPainter::CompositionMode_SourceOut);
  p.setPen(QColor(255, 255, 255, 255));
  p.setBrush(QBrush(QColor(255, 255, 255, 255)));
  p.drawPolygon(hole.data(), hole.size());
  p.end();

  return newImage;
}

What is proper way to do this?

A: I think you should enable antialiazing like this:
QPainter p(&newImage);
p.setRenderHints(QPainter::Antialiasing);


text:
Q: Can't seem to download the tiles for my map application this is my first question and I've been messing around with android for just a couple of days now.
The problem arose when I tried to follow an example code to experiment with the MapView class (http://developer.android.com/resources/tutorials/views/hello-mapview.html).
I installed the Google APIs add-on in my SDK and did everything just as stated in the tutorial and the AVD ran the code perfectly, except for the fact that I got an empty grid instead of the actual map I thought I was supposed to see.
It looks like my debug key is wrong or something, but again here, I did everything just as stated in the tutorial. In fact, here's the line in my main.xml where the api key is specified:
    android:apiKey="48:C6:36:64:4A:DA:92:EF:D7:9E:BA:CD:26:45:EB:0D"

I got this key using the keytool command just like this:
    $ keytool -list -alias androiddebugkey -keystore /home/nelson/.android/debug.keystore -storepass android -keypass android

I tried the built in map application that comes with the AVD when you install the google API and it works perfectly, so there must be something wrong with my application, but I just have no idea of what. Any help?
Thanks in advance
Nelson R. Perez

A:
android:apiKey="48:C6:36:64:4A:DA:92:EF:D7:9E:BA:CD:26:45:EB:0D"

That's not your API key. Thats the fingerprint of your signing key.
Follow the Maps API key instructions starting from here, and you should be OK.


text:
Q: What is missing in the current constructions of pure and mixed motives? Yo! Maybe this question is too broad, so maybe it should be community wiki? In summary, I want to known all the known comparisons between all the constructions of pure and mixed motives and what make each one of these constructions fail to be the real category of pure and mixed motives.
In any case, there are a lot of constructions of what is supposed to be the category of pure and mixed motives. In the following, I will cite some of these ones. Please, feel free to edit, comment and add additional models for the category of motives.
I will focus on motives over a field $k$ or over a base scheme $S$. $\Lambda$ and $F$ will denote the coefficient rings. Furthermore $B$, $C$, $D$ will denote the Standard Conjectures.
Pure Motives
For the pure case, there are 3 main constructions when $F$ is of characteristic zero:

(Ch) Numerical (and homological) Chow motives $M_{num} (k, F)$ (resp., $M_{hom} (k, F)$);
(AH) Absolute Hodge cycles $M_{AH} (k, F)$ for $k$ of characteristic $0$;
(Mot) Motivated cycles $M_{mot} (k, F)$ for $k$ of characteristic $0$.

As I understand, what's missing is the following:

(Ch) Abelian semisimple, but it needs $D$ to have the universal property for Weil cohomologies and $C$ to be neutral Tannakian;
(AH) neutral Tannakian, but it needs the Hodge conjecture to satisfy the universal property for Weil cohomologies and $D$ to be abelian semisimple ;
(Mot) neutral Tannakian, but it needs $B$ to satisfy the universal property for Weil cohomologies and $D$ to be abelian semisimple.

1) Are the problems cited above the only ones to prevent any of these categories to be the real category of pure motives? Furthermore are there construction for $F$ of positive characteristic?
Mixed Motives
For the mixed case, there are $6$ main constructions (where only the first one is the abelian category of mixed motives, whereas the others are only the derived category):

(MR) Mixed motives for absolute Hodge cycles $MM_{AH} (k, F)$ when $k$ is of characteristic $0$ and $F$ is of characteristic $0$, i.e., the subcategory of compatible mixed realizations generated by the image of the realization of smooth quasi-projective varieties over $k$.
(V) Voevodsky motives $DM(S, \Lambda)$ for $S$ Noetherian;
(etV) Étale Voevodsky motives $DM_{ét} (S, \Lambda)$ for $S$ Noetherian;
(L) Levine motives $\mathcal{DM} (k, \Lambda)$ for $k$ a perfect field;
(H) Hanamura motives $M\mathcal{M} (k, \Lambda)$;
(N) Nori motives $\mathcal{MM}_{Nori} (k, \Lambda)$ for $k$ embeddable in $\mathbb{C}$.

As I understand, what's missing is the following:

(MR) Neutral Tannakian, but contains the same problems as (AH) for its subcategory of pure motives;
(V) It doesn't have a heart for $\Lambda = \mathbb{Z}$ and the Betti realization is not conservative;
(etV) It may have a heart for $\Lambda = \mathbb{Z}$, but it's not known;
(L) It coincides with (V) for $k$ of characteristic zero and for $k$ perfect and $F = \mathbb{Q}$. I don't know what happens in integral coefficients;
(H) I know nothing about it;
(N) It's compatible with the motivic t-structure of (V) for $\Lambda$ a Dedekind domain or a field and $k$ embeddable in $\mathbb{C}$ and, hence, it has the same problems as (V);

2) Are the problems cited above the only ones to prevent any of these categories to be the real category of mixed motives? Furthermore what are all the known comparisons between all these constructions beside the ones already cited above?
3) What happens in mixed characteristic with equal characteristic residue fields? How does one define the motivic t-structure when there is no Betti realization?
Thanks in advance.


text:
Q: Angular 4 router Error: Cannot activate an already activated outlet I have upgraded my application from Angular2 to Angular 4 . Before that everything including routing was working perfectly.But now after the upgrade, routing has stopped and whenever I click on any link, then the redirection fails and it gives error:
 Error: Uncaught (in promise): Error: Cannot activate an already activated outlet Error: Cannot activate an already activated outlet at k (http://localhost:3000/node_modules/zone.js/dist/zone.min.js:1:12455) at RouterOutlet.activateWith (http://localhost:3000/node_modules/@angular/router/bundles/router.umd.js:5368:19) at ActivateRoutes.placeComponentIntoOutlet (http://localhost:3000/node_modules/@angular/router/bundles/router.umd.js:4558:16) at ActivateRoutes.activateRoutes (http://localhost:3000/node_modules/@angular/router/bundles/router.umd.js:4539:26) at eval (http://localhost:3000/node_modules/@angular/router/bundles/router.umd.js:4475:58) at Array.forEach (native) at ActivateRoutes.activateChildRoutes (http://localhost:3000/node_modules/@angular/router/bundles/router.umd.js:4475:29) at ActivateRoutes.activate (http://localhost:3000/node_modules/@angular/router/bundles/router.umd.js:4449:14) at eval (http://localhost:3000/node_modules/@angular/router/bundles/router.umd.js:4066:22) at SafeSubscriber.eval [as _next] (http://localhost:3000/node_modules/rxjs/Observable.js:110:21) at SafeSubscriber.__tryOrSetError (http://localhost:3000/node_modules/rxjs/Subscriber.js:245:16) at SafeSubscriber.next (http://localhost:3000/node_modules/rxjs/Subscriber.js:187:27) at Subscriber._next (http://localhost:3000/node_modules/rxjs/Subscriber.js:125:26) at Subscriber.next (http://localhost:3000/node_modules/rxjs/Subscriber.js:89:18) at MapSubscriber._next (http://localhost:3000/node_modules/rxjs/operator/map.js:83:26) at k (http://localhost:3000/node_modules/zone.js/dist/zone.min.js:1:12455) at RouterOutlet.activateWith (http://localhost:3000/node_modules/@angular/router/bundles/router.umd.js:5368:19) at ActivateRoutes.placeComponentIntoOutlet (http://localhost:3000/node_modules/@angular/router/bundles/router.umd.js:4558:16) at ActivateRoutes.activateRoutes (http://localhost:3000/node_modules/@angular/router/bundles/router.umd.js:4539:26) at eval (http://localhost:3000/node_modules/@angular/router/bundles/router.umd.js:4475:58) at Array.forEach (native) at ActivateRoutes.activateChildRoutes (http://localhost:3000/node_modules/@angular/router/bundles/router.umd.js:4475:29) at ActivateRoutes.activate (http://localhost:3000/node_modules/@angular/router/bundles/router.umd.js:4449:14) at eval (http://localhost:3000/node_modules/@angular/router/bundles/router.umd.js:4066:22) at SafeSubscriber.eval [as _next] (http://localhost:3000/node_modules/rxjs/Observable.js:110:21) at SafeSubscriber.__tryOrSetError (http://localhost:3000/node_modules/rxjs/Subscriber.js:245:16) at SafeSubscriber.next (http://localhost:3000/node_modules/rxjs/Subscriber.js:187:27) at Subscriber._next (http://localhost:3000/node_modules/rxjs/Subscriber.js:125:26) at Subscriber.next (http://localhost:3000/node_modules/rxjs/Subscriber.js:89:18) at MapSubscriber._next (http://localhost:3000/node_modules/rxjs/operator/map.js:83:26) at k (http://localhost:3000/node_modules/zone.js/dist/zone.min.js:1:12455) at f (http://localhost:3000/node_modules/zone.js/dist/zone.min.js:1:11503) at f (http://localhost:3000/node_modules/zone.js/dist/zone.min.js:1:11189) at http://localhost:3000/node_modules/zone.js/dist/zone.min.js:1:12017 at e.invokeTask (http://localhost:3000/node_modules/zone.js/dist/zone.min.js:1:19923) at Object.onInvokeTask (http://localhost:3000/node_modules/@angular/core/bundles/core.umd.js:4123:37) at e.invokeTask (http://localhost:3000/node_modules/zone.js/dist/zone.min.js:1:19844) at n.runTask (http://localhost:3000/node_modules/zone.js/dist/zone.min.js:1:15612) at i (http://localhost:3000/node_modules/zone.js/dist/zone.min.js:1:10565) at HTMLAnchorElement.invoke (http://localhost:3000/node_modules/zone.js/dist/zone.min.js:1:20839)

Here is my code
app.routing.ts
 const routes: Routes = [
        { path: 'login', component: LoginComponent },
        { path: "", component: DashboardComponent, canActivate: [AuthGuard] },
        { path: 'app/dashboard', component: DashboardComponent, canActivate: [AuthGuard] },
        { path: 'app/dashboardMensuel', component: DashboardMensuelComponent, canActivate: [AuthGuard] },

    export const appRoutingProviders: any[] = [
    ];

    export const routing: ModuleWithProviders = RouterModule.forRoot(routes);

app.module.ts
@NgModule({
    imports: [routing,RouterModule,FormsModule,ReactiveFormsModule,HttpModule, BrowserModule],
    declarations: [AppComponent],
    bootstrap: [AppComponent],
    providers: [ appRoutingProviders})
    export class AppModule {
         constructor(){
    }
    }

Sidebar.component.html

                    Dashboard

app.html

                        <sidebar-component ></sidebar-component>

                         <router-outlet ></router-outlet>

 2016 © By

A: Actually , the issue lies somewhere else . I have added BrowserAnimationModule and "
'@angular/platform-browser/animations': 'npm:@angular/platform-browser/bundles/platform-browser-animations.umd.js',

" in SystemJS , but there was a warning for animations (which initially I ignored) and concentrated on this router outlet error. But when I added "
'@angular/animations':'npm:@angular/animations/bundles/animations.umd.js',
'@angular/animations/browser': 'npm:@angular/animations/bundles/animations-browser.umd.js',

" in SystemJS for solving the warning , the error related to router-outlet also resolved.

A: Trying to activate 'xyz' route where router-outlet is already active for 'xyz' route. Maybe the intention is not to active 'xyz' route.
check here Github. In particular, check how to deactivate router-outlet.

A: Just to put this here if anyone has similar issue:

*

*my error was only on Firefox

*it disapeared after removing encapsulation: ViewEncapsulation.Native from component


text:
Q: The following NoSuchMethodError was thrown building CatMealsScreen i am trying to use "OnGenerateRoute" but the error appear but when iam using "Routes" directly it works well  "The following NoSuchMethodError was thrown building CatMealsScreen(dirty, dependencies: [_ModalScopeStatus]):
The method '[]' was called on null.
Receiver: null
Tried calling:("tittle") "
import 'dart:io';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:resturant/widgets/meal.dart';
import '../DUMMY_CATEGORIES.dart';
import 'package:resturant/widgets/mealItem.dart';

class CatMealsScreen extends StatefulWidget {
static const routesNames = '/CatMealScreen';
final List<Meal> _availableMeals2;

CatMealsScreen(this._availableMeals2);

@override
_CatMealsScreenState createState() => _CatMealsScreenState();
}

class _CatMealsScreenState extends State<CatMealsScreen> {
String catTittle;

List<Meal> displayMeals;
bool _loadInitData = false;

@override
void didChangeDependencies() {
 // TODO: implement didChangeDependencies
 if (_loadInitData == false) {
  final routeArg =
      ModalRoute.of(context).settings.arguments as Map<String, String>;
  catTittle = routeArg['tittle'];
  final catId = routeArg['id'];
  displayMeals = widget._availableMeals2.where((meal) {
    return meal.categories.contains(catId);
  }).toList();
  _loadInitData = true;
 }
super.didChangeDependencies();
}

@override
Widget build(BuildContext context) {
return Scaffold(
    appBar: AppBar(
      title: Text(catTittle),
    ),
    body: ListView.builder(
        itemBuilder: (ctx, index) {
          return MealItem(
            id: displayMeals[index].id,
            title: displayMeals[index].title,
            imageUrl: displayMeals[index].imageUrl,
            duration: displayMeals[index].duration,
            affordability: displayMeals[index].affordability,
            complexity: displayMeals[index].complexity,
          );
        },
        itemCount: displayMeals.length));
     }
     }

the main file
import 'dart:io';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:resturant/DUMMY_CATEGORIES.dart';
import 'package:resturant/screenWidget/mealDetails.dart';
import 'package:resturant/screenWidget/settings.dart';
import 'package:resturant/screenWidget/tabsScreen.dart';
import 'package:resturant/widgets/meal.dart';
import 'screenWidget/catMealsScreen.dart';
import 'screenWidget/catScreen.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
Map<String, bool> _filters = {
'gluten': false,
'lactose': false,
'vegan': false,
'vegetarian': false,
};
List<Meal> _availableMeals = DUMMY_MEALS;
List<Meal> _favouriteMeals = [];

void _setFilter(Map<String, bool> filterData) {
setState(() {
  _filters =
      filterData; // the new value of filters will equal to the value of filterData
  // that when the setstate() work it will work on the new value of filter
  _availableMeals = DUMMY_MEALS.where((meal) {
    if (_filters['gluten'] == true && !meal.isGlutenFree) {
      return false;
    }
    if (_filters['lactose'] == true && !meal.isLactoseFree) {
      return false;
    }
    if (_filters['vegan'] == true && !meal.isVegan) {
      return false;
    }
    if (_filters['vegetarian'] == true && !meal.isVegetarian) {
      return false;
    }
    return true;
  }).toList();
});
}

void _toggleMeals(String mealId) {
final existingMeal =
    _favouriteMeals.indexWhere((element) => element.id == mealId);
 if (existingMeal >= 0) {
  setState(() {
    _favouriteMeals.removeAt(existingMeal);
  });
} else {
  setState(() {
    _favouriteMeals.add(
      DUMMY_MEALS.firstWhere((element) => element.id == mealId),
    );
  });
}
}

bool isFavMeal(String id) {
 return _favouriteMeals.any((element) => element.id == id);
}

 @override
 Widget build(BuildContext context) {
  return Platform.isIOS
    ? CupertinoApp()
    : MaterialApp(
        title: 'DeliMeals',
        theme: ThemeData(
          primarySwatch: Colors.pink,
          accentColor: Colors.amber,
          canvasColor: Color.fromRGBO(255, 255, 204, 1),
          fontFamily: 'Raleway',
          textTheme: ThemeData.light().textTheme.copyWith(
                body1: TextStyle(
                  color: Color.fromRGBO(20, 51, 51, 1),
                ),
                body2: TextStyle(
                  color: Color.fromRGBO(20, 51, 51, 1),
                ),
                title: TextStyle(
                    fontFamily: 'RobotoCondensed',
                    fontSize: 18,
                    fontWeight: FontWeight.bold),
              ),
        ),
        home: TabsScreen(_favouriteMeals),
        routes: {
          CatMealsScreen.routesNames: (ctx) =>
              CatMealsScreen(_availableMeals),
          MealDetail.routeNmaes: (ctx) => MealDetail(_toggleMeals , isFavMeal),
          Settings.routeNames: (ctx) => Settings(_setFilter, _filters),
        },
        onGenerateRoute: (settings) {
          print(settings.arguments);
          return MaterialPageRoute(builder: (ctx) => CatMealsScreen());
        },
        onUnknownRoute: (setting) {
          return MaterialPageRoute(builder: (ctx) => CatMealsScreen());

          // both produce the same error
        },
      );
     }
     }

A: I guess you need to make a switch statement for the settings you get in onGenerateRoute, so depending on the name you get which is basically the route name you provide, you should return the proper screen you want to navigate to. I also think that you don't need the routes property since you're using onGenerateRoute.
 onGenerateRoute: (settings) {
      switch(settings.name){
      case CatMealsScreen.routesNames:
        return CatMealsScreen();

      }
    },


text:
Q: Difference of methods defined on this in contrast to defined in class body What is the difference between when I add a method to all instances of a class in the constructor via
this.bar = function() {}

as opposed to defining the function right in the class body
baz() {}

?

class Foo {
  constructor() {
    this.bar = function() {};
  }

  baz() {}
}

console.log(Object.prototype.hasOwnProperty.call(new Foo, 'bar')); // true
console.log(Object.prototype.hasOwnProperty.call(new Foo, 'baz')); // false

If I simply replace this.baz with this.baz in the constructor, both tests return true:

class Foo {
  constructor() {
    this.bar = function() {};
    this.baz = this.baz;
  }

  baz() {}
}

console.log(Object.prototype.hasOwnProperty.call(new Foo, 'bar')); // true
console.log(Object.prototype.hasOwnProperty.call(new Foo, 'baz')); // true now

A: When you do this.bar = function() { }; in the constructor, you're creating a new function for every instance, and assigning it to the bar property. This lets the function close over something in the constructor if you want it to. (And if you used an arrow function, the function would close over this and super.)
When you declare a method in the class, you're creating a single function on the prototype object that class will assign to instances, and reusing that function. This lets the function use super if it needs to access superclass features.
Both have their place depending on what you're doing. You can see that difference here:

class Foo1 {
    constructor() {
        this.bar = function() {};
    }
}

class Foo2 {
    bar() {}
}

const f1a = new Foo1();
const f1b = new Foo1();
console.log(f1a.bar === f1b.bar); // false

const f2a = new Foo2();
const f2b = new Foo2();
console.log(f2a.bar === f2b.bar); // true

About this:
this.baz = this.baz;

in
class Foo {
  constructor() {
    this.bar = function() {};
//             vvvvvvvv−−−−−−−−−−−−−−− reads from the prototype
    this.baz = this.baz;
//  ^^^^^^^^−−−−−−−−−−−−−−−−−−−−−−−−−− writes to the instance

  }

  baz() {}
}

that's looking up the function on the prototype, and then assigning it directly on the object, which is why it becomes an own property after that assignment.


text:
Q: Paginating XHTML to PNG image files using Flying Saucer I'm using Flying Saucer to create PNG image files from XHTML.  I then use another facility to collect these into a PDF, along with a bunch of other text n images.
While I could convert our PDF export processing to iText, that would be a rather large undertaking....
The problem I have is that some XHTML content I have need to be paginated when exported to PNG image files.  I'm OK with just a simple 'clip-style' break between the image files.
Here's what I'm using just to render the entire content to a single file and it works well.
File file = File.createTempFile("AAA", "." + suffix);
XHTMLPanel panel = new XHTMLPanel();
panel.setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);

InputStream is = <create content>;

panel.setDocument(is, "");

Graphics2DRenderer renderer = new Graphics2DRenderer();
renderer.setDocument(panel.getDocument(),"");

BufferedImage img = new BufferedImage(DEFAULT_WIDTH,
         DEFAULT_HEIGHT, BufferedImage.TYPE_INT_ARGB);
Graphics2D graphics = (Graphics2D) img.getGraphics();
graphics.setColor(Color.white);
graphics.fillRect(0, 0, DEFAULT_WIDTH, DEFAULT_HEIGHT);

renderer.layout(graphics,null);
renderer.render(graphics);

ImageIO.write(img, suffix, file);

However, some of my content 'spans' a couple of pages and the processing above just displays the top DEFAULT_HEIGHT pixels and clips the remainder.
Is there a way to 'iterate' through the panel content (vertically) and render, say X pixels of content to unique image files?  That's sort of what ITextRenderer does, but how can I render the individual pages to separate image files?

A: Figgered this out.  Fortunately the Graphics2DRenderer lets me know how large an XHTML section is (width n height).
I just re-render into a BufferedImage of that size, and then iteratively peel off parts of that full image into 'page' images with the Grahpics2D.drawImage(Image, , ) and then dump those to disk.
Not the prettiest, but it works.


text:
Q: Rails includes with where I'm trying to eager load some associations, but I want to do filtering on some of the sub-relations here is what I mean.
class MyModel < ActiveRecord::Base
  has_many :my_model_details, dependent: :destroy
end

class MyModelDetails < ActiveRecord::Base
  belongs_to :property
  belongs_to :my_model
  belongs_to :track
  belongs_to :person
end

So if I want to get all MyModel objects which have details that belong to certain property with property name I would do this.
MyModel.includes(my_model_details: [:property, :person]).where('property.property_name = ?', 'Property name')

The reason why I want use includes instead of joins, is that I want to have my model details in grouped by the last property and person name. So I don't want to fire the N+1 query in that case.
Ex
If my query returns single MyModel object with two MyModelDetail records.
Where mymodeldetail id 1 has property id 1 and mymodeldetail id2 has property id 2. And they both belong to the same person.
So on my UI I would display this:
MyModel 1
  MyModelDetail 2 - Property name: 'some name' - Person: 'Bob'

Now what happens when I use my includes query is this :
MyModel.includes(my_model_details: [:property, :person]).where('property.property_name = ?', 'Property name')

SELECT "MY_MODEL".* FROM "MY_MODEL" WHERE (PROPERTY.PROPERTY_NAME = 'Prop')

If I use includes with where, join sql is not generated at all and so this query fails of course:
"PROPERTY"."PROPERTY_NAME": invalid identifier

Why is that, I'm using rails 4? How can I make it work with both joins and includes

A: I think it should be properties, because table name is pluralized according to CoC, try using properties.property_name instead
MyModel.includes(my_model_details: [:property, :person]).where('properties.property_name = ?', 'Property name')

As suggested by BroiSatse, add .references(:properties) to your query
Hope that helps!


text:
Q: How to set up a Jersey init param? I need to set up the jersey.config.server.response.setStatusOverSendError configuration to true.

A: Setting Jersey properties in a JAX-RS application is possible by providing an overridden method getProperties() in a custom Application class, like in this example in Jersey tests:
public class MyApplication extends Application {

    @Override
    public Map<String, Object> getProperties() {
        return new HashMap<String, Object>() {{
            put("jersey.config.server.response.setStatusOverSendError", true);
        }};
    }
}

The same thing should be possible with an init-param of the Jersey servlet in web.xml, like in this Jersey test app:
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
        <init-param>
            <param-name>jersey.config.server.provider.packages</param-name>
            <param-value>org.glassfish.jersey.tests.integration.servlettests</param-value>
        </init-param>


text:
Q: How to hide/remove featured images in particular categories post?
I have multiple posts in three categories.
The categories are
1. News
2. Images
3. Videos
If i click any post that Post's Feature image was shown in top of the article. But other two categories is ok but in Videos category i dont want to display feature images. Is there any way to do this..
(Note: I am setting feature images for videos category because i am using that image in different place. So i cant remove this. So tell some solution to hide image when viewing post)

A: I assume that all your posts are come from single.php. WordPress provides has_category() function to check if post has specific category.
So your code on single.php will need to be like something in given below
if( !has_category('video') ){
   the_post_thumbnail();
}

where it checks if post has 'video' category. And if it is false then the feature image will be displayed. otherwise, it can't. Hope it will be help you.


text:
Q: SSH not working on server I'm trying to ssh into a server and get the following error ssh: connect to host server.mylan.lan port 22: No route to host
The strange thing is it was working and then suddenly no more, is this common, the server is running Centos 5.2

A: on the server check:
service sshd status
iptables -L

if port 22 is open and the service is running, you have a network issue

A: I concur with sybreon and lg.  This is a network issue not an ssh issue.  'No route to host' indicates that the client machine cannot make an intial network connection to the server.
Either 'server.mylan.lan' no longer resolves to your server's IP address or a critical part of infrastructure is down making your subnet unavailable, or the server is switched off maybe??

A: DNS problem? Can you ping server.mylan.lan? Try to ssh into server by ip address.

A: This is not an SSH problem but a networking one. You may want to check your networking settings particularly your gateway. Try pinging server.mylan.lan to see if you can even ping the machine.
Chances are you won't be able to. Then check your route
# route -n
# traceroute server.mylan.lan

And see what happens. Something probably changed in the networking between you and the server. Maybe a new router was installed or maybe the firewall rules changed in between.

A: No route to host?
at prompt do:
me@myMachine:~$ ping yourMachine

A: If you are on the same subnet of the server you're trying to ssh to, then it's probably a DNS or IPtables related issue.
"No route to host" means you cannot get the server address at all, not just the ssh service.
Try checking iptables rules on the server (if you can plug a monitor and a keyboard into it of course).
Check the output of
# dig server.mylan.lan

Try pinging its hostname and/or its ip address.
If your server is on a different network, check all the above AND the routing tables.
# traceroute server.mylan.lan

could be useful as well.


text:
Q: {Ctrl} + {Scroll Wheel Up/Down} zooms too fast when viewing .Pdf files in Google Chrome I have the latest Google Chrome (83.0.4103.116), Adobe Acrobat Reader DC (20.009.20067), Windows 10 laptop, Logitech M510 mouse with LogiOptions software (8.20.329).
My issue is that when I open a .pdf file in Google Chrome, and I zoom in/out using ctrl + mouse wheel, the zoom function is extremely fast. For example, at 100% zoom, if I zoom out once (one scroll wheel tick), it goes to 40%. From there, if I just zoom in twice, we are already at 256%. What is going on?
This specifically only happens when zooming with Ctrl + scroll wheel, only for .pdf documents, only opened in Google Chrome. Enabling/disabling smooth scrolling, doesn't fix it either.

A: I had same problem with logitech mouse, in my case it was logitech mx vertical. Except in my case this was issue for both pdf files and google maps, that were scrolling too fast.
I solved the issue by downloading logitech options app and then disabling smooth scrolling.
Hopefully it will help someone else, because when I tried to find solution for that I stumbled on this post.


text:
Q: Which hyperref variable can I set to make a pdf open with the "Comment" tool displayed in the right panel of the window? We are using Adobe Acrobat X when viewing our pdf files produced by pdflatex and the hyperref package.  To make the commenting process more intuitive for users not familiar with Adobe Acrobat X, I want the pdf to automatically open with the Comment tool displayed on the right hand side of the document, as shown in the illustration below.  Is that possible? Can I set some hyperref variable to accomplish that?

A: Unlike bookmarks or thumbnails, there is AFAIK no setting in the PDF catalog for comment tools. But JavaScript seems to allow this, see JavaScript for Acrobat API Reference.
The following example adds a JavaScript action, when the document is opened. The example is written for pdflatex/lualatex and assumes hyperref is loaded (but the latter is not needed).
Perhaps the menu item "SaveHideToolbarCommenting" toggles the commenting tools view.
Therefore I have also added a bookmark that calls this menu item.
The example file:
\documentclass{article}
\usepackage{hyperref}

% disable hyperref's openaction
\hypersetup{pdfstartpage={}}
% set JavaScript openaction
\pdfcatalog{}openaction user{%
  <<%
    /S/JavaScript%
    /JS(%
      % app.alert("ShowHideToolbarCommenting")%
      app.execMenuItem("ShowHideToolbarCommenting")%
      % app.execMenuItem("SaveAs")%
    )%
  >>%
}\relax

\usepackage[atend]{bookmark}
\bookmarksetup{
  open,
  numbered,
}
\BookmarkAtEnd{% or \AtBeginDocument
  \bookmark[
    startatroot,
    level=0,
    italic,
    rawaction={%
      /S/JavaScript%
      /JS(%
        app.execMenuItem("ShowHideToolbarCommenting")%
      )%
    },
  ]{Toggle Comment Tool}%
}

\begin{document}
\section{Hello World}
\end{document}

Edit:
The menu item string can also be used in named actions, that simplifies the example and JavaScript is not needed:
\documentclass{article}
\usepackage{hyperref}

% disabe hyperref's openaction
\hypersetup{pdfstartpage={}}
% set JavaScript openaction
\pdfcatalog{}openaction user{%
  <<%
      /S/Named%
      /N/ShowHideToolbarCommenting%
  >>%
}\relax

\usepackage[atend]{bookmark}
\bookmarksetup{
  open,
  numbered,
}
\BookmarkAtEnd{% or \AtBeginDocument
  \bookmark[
    startatroot,
    level=0,
    italic,
    named=ShowHideToolbarCommenting,
  ]{Toggle Comment Tool}%
}

\begin{document}
\section{Hello World}
\newpage
\section{Second Page}
\end{document}

Unhappily the action "ShowHideToolbarCommenting" does open the commenting sidebar for the OP. In the PDF catalog object preferences for showing bookmarks, thumbnails or open content groups can be configured to some degree, but commenting is not part of this.


text:
Q: Accessing AWS S3 via a REST API (Apex callout with a Named Credential) I am trying to make a callout to AWS S3 using named credentials and Apex
The named credential is set up as follows
Label: AWS S3
Name: AWS_S3
URL: https://bucket-name.s3.amazonaws.com
-
Certificate:
Identity Type: Named Principal
Authentication Protocol: AWS Signature Version 4
AWS Access Key: AKIAxxxxxx
AWS Secret Access Key: xxxxxx
AWS Region: ap-southeast-2
AWS Service: s3
-
Generate Authorization header: true
Merge fields in header: false
Merge fields in body: false

The Apex class is very simple
HttpRequest req = new HttpRequest();
req.setEndpoint('callout:AWS_S3');
req.setMethod('GET');
Http http = new Http();
HTTPResponse res = http.send(req);
System.debug(res.getBody());
return res.getBody();

The response body contains the following:

SignatureDoesNotMatchThe request signature we calculated does not match the signature you provided. Check your key and signing method.AKIAxxxxx

I have used the same bucket, endpoint and credentials using Postman and am able to successfully return the list of objects in the bucket so it is not an IAM permissions issue
There have been a couple of similar questions on stackexchange but unfortunately they do not provide any resolution or assistance in this case:
AWS Signature Version 4 Using Named Credentials
AWS Signature Version 4 Named Credential doesn't seems like working
I've tried looking for code samples or further pointers in the Apex documentation but it doesn't really give any further guidance on how to proceed or correctly set this up so I'm a bit stuck

A: Okay so the answer is actually pretty straightforward so am leaving it here for anybody else struggling with the same issue.
The endpoint needs to have a trailing / so either your URL in the named credential needs to look like this
https://bucket-name.s3.amazonaws.com/
Or when you are making the callout append the / in the Apex like this
req.setEndpoint('callout:AWS_S3/');


text:
Q: iOS Receipt Data return nil in other devices I am developing auto-renew subscription in my app.
When the app starts, it would call appStoreReceiptURL to get the receipt and send it to server for verify.
My situation is ...
There has 2 devices D1 and D2, sign in with same account A1.
1). Build the app to the device with Xcode, sign in same sandbox test account.
    Doing purchase in D1 first, after purchase success, open app in D2, but the appStoreReceiptURL return nil data.
2). Build the release app and upload to TestFlight, and install app to devices.
    Sign in with same TestFlight account.
    Doing purchase in D1 first, after purchase success, open app in D2, but the appStoreReceiptURL still return nil data.
In my expectation, no matter the devices, it should return same Receipt Data if they are logging with same Apple Account.
I have no idea about that and cannot find any official documents, is my assumption is right?
Thanks

A: The receipt file is not present in sandbox until a purchase is made. In production the receipt file will almost alway be there since it's generated upon downloading the app. You should still be able to handle cases where the receipt is missing in case the user is logged out of their iTunes account.
Once you get the appStoreReceiptURL you can verify it with Apple's /verifyReceipt endpoint from your server to get the latest subscription status.


text:
Q: How to filter out columns when retrieveing data (Waterline) I have a table with columns a,b,c,d. But I want to send to browser just data from a,b. Ive found it is possible to override toJSON() method but it seems to me this is a solution for 1-row results. How to make this work for array of jsons?
I could make my own function to iterate over the array and delete the unwanted properties but I feel like there should be a better solution for this.
Thanks for any help.

A: If you're returning an array of instances using res.json, it will run toJSON on each instance in the array.  So:
User.find().exec(function(err, users) {
  if (err) {return res.negotiate(err);}
  return res.json(users);
});

will return an array of users with toJSON called on each one.


text:
Q: Create rgbd_image from pointcloud in Open3d I added some filtering and other preprocessing steps to my pipeline in Open3d.
However I end up with a Pointcloud, but i.e. o3d.pipelines.odometry.compute_rgbd_odometry() takes in rgbd_images.
How can I convert the pointclouds into rgbd images or if this isn't possible take a workaround to store the pointcloud as depth png and read it using o3d.io.read_image()

A: As long as it's an Open3D PCD object, and it has "color" data - then you can export a color image as follows:
rgbd_from_point_cloud = o3d.geometry.PointCloud.Type.RGBDImage

http://www.open3d.org/docs/release/python_api/open3d.geometry.PointCloud.html
The above site will give you more details, you should be able to find examples on the Open3D github on how to better use.


text:
Q: Error Building Giraffe (Chess Program): /opt/local/bin/as: assembler (/opt/local/bin/clang) not installed I'm trying to build the Giraffe Deep Belief Chess Playing program which I downloaded from Mercurial.
From README.md:
 Tested on Linux (GCC 4.9), OS X (GCC 4.9), Windows (MinGW-W64 GCC 5.1). GCC versions earlier than 4.8 are definitely NOT supported, due to broken regex implementation in libstdc++.
Here's the error:
David-Laxers-MacBook-Pro:giraffe davidlaxer$ make
g++ -Wall -Wextra -Wno-unused-function -std=gnu++11 -mtune=native -Wa,-q -ffast-math -pthread -fopenmp -DHGVERSION="\"efceca80bf74\"" -O3 -march=native -Wa,-q -I. -c backend.cpp -o obj/backend.o
/opt/local/bin/as: assembler (/opt/local/bin/clang) not installed
make: *** [obj/backend.o] Error 1

I'm on OS X 10.10.5.
port select --list clang
Available versions for clang:
    mp-clang-3.5
    mp-clang-3.7
    none (active)

David-Laxers-MacBook-Pro:giraffe davidlaxer$ ls -l /opt/local/bin/as
-r-xr-xr-x  1 root  admin  28012 Feb 15  2015 /opt/local/bin/as

David-Laxers-MacBook-Pro:giraffe davidlaxer$ /opt/local/bin/as -v
Apple Inc version cctools-862, GNU assembler version 1.38

David-Laxers-MacBook-Pro:giraffe davidlaxer$ file /opt/local/bin/as
/opt/local/bin/as: Mach-O 64-bit executable x86_64

David-Laxers-MacBook-Pro:giraffe davidlaxer$ g++ --version
g++ (MacPorts gcc49 4.9.3_0) 4.9.3
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

From Makefile:
#CXX=g++-4.9  # I changed this - dbl
CXX=g++

# this is used to build gtb only
CC=gcc-4.9

HGVERSION:= $(shell hg parents --template '{node|short}')

CXXFLAGS_BASE = \
        -Wall -Wextra -Wno-unused-function -std=gnu++11 -mtune=native -Wa,-q -ffast-math \
        -pthread -fopenmp -DHGVERSION="\"${HGVERSION}\""

A: Here is what I did to solve this issue using Brew,
$ clang
zsh: no such file or directory: clang

$ brew install llvm --with-clang --with-asan
==> Downloading http://llvm.org/releases/3.5.0/llvm-3.5.0.src.tar.xz
######################################################################## 100.0%
  /usr/local/Cellar/llvm/3.5.0: 1235 files, 171M, built in 16.8 minutes

$  clang -v
Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix