text:
Q: C# execute on command prompt running geth I have a listener service where I can send a command to it, but with this service, it's unable to send a command to a command prompt running ethereuem's geth. Is there a way to forcibly get the keyboard strokes through?
I notice that I have other code that can find a command prompt by name or id and able to bring that window to the front, but when I attempt to do that with the command prompt that is running geth, it can't seem to bring that window to the front. I hope that bit of information may help.
namespace Listener
{
    class Program
    {
        static void Main(string[] args)
        {
            using (var listener = new HttpListener())
            {
                listener.Prefixes.Add("http://localhost:8081/mytest/");

                listener.Start();

                string command = string.Empty;

                for (; ; )
                {
                    Console.WriteLine("Listening...");

                    HttpListenerContext context = listener.GetContext();
                    HttpListenerRequest request = context.Request;

                    // TODO: read and parse the JSON data from 'request.InputStream'

                    using (StreamReader reader = new StreamReader(request.InputStream))
                    {
                        // Would prefer string[] result = reader.ReadAllLines();
                        string[] result = reader.ReadToEnd().Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                        foreach (var s in result)
                        {
                            command = s;
                        }
                    }

                    // send command to other geth window
                    sendKeystroke(command);

                    using (HttpListenerResponse response = context.Response)
                    {
                        // returning some test results

                        // TODO: return the results in JSON format

                        string responseString = "Hello, world!";
                        byte[] buffer = System.Text.Encoding.UTF8.GetBytes(responseString);
                        response.ContentLength64 = buffer.Length;
                        using (var output = response.OutputStream)
                        {
                            output.Write(buffer, 0, buffer.Length);
                        }
                    }
                }
            }
        }

        [DllImport("user32.dll")]
        static extern bool SetForegroundWindow(IntPtr hWnd);
        private static void sendToOpenCmd(string command)
        {
            int processId = 13420;
            //processId = int.Parse(13420);
            System.Diagnostics.Process proc = (from n in System.Diagnostics.Process.GetProcesses()
                                               where n.ProcessName == "geth"
                                               //where n.Id == processId
                                               select n).FirstOrDefault();
            if (proc == null)
            {
                //MessageBox.Show("No such process.");
                Console.WriteLine("No such process.");
            }
            else
            {
                SetForegroundWindow(proc.MainWindowHandle);
                SendKeys.SendWait(command + "{enter}");
                Console.WriteLine("Sent! " + command + " " + DateTime.Now.ToString());
            }

        }

        [DllImport("user32.dll")]
        public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
        [DllImport("user32.dll")]
        public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
        [DllImport("user32.dll")]
        public static extern IntPtr PostMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);

        public static void sendKeystroke(string command)
        {
            const uint WM_KEYDOWN = 0x100;
            const uint WM_SYSCOMMAND = 0x018;
            const uint SC_CLOSE = 0x053;

            IntPtr WindowToFind = FindWindow(null, "geth");

            //ushort[] result = command.Where(i => ushort.TryParse(i, out short s)).Select(ushort.Parse);
            //ushort[] result = command.Where(i => { ushort r = 0; return ushort.TryParse(i, out r); }).Select(ushort.Parse);
            ushort result;
            ushort.TryParse(command, out result);
            IntPtr result3 = SendMessage(WindowToFind, WM_KEYDOWN, ((IntPtr)result), (IntPtr)0);
            //IntPtr result3 = SendMessage(WindowToFind, WM_KEYUP, ((IntPtr)c), (IntPtr)0);
        }
    }
}

A: ohhh there seems to be three process id's that windows has on that command prompt running geth. i'm not sure why there's three. i tried all three, and one of them worked for me. so i can't call the process by name of "geth", that doesn't seem to be the correct window or process to send the keystrokes to. hopefully this helps someone else!


text:
Q: Paste Error Excel to Powerpoint VBA I am pasting some excel data into powerpoint as a picture and I am having some issues. I have 290 files which I am pasting a table into slide 4, 5 and 6 of each PP file. This worked perfectly yesterday when I was only doing 1 table into slide 6. I have replicated the process and now I keep getting random errors at random times. Sometimes its file 10, others file 50, different everytime. The errors range from the paste datatype is not available OR the clipboard is empty. I have tried every datatype, pasting as a metafile, as a shape, as a picture, just basic pasting and nothing stops the error. I have no idea! Here is my code: PLEASE HELP !
Sub Update_Site_Report()

'Initiate Variables
Dim objPPT As Object
Dim PPTPrez As Object
Dim FinSlide As Object
Dim AssumSlide As Object
Dim RiskSlide As Object
Dim FinTable As Object
Dim AssumTable As Object
Dim RiskTable As Object
Dim fileNameString As String
Dim PicCount As Long
Dim PicCount1 As Long
Dim PicCount2 As Long
Dim i As Long
Dim fileN As String
Dim Directory As String

'Create and open powerpoint application

Set objPPT = CreateObject("PowerPoint.Application")
objPPT.Visible = True

Application.ScreenUpdating = False

'Update site report table from spreadsheet

For i = 2 To 291
    Sheet20.Cells(18, 2) = Sheet20.Cells(5, i)
    Sheet20.Cells(19, 2) = Sheet20.Cells(6, i)
    Sheet20.Cells(20, 2) = Sheet20.Cells(7, i)
    Sheet20.Cells(21, 2) = Sheet20.Cells(8, i)
    Sheet20.Cells(18, 3) = Sheet20.Cells(10, i)
    Sheet20.Cells(19, 3) = Sheet20.Cells(11, i)
    Sheet20.Cells(20, 3) = Sheet20.Cells(12, i)
    Sheet20.Cells(21, 3) = Sheet20.Cells(13, i)

'Take column header from spreadsheet and set as filename

fileN = Sheet20.Cells(4, i)

' Allow directory to be set in excel tab

Directory = Sheet20.Cells(18, 5)

'Open powerpoint presentation at Directory with Filename

Set PPTPrez = objPPT.Presentations.Open(Directory & fileN & ".pptx")

'Set range for site report table

Set Financials = Sheet20.Range("A17:C21")
Set Assumptions = Sheet45.Range("A1:C7")
Set Risks = Sheet45.Range("A24:D41")

'Choose which slide to paste site report table

Set FinSlide = PPTPrez.Slides(6)
Set AssumSlide = PPTPrez.Slides(4)
Set RiskSlide = PPTPrez.Slides(5)

'If there is a table in powerpoint slide, delete the table

For PicCount1 = AssumSlide.Shapes.Count To 1 Step -1
    If AssumSlide.Shapes(PicCount1).Type = msoPicture Then
        AssumSlide.Shapes(PicCount1).Delete
    End If
Next

For PicCount = FinSlide.Shapes.Count To 1 Step -1
    If FinSlide.Shapes(PicCount).Type = msoPicture Then
        FinSlide.Shapes(PicCount).Delete
    End If
Next

For PicCount2 = RiskSlide.Shapes.Count To 1 Step -1
    If RiskSlide.Shapes(PicCount2).Type = msoPicture Then
        RiskSlide.Shapes(PicCount2).Delete
        Debug.Print
    End If
Next

'Paste the site report table into the site report

Financials.Copy
FinSlide.Shapes.PasteSpecial ppPasteShape
Set FinTable = FinSlide.Shapes(FinSlide.Shapes.Count)

Assumptions.Copy
AssumSlide.Shapes.PasteSpecial ppPasteShape
Set AssumTable = AssumSlide.Shapes(AssumSlide.Shapes.Count)

Risks.Copy
RiskSlide.Shapes.PasteSpecial ppPasteShape
Set RiskTable = RiskSlide.Shapes(RiskSlide.Shapes.Count)

'Set position of site report table in powerpoint

FinTable.Left = 36
FinTable.Top = 175
FinTable.Width = 614

AssumTable.Left = 36
AssumTable.Top = 80.8

RiskTable.Left = 36
RiskTable.Top = 80.8
RiskTable.Width = 641.5

'Set filename as string

fileNameString = Directory & fileN & ".pptx"

'Save file as filename

PPTPrez.SaveAs fileNameString

'Close powerpoint presentation

PPTPrez.Close

'Repeat for every site (column) - increment i

Next i

'quit powerpoint

objPPT.Quit

Application.ScreenUpdating = True

MsgBox ("Update complete, click ok to exit powerpoint")

End Sub

A: Disabling Windows clipboard history solves this issue.

redpajama_set_name: RedPajamaStackExchange


text:
Q: My web host is adding ?PHPSESSID=fgh2h45... to the end of the URL I'm using iPage.com host. In order to use PHP sessions in their host I need to add session_save_path('/home/users/web/.../cgi-bin/tmp'); at the start of each page (in my case only index.php because everything goes trough index.php first).
Now, they automatically add the session id to the end of every URL requested like this: website.com/movies/details/?PHPSESSID=4s54kjhdl...
I think this is causing problems and can affect google indexing and SEO..
How to prevent this?

A: Your "host" isn't causing the issue, PHP is appending this data.  Specifically, PHP is configured to append the PHPSESSID variable to the URL to allow PHP to track the session.  It's possible to change the relevant setting using ini_set prior to calling session_start, or more permanently by updating the php.ini file (though since you're hosted this last option is probably out). This is a list of the available runtime settings for sessions in PHP.
While you can control whether or not the value is appended to the end of your URLs, it's required to track the sessions. Alternatively you can configure PHP to use cookies to track sessions, but requiring cookies to track sessions may break your application for users who reject cookies.
In short, you can control the session ID to make it a little prettier (by renaming PHPSESSID to something more amenable or making the value less cryptic) but unless you want to use cookies to maintain the session, you're stuck with this "garbage" on your URL.  If you only use cookies some users may not be able to maintain the session.
To enable cookie based session handling you can execute either:
// stop PHP from automatically embedding PHPSESSID on local URLs
ini_set('session.use_trans_sid', false);

or
// only use cookies (no url based sessions)
ini_set('session.use_only_cookies', true);

A: If you can't modify php.ini yourself, you can do the following:
ini_set('session.use_trans_sid',false);

This will cause PHP to use cookie based session handling, and not append the session id to the URL (which could be a security risk anyway).

A: Either configure it to use cookie-based sessions or turn of sessions entirely.


text:
Q: How to handle soft links in Perl Hi I am writing a Perl script to search for a file inside a specified directory, I used File::Find to do the same. But what happened was the folder which I was searching was pointing to a softlink, If I give the softlink path it was able to find the file correctly. But if I give the folder path it was saying file not found. I have also mentioned the script below. How to know that the folder/directory which we are searching is pointing to softlink or not. If it is pointing then how to get that softlink path to continue the search.
#!/pkg/qct/software/perl/5.22.0/bin/perl -w
##!usr/bin/perl
use strict;
#use warnings;
use File::Find;
my $gds_file_num;
my @gds_file;
our $dir = "/<path>/";
my @files_list;
use 5.010;

open( my $fh, '<', "data.txt") or die "Can't open data.txt: $!";

   # -----------------------------------------------------------------------------
# Find the file from given directory path
# -----------------------------------------------------------------------------
sub find_file  {
  my $file_name = $_[0];
  my $dir_path = $_[1];
  my @result;

  undef @result;
  print "file=$file_name dir=$dir_path\n";
  find ( sub {
    return unless /$file_name$/;
    push @result, $File::Find::name;
  }, $dir_path );

  if(($result[0] ~~ undef)){
    print "[Warn] : File not exist : $file_name is not available under $dir_path\n";
    return 0;
  }
  else {
    return $result[0];
  }
}

while ( my $line = <$fh> ) {
  # chomp $line;
      if ( $line =~ /g0hd/ ) {
          print $line;
              }
        }
      close $fh;


text:
Q: do I put [[maybe unused]] on function declarations or definitions? C++17 introduces the attribute [[maybe_unused]].
I assume this a standardized version of GCC and Clang's:    __attribute__((unused)).
For unused functions that I don't want to see a warning from,
should I be specifying the attribute on
function declarations?
void maybe_used_function() [[maybe_unused]];

or function definitions?
void maybe_used_function() [[maybe_unused]] {
  /* impl */
}

Either one?  Both?
Will the effect be the same on both the standardized and compiler specific attributes?
I can't find any clear documentation on placement behaviour, and what the common practice is.

When I place the attribute before the function body in a definition, GCC and clang give an error:
void function();
int main(){}
void function() __attribute__((unused)) {}

warning: GCC does not allow 'unused' attribute in this position
      on a function definition [-Wgcc-compat]
void function() __attribute__((unused)) {

However, the attribute can be placed in two other places without error:
__attribute__((unused)) void __attribute__((unused)) function() {}

Maybe one of these ways is how I'm expected to use the attribute on function definitions?

A: Neither.
In
[[attr1]] void [[attr2]] f [[attr3]] () [[attr4]] {}

*

*attr1 and attr3 appertain (or apply) to f itself.

*attr2 appertains to the preceding type, void.

*attr4 appertains to f's type ("function of () returning void), not f.

You want maybe_unused to appertain to f, so you can put it in position 1 or 3, but not 2 or 4.
@ildjarn's answer covers the rest.
For GCC's __attribute__, you'll have to check its documentation.

A: From N4606, [dcl.attr.unused]¶4:

A name or entity declared without the maybe_unused attribute can later be redeclared with the attribute and vice versa. An entity is considered marked after the first declaration that marks it.

Since a function definition is a declaration ([dcl.dcl]¶1), this means you can put it in either place and it will behave the same.
(It makes sense to be allowed in both places since the attribute only actually affects the definition, but because the attribute can serve as self-documentation it is also permitted on the declaration.)


text:
Q: Namecheap\Mailgun - receiving email I am wondering how to setup namcheap and maligun to receive emails. Currently I am able to send emails with my laravel application through maligun, but I am not sure how to setup maligun to receives replies?
I have seen the options of setting up routes to receive emails to some wanted enpoint, but currently I am not receiving anything on maligun, so I have nothing to forward. I am getting the message:

This is the mail system at host eforward3e.registrar-servers.com.
I'm sorry to have to inform you that your message could not be
  delivered to one or more recipients. It's attached below.
For further assistance, please send mail to postmaster.
If you do so, please include this problem report. You can delete your
  own text from the attached returned message.
               The mail system

: unknown user:
  "support@my-domain.com"
Final-Recipient: rfc822; support@my-domain.com
  Original-Recipient: rfc822;support@my-domain.com Action: failed
  Status: 5.1.1 Diagnostic-Code: X-Postfix; unknown user:
  "support@my-domain.com"

How should I set this up?

A: Hope you register your domain at mailgun, if not then do it here. Once your domain register follow below steps:
1) Get domain and API Key from Mailgun > Doamins > Domain Information page
2) Setup config/services.php:
'mailgun' => array(
    'domain' => 'YOURDOMAINNAME',//Place your register domain name here...
    'secret' => 'API Key',//Place your API Key here...
),

3) Setup .env:
MAIL_DRIVER=mailgun
MAIL_HOST=smtp.mailgun.org
MAIL_PORT=587
MAIL_USERNAME=USERNAME
MAIL_PASSWORD=YOURPASSWORD
MAIL_ENCRYPTION=tls

4) Check with sending mail from laravel application.
That's it...


text:
Q: Prevent re-render with expensive timer I need a timer in one of my main screens, which has to run every 10ms (which is really expensive, I know. It has to play a sound for a certain cadence).
I tried to use a custom hook to extract the time from the screen like so:
import { useEffect, useState } from "react";

// constants
const PLAYER_INTERVAL = 10;

const useStepSoundInterval = (
    receivedCadence: number,
    handleSound: () => void,
) => {
    const [playerTimeCount, setPlayerTimeCount] = useState(0);
    const [playerTimerStep, setPlayerTimerStep] = useState(0);
    let timerSound: NodeJS.Timeout;

    useEffect(() => {
        timerSound = setInterval(handleStepSoundInterval, PLAYER_INTERVAL);
        return () => {
            clearInterval(timerSound);
            setPlayerTimeCount(0);
            setPlayerTimerStep(0);
        };
    }, []);

    useEffect(() => {
        if (receivedCadence) {
          setPlayerTimerStep((playerTimerStep) => playerTimerStep + 0.1);

          if (1 / receivedCadence * PLAYER_INTERVAL <= playerTimerStep) {
            setPlayerTimerStep(0);
            handleSound();
          }
        }
    }, [receivedCadence, playerTimeCount]);

    const handleStepSoundInterval = () => {
        setPlayerTimeCount((playerTimeCount) => playerTimeCount + 1);
    };

};

export default useStepSoundInterval;

Then I call it like that on my screen:
useStepSoundInterval(
    receivedCadence,
    handleSound,
);

I thought, if I extract it, as a hook, from the screen, it would prevent to re-render the JSX all the time, but it does re-render every 10ms, which is a tiny bit expensive :)
Can I somehow use React.Memo? I failed to implement it.


text:
Q: Connect from Kubernetes Pod to VM We are currently running a Kubernetes cluster on GCP. The cluster has several pods, in the default network 10.154.0.0/16. We have now created a new VM in the same network and assigned a static internal IP 10.154.0.4.
We are now trying to connect from a Pod to the freshly created VM, but we are only able to ping it. We installed a basic webserver on it that only the internal network is supposed to access, but it doesn't work.
Isn't it possible to access all ports on the internal network without creating any additional firewall rules?
Logs:
Ping VM from Pod (works)
root@censored-6d9f888f75-pncs4:/var/www# ping 10.154.0.4
PING 10.154.0.4 (10.154.0.4): 56 data bytes
64 bytes from 10.154.0.4: icmp_seq=0 ttl=63 time=1.636 ms

Accessing the webserver of the VM (not working)

root@censored-6d9f888f75-pncs4:/var/www# curl 10.154.0.4
^C

A: Not sure if this is what's happening to you, but if you ssh into a node and run sudo iptables-save, there is this interesting rule...
-A POSTROUTING ! -d 10.0.0.0/8 -m comment --comment "kubenet: SNAT for outbound traffic from cluster" -m addrtype ! --dst-type LOCAL -j MASQUERADE

...that says that for destination IP addresses within 10.0.0.0/8 range, do not masquerade. If your pods are running in 172., or 192., that's  the IP address they are making the requests with, which can be dropped, if the firewall rules and routes have not been properly configured.


text:
Q: Media source api, stream simple mp4 Can we stream simple mp4 using the media source api?
As we can stream the dash/fmp4 using the media source api but I have the simple mp4 h264 video which I want to stream using the media source api.
I know the mp4 can be directly streamed using html tag etc but I am building the adaptive bitrate streaming of simple mp4 h264 files so that is why I want to use the media source api.
Media source api requires the initial segment for dash/fmp4, if the simple mp4 is supported then which initial segment I have to provide? Means the mov atom, mdat etc
As for the next segments I have extracted the i-frame data from the mp4 file, did media source api accepts raw i-frame data without any container?


text:
Q: Merging Div-Table-Cells? I have a div-table that is working fine with about 4 columns but now I want to make the items expandable so that another div appears below the entry. The problem is that if I use another div below the table-row its width is getting stucked to the first columns-width.
What I need is a division that ignores the table-layout .. any GOOD solutions for this?

A: As far as I'm aware CSS doesn't have an option to display a div using a colspan attribute.
I'd recommend either using a real table element if it's to display acrtual tabular data or alternatively simply recreate the layout using divs with the table attributes and your own custom styles.

A: It looks like your final spanning div at the bottom is taking some strange inheritance from your divTable class. In your code, your final div is within the wrapper of divTable. I've amended your code slightly to have the div outside of the divTable div and it spans all columns.

 SiteID

 Ort

 Anfrage

 Ergebnis

 Datum

 56831-12481

 gütersloh

 332312, Bielefeld, Deutscheland, 80.32, 43.23

 Proxy

 05.09.2012 20:20:21

This div should use the whole width

Edit: While this will work, I agree with everyone else above when they say you should really just use a table for this data instead of trying to replicate table functionality with divs.


text:
Q: Rails: Dropdown with links to show pages I am trying to put a drop down in my navbar where users can click on links to the different stone show pages. With the code I have in now I am getting a NoMethodError private method `each' called for nil:NilClass.
I am pretty sure this private method error is coming up because I am putting this code in my navbar which is in my application.html.erb rather then in the stone model. Could someone point me in the right direction as to where I should define methods for the navbar? Or if there is something else I should be doing instead?
Here is what I have attempted so far:
application.html.erb

  <button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Dropdown Example
  </button>

    <% @stones.each do |stone| %>

 <%= link_to stone_url do %>
     <%= stone.name %>
    <% end %>

    <% end %>

application_controller.rb
class ApplicationController < ActionController::Base
  # Prevent CSRF attacks by raising an exception.
  # For APIs, you may want to use :null_session instead.
  protect_from_forgery with: :exception
  helper_method :current_order
  def each
    @product = Product.all
  end
  def current_order
    if !session[:order_id].nil?
      Order.find(session[:order_id])
    else
      Order.new
    end
  end
end

A: you are calling .each on the var @stones and not on your controller, views cant call methods from controllers, unless they are helper methods. try to use a before_filter in your controller that will set your @stones and remove that each method from the controller

A: Just replace @stones.each to Stone.all.each.
Because there will be somewhere using var @stones, you should not define @stones on your application_controller.rb.


text:
Q: Creating an index with a where clause - SQL SVR 2005 I have recently discovered the ability to use WHERE clauses within indexes in SQL Server 2005.  I would like to optimize some queries, and was hoping to get some feedback.
The table of interest contains 2 float columns, [long] and [short].  These columns could be 0 in 20-40% of rows.  There are several stored procs that query this table with one of the following clauses:

*

*WHERE (long <> 0 OR short <> 0)

*WHERE (long <> 0 AND short <> 0)

I am considering putting indexes on long and short (or one index on both) with the condition WHERE <> 0 in the hopes that the stored procs will be able to use an index scan rather than a table scan to grab this data.
Given the above info, how would you go about creating indexes?  Or, if an index isn't the best solution, what are reasonable alternatives?  Thanks in advance.

A: Using Where clauses in an index creation is a SQL Server 2008 feature - Filtered indexes are not within SQL Server 2005.
Filtered Indexes follow the same rules about tipping as normal NC, non-covering indexes, so with 60-80% of the rows being <> 0, the likelihood is that the index will tip to a table / clustered index scan.
The only way to avoid that tipping is to make the index covering, but we can not see the rest of the clause / selection to know whether that is a reasonable option.


text:
Q: Что означает "There is 1 zombie process" и что с ним делать? Залогинился на удаленную машину. Вижу следующую строку в приветственном сообщении.

There is 1 zombie process.

Насколько я понял, это означает, что какой-то процесс завершил работу, но не закрылся и не освободил ресурсы. Хотелось бы лучше понять проблему:

*

*Как можно его обнаружить? Сейчас я угадал, но нужен стабильный метод.

*Как можно узнать причины его появления? Есть какие-нибудь логи? Может, по имеющемуся процессу можно что-либо понять?

Если это важно, ubuntu 14.04, sudo есть.
Дополнение: меня не устраивает метод «просто подождать», т.к. есть сервис, который должен работать всегда — и подвис он или кто-то из его детей. Он подстрахован monit'ом, но тот не распознал зомбификацию и не перезагрузил.

A: Зомби в операционных системах UNIX называют завершившиеся процессы, код завершения которых не забрал родительский процесс. Зомби не потребляют никаких ресурсов, память и файловые дескрипторы таких процессов уже освобождены. Остается только запись в таблице процессов, которая занимает несколько десятков байт памяти. Так что единичный зомби процесс на систему никак не влияет. НО он явный индикатор того, что у какого то процесса в системе что то пошло не так.
Поиск зомби:
ps -axho state,pid,ppid | grep Z | sed 's/./ps/' | sh

Данная команда покажет все зомби процессы и их родителей (тестировалась под linux, под другими *nix возможны другие ключи у команды ps).
Убить зомби можно только перезапуском родительского процесса. kill -9 самого процесса-зомби и чеснок обычно не помогают. Если появление зомби разовое явление, то возможно проще на факт его появления забить.
Что бы понять почему именно появился зомби надо смотреть исходники породившего его процесса и возможно самого зомби. Часто это одна и та же программа. Любой процесс, выполняющий fork, т.е. запускающий дочерние процессы должен уметь забирать код их завершения, делается это вызовом wait и/или waitpid. Для начала надо просмотреть исходники на наличие функций группы wait, а так же наличие функции-обработчика сигнала SIGCHLD (обработчик устанавливается вызовом signal и функций для работы с сигналами потоков). Если родитель не использует функции группы wait, то возможно при его нормальной работе завершение дочерних процессов разработчик вообще не ожидал. Если это так - то причина образования зомби - незапланированное завершение процесса потомка в следствие какой либо ошибки. Дать рекомендаций как это искать и лечить невозможно. Можно только посоветовать добавить в родительский поток обработку CHLD, забор кода завершения с помощью wait и логирование факта завершения потомка. И дальше запуск потомка под отладчик и т.п. ...
Вариант 2: родительский процесс использует wait, но зомби все равно появляются. Копать в сторону того, какая разновидность wait используется, если waitpid, которая проверяет завершение конкретных потомков, то смотреть откуда она берет проверяемые pid, возможно в процессе работы какие то pid потомков теряются и программа про них забывает. Может программа в какой то момент запрещает обработку сигналов и забывает восстановить обработку, после прохождения критического участка. Опять же - вариантов очень много, но сосредоточены они вокруг обработчика SIGCHLD и функций wait.
Вариант 3: родительский процесс умеет обрабатывать и готов правильно обработать завершение своих потомков. Но зацикливается в другом месте программы или засыпает на системном вызове, например чтения с сетевого диска, который стал недоступен и при этом прерывание по SIGCHLD запрещено. В этом случае надо разбираться с причинами его зависания. Кстати, отсутствие доступа к каким либо ресурсам, типа сетевых дисков (или при выходе из строя физического диска) - довольно частая причина массового появления зомби.
Каких либо специальных логов в системе, где можно было бы увидеть хоть какую то информацию по появляющимся зомби не существует. Следы можно найти только в логах той программы, которая их порождает, при их наличии.


text:
Q: Firebase Database in android I am building an app in which the user can upload photos stored as locally in device on clicking image button. I am using firebase storage to store photos in a folder. When I click on the image picker button it opens up my gallery to select photos, but when I select a photo it never gets showed in the app neither in firebase console storage. Here is my code
 protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        mUsername = ANONYMOUS;
        mFirebaseDatabase=FirebaseDatabase.getInstance();
        mFirebaseAuth=FirebaseAuth.getInstance();
        mMessagesDatabaseReference=mFirebaseDatabase.getReference().child("messages");
        mFirebaseStorage=FirebaseStorage.getInstance();
        mChatPhotoStorageReference=mFirebaseStorage.getReference().child("chat_photos");
        mFirebaseRemoteConfig=FirebaseRemoteConfig.getInstance();
        // Initialize references to views
        mProgressBar = (ProgressBar) findViewById(R.id.progressBar);
        mMessageListView = (ListView) findViewById(R.id.messageListView);
        mPhotoPickerButton = (ImageButton) findViewById(R.id.photoPickerButton);
        mMessageEditText = (EditText) findViewById(R.id.messageEditText);
        mSendButton = (Button) findViewById(R.id.sendButton);

        // Initialize message ListView and its adapter
       final  List<FriendlyMessage> friendlyMessages = new ArrayList<>();
        mMessageAdapter = new MessageAdapter(this, R.layout.item_message, friendlyMessages);
        mMessageListView.setAdapter(mMessageAdapter);

        // Initialize progress bar
        mProgressBar.setVisibility(ProgressBar.INVISIBLE);

        // ImagePickerButton shows an image picker to upload a image for a message
        mPhotoPickerButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                // TODO: Fire an intent to show an image picker
                Intent intent=new Intent(Intent.ACTION_GET_CONTENT);
                intent.setType("image/jpeg");
                intent.putExtra(Intent.EXTRA_LOCAL_ONLY, true);
                startActivityForResult(Intent.createChooser(intent,"complete action using"),RC_PHOTO_PICKER);

            }
        });

        // Enable Send button when there's text to send
        mMessageEditText.addTextChangedListener(new TextWatcher() {
            @Override
            public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
            }

            @Override
            public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
                if (charSequence.toString().trim().length() > 0) {
                    mSendButton.setEnabled(true);
                } else {
                    mSendButton.setEnabled(false);
                }
            }

            @Override
            public void afterTextChanged(Editable editable) {
            }
        });
        mMessageEditText.setFilters(new InputFilter[]{new InputFilter.LengthFilter(DEFAULT_MSG_LENGTH_LIMIT)});

        // Send button sends a message and clears the EditText
        mSendButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                // TODO: Send messages on click

                // Clear input box

                FriendlyMessage friendlyMessage=new FriendlyMessage(mMessageEditText.getText().toString(),mUsername,null);
                mMessagesDatabaseReference.push().setValue(friendlyMessage);
                mMessageEditText.setText("");
            }
        });

        mAuthStateListener=new FirebaseAuth.AuthStateListener() {
            @Override
            public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
                FirebaseUser user=firebaseAuth.getCurrentUser();
                if(user!=null)
                {
                   onSignedInInitialize(user.getDisplayName());

                   Toast.makeText(MainActivity.this,"You are signed in to friendly chat app",Toast.LENGTH_SHORT).show();
                }
               else
                {onSignedOutCleanup();
                    startActivityForResult(
                            AuthUI.getInstance()
                                    .createSignInIntentBuilder()
                                    .setAvailableProviders(
                                            Arrays.asList(new AuthUI.IdpConfig.Builder(AuthUI.EMAIL_PROVIDER).build(),
                                                    new AuthUI.IdpConfig.Builder(AuthUI.GOOGLE_PROVIDER).build()
                                                    ))
                                    .build(),
                            RC_SIGN_IN);
                }
            }
        };
        FirebaseRemoteConfigSettings configSettings=new FirebaseRemoteConfigSettings.Builder()
                .setDeveloperModeEnabled(BuildConfig.DEBUG)
                .build();
        mFirebaseRemoteConfig.setConfigSettings(configSettings);
        Map<String,Object> defaultConfigMap=new HashMap<>();
        defaultConfigMap.put(FRIENDLY_MSG_LENGTH_kEY,DEFAULT_MSG_LENGTH_LIMIT);
        mFirebaseRemoteConfig.setDefaults(defaultConfigMap);
        fetchConfig();
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if(resultCode==RC_SIGN_IN)
        {
         if(resultCode==RESULT_OK)
         {
          Toast.makeText(MainActivity.this,"Signed In",Toast.LENGTH_SHORT).show();
         }
         else if(resultCode==RESULT_CANCELED)
         {
         Toast.makeText(MainActivity.this,"Sign IN Cancelled",Toast.LENGTH_SHORT).show();
          finish();
         }
        }
        else if(resultCode==RC_PHOTO_PICKER&&resultCode==RESULT_OK)
        {
            Uri selectedImageUri=data.getData();
            StorageReference photoRef=mChatPhotoStorageReference.child(selectedImageUri.getLastPathSegment());
            photoRef.putFile(selectedImageUri).addOnSuccessListener(this, new OnSuccessListener<UploadTask.TaskSnapshot>() {
                @Override
                public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
                    Uri downloadUrl=taskSnapshot.getDownloadUrl();
                    FriendlyMessage friendlyMessage=new FriendlyMessage(null,mUsername,downloadUrl.toString());
                    mMessagesDatabaseReference.push().setValue(friendlyMessage);
                }
            });
        }
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.main_menu, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId())
        {
            case R.id.sign_out_menu:
                AuthUI.getInstance().signOut(this);
            return true;
            default:
        return super.onOptionsItemSelected(item);}
    }
    public void onPause() {
        super.onPause();
        if (mAuthStateListener != null) {
            mFirebaseAuth.removeAuthStateListener(mAuthStateListener);
        }
      detachDatabaseReadListener();
      mMessageAdapter.clear();
    }
    public void onResume()
    {
    super.onResume();
    mFirebaseAuth.addAuthStateListener(mAuthStateListener);
    }
    private void onSignedInInitialize(String username)
    {
      mUsername=username;
       attachDatabaseReadListener();

    }
    private void onSignedOutCleanup()
    {
      mUsername=ANONYMOUS;
      mMessageAdapter.clear();
      detachDatabaseReadListener();
    }
    private void attachDatabaseReadListener() {
        if (mChildEventListener == null) {
            mChildEventListener = new ChildEventListener() {
                @Override
                public void onChildAdded(DataSnapshot dataSnapshot, String s) {
                    FriendlyMessage friendlyMessage = dataSnapshot.getValue(FriendlyMessage.class);
                    mMessageAdapter.add(friendlyMessage);
                }

                @Override
                public void onChildChanged(DataSnapshot dataSnapshot, String s) {

                }

                @Override
                public void onChildRemoved(DataSnapshot dataSnapshot) {

                }

                @Override
                public void onChildMoved(DataSnapshot dataSnapshot, String s) {

                }

                @Override
                public void onCancelled(DatabaseError databaseError) {

                }
            };
            mMessagesDatabaseReference.addChildEventListener(mChildEventListener);
        }
    }
         private void detachDatabaseReadListener()
         {
             if(mChildEventListener!=null)
             {
         mMessagesDatabaseReference.removeEventListener(mChildEventListener);
             mChildEventListener=null;
         }}
    private void fetchConfig()
    {
        long cacheExpiration=3600;
        if(mFirebaseRemoteConfig.getInfo().getConfigSettings().isDeveloperModeEnabled())
        {
        cacheExpiration=0;
        }
        mFirebaseRemoteConfig.fetch(cacheExpiration)
          .addOnSuccessListener(new OnSuccessListener<Void>() {
              @Override
              public void onSuccess(Void aVoid) {
              mFirebaseRemoteConfig.activateFetched();
              applyRetrievedLengthLimit();
              }
          })
          .addOnFailureListener(new OnFailureListener() {
              @Override
              public void onFailure(@NonNull Exception e) {
              Log.w(TAG,"Error fetching code",e);
              applyRetrievedLengthLimit();
              }
          });
    }
    private void applyRetrievedLengthLimit() {
        Long friendly_msg_length = mFirebaseRemoteConfig.getLong(FRIENDLY_MSG_LENGTH_kEY);
        mMessageEditText.setFilters(new InputFilter[]{
                new InputFilter.LengthFilter(friendly_msg_length.intValue())
        });
        Log.d(TAG,FRIENDLY_MSG_LENGTH_kEY + "=" +friendly_msg_length);
    }
}


text:
Q: Control Finish Location for a Flow My organization has a custom button on the Opportunity which calls a Flow to create the Opportunity.  The code for the button is as follows:
/flow/Close_Opportunity_w_Handoff?OpportunityID={!Opportunity.Id}&UserTitle={!$User.Title}

We are now getting ready to implement Opportunity Products and we would like to have the end point for the flow above to be the add products page from the newly created Opportunity.  Can anyone tell me how to accomplish this?  I am very new to flows and this is one that was created by someone before me.  Thanks for any help!
VF Page:
<apex:page standardController="Opportunity" tabStyle="Opportunity">
    <flow:interview name="Create_Opportunity_w_Parent_Fixed" finishLocation="/p/opp/SelectSearch?addTo={!opportunity.Id}&retURL=%2F{!opportunity.Id}"/>
</apex:page>

Controller:
public class OpptyFlowController {

  public Flow.Interview.Create_Opportunity_w_Parent_Fixed OppFlow { get; set; }

    public String getOppID() {
      if (OppFlow==null) return '';
      else return OppFlow.OpptyID;
    }

  public PageReference getOID(){
    PageReference p = new PageReference('/p/opp/SelectSearch?addTo=' + getOppID() + '&retURL=%2F' + getOppID();
    p.setRedirect(true);
  return p;
  }

}

A: In this situation I normally have the flow embedded in a VisualForce page, which may sound a bit intimidating if you haven't used one before but it's literally just a few lines.
Basically you create a very simple page like the below.
This would send the user to another VF page:
<apex:page>
    <flow:interview name="MyUniqueFlow" finishLocation="{!$Page.MyUniquePage}"/>
</apex:page>

This to a particular non VF page:
<apex:page>
    <flow:interview name="MyUniqueFlow" finishLocation="{!URLFOR('/home/home.jsp')}"/>
</apex:page>

You will need to set the standard controller of the VF page available so that the button is available.
Some helpful links:
https://help.salesforce.com/HTViewHelpDoc?id=vpm_admin_onfinish.htm&language=en_US
http://www.salesforce.com/docs/developer/pages/Content/pages_flows_finishlocation.htm

A: See the following post: Help with finishLocation on flow which details how to set the ending location for the flow controller. All you'd need to do is pass that URL to your controller.


text:
Q: How to escape # in docker file? I have a docker compose file as follows:
    version: '3'
    services:
    prisma:
        image: prismagraphql/prisma:1.34.10
        restart: always
        ports:
        - '4466:4466'
        environment:
        PRISMA_CONFIG: |
            port: 4466
            databases:
            default:
                connector: mysql
                host: test.mysql.database.azure.com
                database: default@default
                user: rie@dak-prod
                password: ak123#$
                ssl: false
                rawAccess: true
                port: '3306'
                migrations: true

When I try the command docker-compose up -d the command fails with an error :
ERROR: Invalid interpolation format for "environment" option in service "prisma": "port: 4466
databases:
default:
    connector: mysql
    host: est.mysql.database.azure.com
    database: default@default
    user: rie@dak-prod
    password: ak123#$
    ssl: false
    rawAccess: true
    port: '3306'
    migrations: true
"

The reason that I have identified is the # in the password. If # is not there, it does not throw up this error. How can I escape (use) hash the the docker compose file?

A: I think the problem is not with a # but with a $ symbol.
You can use a $$ (double-dollar sign) when your configuration needs a literal dollar sign. This also prevents Compose from interpolating a value, so a $$ allows you to refer to environment variables that you don't want processed by Compose.
So in your case ak123#$ must be written as ak123#$$
Reference documentation

A: Quote your string to include special characters in yaml like the #, and escape the dollar sign using a second dollar sign to prevent docker-compose from expanding it:
password: "ak123#$$"

A: Best way to use is base64 encode function. convert your password into base64 and try. should work.
Like this
echo "ak123#$" | base64

and whatever the output use as your password and more secure way

A: Your docker-compose.yml have two issues:

*

*$ should be escaped with $$ as pointed by @Suhail Gupta's answer and docs:

You can use a $$ (double-dollar sign) when your configuration needs a literal dollar sign

*

*PRISMA_CONFIG indentation under environment: is invalid, as PRISMA_CONFIG should be a subelement of environment
You should use something like:
    environment:
      # proper indentation to have PRISMA_CONFIG part of environment
      PRISMA_CONFIG: |
          port: 4466
          databases:
          default:
              connector: mysql
              host: test.mysql.database.azure.com
              database: default@default
              user: rie@dak-prod
              # double $ to have a literal '$'
              password: ak123#$$
              ssl: false
              rawAccess: true
              port: '3306'
              migrations: true


text:
Q: android google maps on a webview I have a jqueryMobile app that uses google maps api and is working properly on iOS. However, I am not able to get it running on android. I set following permissions on my manifest file. File is loaded properly but I am not able to view the map! Assuming that jqmobile code is working because works on iOS, how to enable it or which steps are required? Thank you.
<uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
    <uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
    <uses-permission android:name="android.permission.CONTROL_LOCATION_UPDATES" />

my webview class looks like,
 protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.webview);

        browse4 = (WebView) findViewById(R.id.webview1);
        browse4.getSettings().setJavaScriptEnabled(true);
        browse4.getSettings().setUseWideViewPort(true);
        browse4.getSettings().setLoadWithOverviewMode(true);
        browse4.getSettings().setBuiltInZoomControls(true);
        browse4.getSettings().setSupportZoom(true);

        browse4.loadUrl("file:///data/data/" + PACKAGE_NAME + "/files/" + "myMap.html");

    }

A: Might be a dumb answer but do you have this in your manifest?
<uses-library android:name="com.google.android.maps" />

A: is there any particular reason why you're not using the Google MapView?
I understand it's using jQuery but this might be easier.

A: Ok try this
Create a new project using Google API and try this.
package com.ab1209.webview;

import android.app.Activity;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.location.Criteria;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class WebMapActivity extends Activity implements LocationListener
{
    private static final String MAP_URL = "http://gmaps-samples.googlecode.com/svn/trunk/articles-android-webmap/simple-android-map.html";
    private WebView webView;

    Location mostRecentLocation;

    @Override
    /** Called when the activity is first created. */
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        getLocation();
        setupWebView();
        this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
    }

    private void getLocation()
    {
        LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
        Criteria criteria = new Criteria();
        criteria.setAccuracy(Criteria.ACCURACY_FINE);
        String provider = locationManager.getBestProvider(criteria, true);
        // In order to make sure the device is getting the location, request
        // updates.
        locationManager.requestLocationUpdates(provider, 1, 0, this);
        mostRecentLocation = locationManager.getLastKnownLocation(provider);
    }

    @Override
    public void onLocationChanged(Location arg0)
    {
        // TODO Auto-generated method stub

    }

    @Override
    public void onProviderDisabled(String provider)
    {
        // TODO Auto-generated method stub

    }

    @Override
    public void onProviderEnabled(String provider)
    {
        // TODO Auto-generated method stub

    }

    @Override
    public void onStatusChanged(String provider, int status, Bundle extras)
    {
        // TODO Auto-generated method stub

    }

    /** Sets up the WebView object and loads the URL of the page **/
    private void setupWebView()
    {
        final String centerURL = "javascript:centerAt(" + mostRecentLocation.getLatitude() + "," + mostRecentLocation.getLongitude() + ")";
        webView = (WebView) findViewById(R.id.webview);
        webView.getSettings().setJavaScriptEnabled(true);
        // Wait for the page to load then send the location information
        webView.setWebViewClient(new WebViewClient());
        webView.loadUrl(MAP_URL);
        /** Allows JavaScript calls to access application resources **/
        webView.addJavascriptInterface(new JavaScriptInterface(), "android");
    }

    /**
     * Sets up the interface for getting access to Latitude and Longitude data
     * from device
     **/
    private class JavaScriptInterface
    {
        public double getLatitude()
        {
            return mostRecentLocation.getLatitude();
        }

        public double getLongitude()
        {
            return mostRecentLocation.getLongitude();
        }
    }
}

Please also check this.I had the same problem now it is solved.

A: You cannot access the file like that.  You need to put it in your assets folder and then access it with file:///android_asset/file_name.html.  You can only access the /data/data folder directly if you have root access.


text:
Q: windows phone 10 UWP server client application i am creating a chat application between windows 10 mobile and an android device.
i am planning to use server client tcp protocol. is it possible?
can anyone share the samples for UWP server client application?


text:
Q: What are .dat.nosyncb77b.* files and how to remove them? I am trying to remove the project directory but receive a Permission denied for .dat.nosyncb77b.* files. What are these files and how can I remove them?
After trying a number of different approaches to solve an Xcode issue with Could not load authors for file 'Pods/Pods.xcodeproj/project.pbxproj' I have tried removing the whole project directory in an attempt to clone the project fresh from git.
However, when running rm -rf project-dir I got Permission denied for .dat.nosyncb77b. files. What is strange is that I am the owner of the files. I have tried changing the permissions to 755 and 775 but no luck. All the other directories and files were successfully removed apart from these .dat.nosyncb77b. files.
None of my other projects have those files. I have cloned the repo again under a different directory and could see that those files do not exist in the same project.xcworkspace/xcuserdata/username.xcuserdatad/ where those files are for that project.

A: It could be ACLs preventing deletion, these are shown with the e option to ls eg ls -le   However I'd put money on the Locked flag being set, as I've encountered the occasional file with the Locked flag.
The easiest way to see this is to perform a Get Info (from Finder) on the files.

In the General Panel and uncheck the Locked checkbox.
It can also be changed on the command line with the command GetFileInfo look at the attributes: line and look for the uppercase L, this means the locked flag is set. It shows as lowercase if unset.
file: "/Users/mark/Documents/20200605-pdftext/test"
type: "\0\0\0\0"
creator: "\0\0\0\0"
attributes: avbstcLinmedz
created: 01/30/2021 14:43:54
modified: 01/30/2021 14:43:54

To change the locked status use SetFile -a l filename


text:
Q: Efficient way to find number of files in directory I am in a situation where I repeatedly need to know how many files are in any given directory with-in my directory structure. However, due to memory constraints on devices, I cannot keep an in-memory index of the number of files in all directories.
From what I can tell based on the STL documentation, my option something along these lines:
#include <filesystem>
#include <iostream>

int main(void)
{
    std::string path = ".";

    size_t count = 0;
    for (const auto& entry : std::filesystem::directory_iterator(path))
    {
        ++count;
    }
    std::cout << "Number of files in dir \".\" is: " << count << std::endl;
    return 0;
}

Though it is fairly efficient code, I was wondering if there is not a faster way, that maybe even eliminates the usage of the foreach?
I am using C++17 if that helps and the code will run on macOS, FreeBSD, OpenBSD, Linux, NetBSD. Where the memory constraint is for devices running Linux and NetBSD. I have rougly 16kB of memory total on some of these devices.

A: It appears there is no easy way.. while documentation says that there are begin and end defined for directory_iterator, it doesn't behave like a range-based one.

directory_iterator begin( directory_iterator iter ) noexcept;
(1)   (since C++17)

directory_iterator end( const directory_iterator& ) noexcept;
(2)   (since C++17)

1) Returns iter unchanged
2) Returns a default-constructed
  directory_iterator, which serves as the end iterator. The argument is
  ignored. These non-member functions enable the use of
  directory_iterators with range-based for loops.

#include <fstream>
#include <iostream>
#include <filesystem>
namespace fs = std::filesystem;

int main()
{
    fs::directory_iterator a(".");

    for(auto& p: a)
        std::cout << p.path() << '\n';

    //std::cout << (std::end(a) - std::begin(a)) << '\n'; // apparently impossible,
    std::cout <<
              std::distance(a,
                            fs::directory_iterator()) << '\n'; // always returns 1
    std::cout <<
              std::distance(fs::directory_iterator("."),
                          fs::directory_iterator{}) << '\n'; // need a new iterator
}

Whenever you increment directory_iterator, it WILL NOT be equal to default constructed unless you reach the end of list. Increment operator is the "magic" which scans file system for next entry. The way to do this using standard library is:
fs::directory_iterator a(".");
int count = 0;
for(auto p: a) {
    ++count;
}
std::cout << count << '\n';

This is exactly what std::distance does. The state of iterator changes during increment, which must be taken in account.
Obviously there is problem that content of directory can change during the loop execution, so actual loop might look much more complex.

A: The following uses the POSIX API directly, which will about as fast and memory efficient you can get for a filesystem unaware approach (C++17). It counts '.' and '..' as well, you probably want to compensate for that.
#include <dirent.h>
#include <optional>

std::optional<int> dir_entries(const char* path)
{
  DIR* dp{::opendir(path)};
  if (!dp)
  {
    // Alternatively, return -1 instead of an optional, throw an exception, etc.
    // Jury it still out on this one :)
    return std::nullopt;
  }

  int entries{0};
  while (::readdir(dp))
    ++entries;

  ::closedir(dp);
  return entries;
}


text:
Q: sum of variables in SPSS-statistics25 for multiple external files I have 50 external EXCEL files. For each of these files, let's say #I,  I import data as it follows in the SYNTAX of SPSS-statistics25:
GET DATA /TYPE=XLSX
 /FILE='file#I.xlsx'
 /SHEET=name 'Sheet2'
 /CELLRANGE=full
 /READNAMES=on
 /ASSUMEDSTRWIDTH=32767.
EXECUTE.
DATASET NAME DataSet1 WINDOW=FRONT.

Then, I rank the variables included in #I file (WA CI) and I select  one single case, at most, as it follows:
RANK VARIABLES= WA CI (D)
  /RANK
  /PRINT=YES
  /TIES=LOW.
COUNT SVAR= RWA RCI (1).
SELECT IF( SVAR=2).
EXECUTE.

The task is the following:
I should print the sum of values of RWA looping on each EXCEL file #I. RWA can have value 1 or can be empty. If there are not selected cases (RWA is empty), the contribution to the sum of values should be 0. The final outcome should be the number of times RWA and RCI have the same TOP rank out of 50 Excel files.
How can I do this in a smart way?

A: Since I can't see the real data files, the following is a little in the dark, but I think it should be a viable strategy (you might as well try :)):
* first defining a macro to stack all the files together.
define stackFiles ()
GET DATA /TYPE=XLSX /FILE='file1.xlsx'
    /SHEET=name 'Sheet2' /CELLRANGE=full /READNAMES=on /ASSUMEDSTRWIDTH=32767 /keep WA CI.
compute source=1.
exe.
dataset name gen.
!do !i=2 !to 40
    GET DATA /TYPE=XLSX /FILE=!concat("'file", !i, ".xlsx'")
        /SHEET=name 'Sheet2' /CELLRANGE=full /READNAMES=on /ASSUMEDSTRWIDTH=32767/keep WA CI.
    compute source=!i.
    exe.
    add files /file=gen /file=*.
    exe.
!doend.
!enddefine.
* now run the macro.
stackFiles .

* now for the rest of the analysis.
* first split the data by source file, then rank and select.
sort cases by source.
split file by source.
RANK VARIABLES= WA CI (D) /RANK /PRINT=YES /TIES=LOW.
COUNT SVAR= RWA RCI (1).
SELECT IF SVAR=2.
EXECUTE.

At this point you have up to 40 rows remaining - 0 or 1 from each original file. You can count or sum using descriptives RWA.


text:
Q: SetCompatibleTextRenderingDefault(true) and Graphics.DrawString() text rendering I'm writing a C# (ActiveX) plugin for an application that uses SetCompatibleTextRenderingDefault(true) (forces .net 1.1 text rendering style) This setting mangles some of the text I output with Graphics.DrawString() causing it to look slightly smudged and bolded.  Unlike individual controls neither the Graphics class nor the BitMap  have UseCompatibleTextRendering properties that can be used to override the individual behavior.  Short of fiddling around to try and figure out what's special about the places where I'm drawing text that doesn't get mangled is there anything I can do about this?
The app my plugin is for belongs to a third party so simply changing the SetCompatibleTextRenderingDefault call it inflicts on me is not an option.
Edit:  The 'special' thing appears to be the color of the background and how it's affecting the anti-aliasing used; so fiddling to fix it by how I setup the rectangles doesn't seem to be an option.

A: I'd advise using TextRenderer.DrawText instead of Graphics.DrawString - even with compatible text rendering disabled, it seems to produce crisper, more consistent results.

A: I found a fix for my problem by changing the TextRenderingHint to SingleBitPerPixelGridFit which is the default when not using compatible text rendering.  When it's instead set to true it uses a the ClearType enumeration except that for whatever reason unlike normal cleartype text the results are ugly and extremely hard to read.
textGraphics.TextRenderingHint =
             System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit;


text:
Q: how to reference a folder relatively in WPF I need to reference a few .exe files in my WPF application, which are stored in a folder (call it appFolder) shown in the Solution Explore in Visual Studio. How can i refer to this folder relatively (like Server.MapPath(virtualPath); in MVC)?
After reading this post, i tried Path.GetFullPath("appFolder"), but this maps to something like
C:\Users\....\MyProject\bin\Debug\appFolder

while the folder resides at
C:\Users\....\MyProject\appFolder

without the \bin\Debug.
If something like this is my only option, is it safe to manually construct the real path by ripping off \bin\Debug? Thanks!
CLARIFICATION I was not asking how to "rip off" \bin\Debug; rather, I asked if it's safe to do so, which was answered in svinja's comments.

A: How about using String.replace to replace "\bin\Debug" with String.Empty ?
However I don't deny what @svinja has suggested.


text:
Q: ::before icons on mobile devices don't display i've found this bug. I'm using Font Awesome 5 Free SVG with JS version 5.11.2, included in my web server. I've an ul with the marker that are font-awesome included in a background image. On desktop works well, but on mobile devices (testing on Android) the font awesome icons don't display. Here the code and the CSS:

xxxxxx

xxxxx

.footer-info-contact {
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-info-contact li {
    margin: 10px 0px;
    padding: 0;
    list-style: none;
    padding-left: 32px;
}

.footer-info-contact li::before {
    content: "";
    font-size: 13px;
    height: 45px;
    margin-left: -32px;
    width: 31px;
    vertical-align: middle;
    font-family: "Font Awesome 5 Free";
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 45px;
    font-weight: 900;
    color:  #FFF;
    background-image: url('/img/chicco-bianco.png');
    background-repeat: no-repeat;
    background-size: contain;
    text-align: center;
    margin-right: 10px;
}

#telefonox::before {
    content: "\f095";
}

#mailx::before {
    content: "\f0e0";
}

The first screenshot is the desktop version of the website and the icons display well:
desktop
On mobile devices, the icons dont't display:
mobile
How can i resolve this bug?
Version and implementation
Version: Font Awesome Free 5.11.2 SVG with JS

Browser and version
Firefox 70.0.1 (64 bit) on Windows 10 Pro 10.0.18362 build 18362 x64
Firefox 68.2.0 on Android 7.0 on Samsung Galaxy S6 Edge.

PS: sorry for bad english, i'm not good to write and speak.

A: Try using all.css or use link https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.1.1/css/all.css it should fix your icon loading issue.
for mobile view image is attached below

.footer-info-contact {
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-info-contact li {
    margin: 10px 0px;
    padding: 0;
    list-style: none;
    padding-left: 32px;
}

.footer-info-contact li::before {
    content: "";
    font-size: 13px;
    height: 45px;
    margin-left: -32px;
    width: 31px;
    vertical-align: middle;
    font-family: "Font Awesome 5 Free";
    display: inline-block;
    font-style: solid;
    font-variant: normal;
    text-rendering: auto;
    line-height: 45px;
    font-weight: 900;
    color:  #FFF;
    /* background-image: url('img/bg.png'); */
    background-repeat: no-repeat;
    background-size: contain;
    text-align: center;
    margin-right: 10px;
    background-color:#ddd;
}

li#telefonox::before {
   content: "\f095";
}

li#mailx::before {
    content: "\f0e0";
}
<!DOCTYPE html>

<meta charset="utf-8">
<title>Page Title</title>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.1.1/css/all.css">

xxxxxx

xxxxx

A: I don't see a reference to the actual font in your CSS. if you are referencing the font in your own CSS then you should have a reference like this:
@font-face {
    font-family: 'font-name';
    font-display: swap;
    src: url('../font/font-name.eot?4247060');
    src: url('../font/font-name.eot?4247060#iefix') format('embedded-opentype'),
        url('../font/font-name.woff2?4247060') format('woff2'),
        url('../font/font-name.woff?4247060') format('woff'),
        url('../font/font-name.ttf?4247060') format('truetype'),
        url('../font/font-name.svg?4247060#font-name') format('svg');
    font-weight: normal;
    font-style: normal;
}

you will also need to make sure you have the actual font files in the reference folder, in my case it is /font. Font Awesome uses /webfonts.

A: Solved. This is the solution.

xxxxxx

xxxxx

.footer-info-contact {
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-info-contact li {
    margin: 10px 0px;
    padding: 0;
    list-style: none;
    padding-left: 32px;
}

.footer-info-contact li::before {
    content: "";
    font-size: 13px;
    height: 45px;
    margin-left: -32px;
    width: 31px;
    vertical-align: middle;
    display: inline-block;
    line-height: 45px;
    color:  #FFF;
    background-image: url('/img/chicco-bianco.png');
    background-repeat: no-repeat;
    background-size: contain;
    text-align: center;
    margin-right: 10px;
}

.footer-info-contact li svg {
    color: #FFF;
    position: absolute;
    left: 9px;
    top: 16px;
}


text:
Q: How do I get the output of the function in Groovy   static def StartMonth() {
     def date = new Date().format('MM')
     def month = date.toInteger()

     if (month > 6) {
        month = month - 6
     } else if (month <= 6) {
        month = (month + 12) - 6
     }

  }

  static void main(String[] args) {
      StartMonth();
  }
}

I have this and the output will be 4 (right now in October) and I want to retrieve that value so that I can have a new variable newDate = *startDate output* + '25/2019' but I do not know how to get the value back. (I am very new to this, I usually program in Javascript and even then I am still a beginner)
Thank you

A: In groovy you can return a value using the return value (as you can do in javascript). If there is no return a method returns the last value assigned (month in your case).
So you can either add return month in your StartMonth method. Or you can keep it as it is and just print it:
  static void main(String[] args) {
      println StartMonth()
  }


text:
Q: Why my layout look like this ? Here is my XML file Here Is my

and XML code first i use a Linear Layout then card View and other views so why my view overwrite where is the problem please watch the AVD picture and tell me where is the error.Sorry for bad english.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/item_linerLayout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:padding="5dp">

    <androidx.cardview.widget.CardView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:cardElevation="10dp">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:padding="10dp">

            <TextView
                android:id="@+id/item_id"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="1"
                android:textSize="36sp"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

            <TextView
                android:id="@+id/item_title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Title"
                app:layout_constraintStart_toEndOf="@+id/item_id"
                app:layout_constraintTop_toTopOf="@+id/item_id" />

            <TextView
                android:id="@+id/item_AuthorName"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Author"
                app:layout_constraintStart_toStartOf="@+id/item_title"
                app:layout_constraintTop_toBottomOf="@+id/item_title" />

            <TextView
                android:id="@+id/item_pages"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginEnd="3dp"
                android:text="100"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

        </androidx.constraintlayout.widget.ConstraintLayout>
    </androidx.cardview.widget.CardView>

</LinearLayout>

A: Try to use android:fitsSystemWindows="true" in your root layout(In your case LinearLayout). I recommend you to read this article to understand system overlapping. I hope it helps)

A: I have removed redundant LinearLayout parent and made CardView parent. Also your TextView with id item_pages is not overlapping.
<androidx.cardview.widget.CardView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_margin="5dp"
    app:cardElevation="10dp">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="10dp">

        <TextView
            android:id="@+id/item_id"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="1"
            android:textSize="36sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <TextView
            android:id="@+id/item_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="8dp"
            android:text="Title"
            app:layout_constraintBottom_toTopOf="@id/item_AuthorName"
            app:layout_constraintStart_toEndOf="@+id/item_id" />

        <TextView
            android:id="@+id/item_AuthorName"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginBottom="4dp"
            android:text="Author"
            app:layout_constraintBottom_toBottomOf="@id/item_id"
            app:layout_constraintStart_toStartOf="@+id/item_title" />

        <TextView
            android:id="@+id/item_pages"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginEnd="3dp"
            android:text="100"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

    </androidx.constraintlayout.widget.ConstraintLayout>

</androidx.cardview.widget.CardView>


text:
Q: Using anonymous and basic authentication in the same folder under IIS7 I have a have Winforms client that uses Web services on a IIS7 (W2008)
The client will first access a first.asmx page with anonymous aaccess, then access second.asmx with basic authentication (over SSL). This works fine in IIS6 where I can set first file to have anonymous authentication and the second file to have basic authentication.
When I move to IIS7 there seems to be a problem having two different authentication modes in the same virtual folder. Does anyone know how this is intended to work?
I have thought about fixing this with ACLs but it seems tricky.. or maybe move the anonymous first.asmx file to its own virtual folder. Any thoughts?
Regards
Fredrik

A: check this out
Did you know: Enable File Level Authentication in IIS 7 / 7.5
you can manually set the Authentication by go to the Content View -> right click on the file and click "Switch to Features View"
optionally, we can directly add the authentication for individual web pages in the  applicationHost.config file
<location path="Default Web Site/iisstart.htm">
    <system.webServer>
        <security>
            <authentication>
                <anonymousAuthentication enabled="true" />
                <basicAuthentication enabled="false" />
                <windowsAuthentication enabled="false" />
            </authentication>
        </security>
    </system.webServer>
</location>
<location path="Default Web Site/welcome.png">
    <system.webServer>
        <security>
            <authentication>
                <anonymousAuthentication enabled="false" />
                <basicAuthentication enabled="true" />
                <windowsAuthentication enabled="false" />
            </authentication>
        </security>
    </system.webServer>
</location>

Regards,
Vivek.


text:
Q: I have to determine whether a set of vectors is a spanning set of R^2 I'm having a bit of a struggle with this problem.
I am given these sets of vectors
\begin{array} { l } { \text { (a) } \{ u - v , v - w , 2 w - 2 u \} } \\ { \text { (b) } \{ u - v , v - w , 3 w - 3 u , u - v - w \} } \\ { \text { (c) } \{ u + v , - v - w , w + u \} } \\ { \text { (d) } \{ 2 u + 3 v + w , u - v - 2 w , 2 u + v - w \} } \\ { \text { (e) } \{ 2 u + 3 v + w , u - v + 2 w , 2 u + v - w \} } \end{array}
And I have to determine which ones are a spanning set for $\mathbb { R } ^ { 3 }$. For the first three it was simple, I put them in a column matrix and found that the third one is a combination of the first two. But I'm stuck at (d). I know the set is linearly dependent.

A: I will assume that $u,v,w$ are linearly independent vectors of $\mathbb{R}^{3}$. A set spans $\mathbb{R}^{3}$ if you can make $u,v$ and $w$ by linear combinations. For (b) note that
$$w=(u-v)-(u-v-w),\ v=(v-w)+w\text{ and }u=(u-v)+v$$
so (b) gives a spanning set.
For (c) we find
$$u=\frac{1}{2}((u+v)+(w+u)+(-v-w)),\ v=(u+v)-u\text{ and }w=(w+u)-u$$
so (c) is a spanning set.
You can do similar things for (d) and (e). Alternatively, if you have already seen this you can take the vectors as rows in a matrix and work out the row echelon form. If you have three pivots then the set is a spanning set.


text:
Q: How do I make a heat or Choropleth map that uses polygons in QGis? I've been playing around with the heatmap plugin for QGIS and I am wondering if it is possible to make heatmap with using a similar plugin/tool that uses polygons as well as points?
I would like to get a representation of the density of the data in much the same way that the heatmap plugin does with points.
The following image is a rough sketch of my desired result:

A: If I understand your question correctly I have done something similar before; just had to remember what I did.
This will work if your polys are overlapping AND not the same layer.  If they are on the same layer and it it is possible, move them to seperate layers, if you don't the target layer will just inherit one of the values.
The key process to use is the Join attributes by location under the Vector > Data Mangement menu.  Here specify your hexagonal field as the target layer and the join layer as one of your polygons.  Name your resulting layer and tick the radio button for Keep All Records.
The resulting layer should be a copy of your hexgonal layer with all the cells that intersected your polygon layer.  Now for the interation use your last resulting layer as the target layer and join the next polygon layer.  Take the resulting lasyer and join your next layer until you have join all your layers.
Your final layer should have inherited all the attribute fields of the previous layers and much of it may say NULL.
This is where we have to play in some of the guts of a shapefile, so if you havn't saved the layer as a shapefile do so now.  And remove the layer from your workspace in QGIS.
Open the shapefile's *.dbf files in OpenOffice Calc, DO NOT use Excel.  It will mangle the file and it useless, learned that the hard way.  And do not reorder the data, it is very specific on the order of rows in the file as well.  Check to make sure the NULLs now are Zeros if they are not, replace them carefully.
Now insert the shapefile into QGIS and open the Attribute Table.  It should now show zeros instead of NULL.  Use the Field Calculator and sum the fields that are realted to your work in a new column.
Now you have a summed field that should show with a degree of accuracy the values of the all the feature collections overlaping the target field.  You can use the Symbology function to color your polygons based upon the value of your summed field for a nice choropleth map.
If you want to rid of all the unused field in the file.  Just open the dbf file again in Calc and delete the unwanted columns at will.  Personally, I'd advise learning to get comfortable going into a shapefile this way as I do it often.

A: Maybe you can generate a set of random points into your polygons, there is a QGIS tool for that ? If you have overlapping polygons, then you have higher density of them in this area. Then use heatmap for the points. You would need to run several rounds to find optimal number of points, as result depends on that.
If your data shows distribution of some habitats, which is fuzzy anyway, then this could be closest to the real world situation where one point reflects approximately one specimen.

A: This is a general workflow using rasters. I don't know the specifics to accomplish it in QGIS.

*

*Use intersection tool to create a new vector layer of the areas of polygon overlap

*Convert your vector layers, including the overlap layer, to rasters

*Use raster arithmetic (probably addition) to combine the rasters

*Result should be a raster that looks like a heatmap

Alpha/null values and/or layer transparency would allow you to overlay the raster on any basemap.

A: Try this instead, if it fits your requirements, it isn't a computational solution to the dataset but if you are looking for simply an infographic solution you could try this instead.
Join attributes by location, with your heaxgonal cells as as the target and your point data as the join.  Choose to keep all features.  Set the symbology to the cells with the inherited value to desired color and set transparency to the something like 50%.
Then on your layer with the circle polys set their symbology to the same color and transparency.  Place the circle poly in front of the cell poly.  This will give the illusion of increased saturation as the value increases.
If you wish you could also extract the lines of the all the polys and overlay on top so sublayer outlines don't appear to be coloured over by the other layers.
You will have to play with the colours and transparency to find the best solution.  I find the same colours looks best but experiement.

A: I suggest you use the GRASS plugin -- QGIS has pretty limited functionality (and why reinvent the wheel in python when software like GRASS already exists?):
v.in.ogr.qgis

[next two lines might be necessary, depending on whether your polygons already have a value]
v.db.addcol
v.db.update_const

this is where we add up the overlap in the polygons then make the raster based on those columns
v.to.db ... qcolumns=sum(col_with_polygon_value)
v.to.rast.attr

v.out.ogr [r.out.ogr]

A: With plain QGIS it could be tricky, you may need custom scripting, or use spatial database like PostGIS or Spatialite. I would create regular grid of points with PostGIS or generate as CSV text file and import this. Then draw circle around each point with st_buffer, or rectangules with ST_MakeEnvelope, and count all overlapping areas of each buffer. Then you probably want to remove all 0 values, if it means "no data". Finally you can do heatmap for the grid, using counter as Weight field.
You need to experiment with different grid resolutions to find optimal one. In essence it is very similar to the raster approach suggested by Kevin, just staying in vector world.


text:
Q: Is it known that the ring of periods is not a field? I have just learned here that we know numbers that are not periods; is it known meanwhile that the ring of periods is not a field? I know that it is conjectured that $1/\pi$ is not a period, but the existence of a period whose inverse is not a period seems to be still open. Is this correct?
More generally: is it believed that the unit group of the ring of periods is bigger than the nonzero algebraic numbers?

A: Maybe I can sketch an argument for your first question.
Let $P$ be the ring of effective "formal" periods, generated by quadruples $[X,D,\omega,\gamma]$ consisting of a smooth projective $Q$-variety $X$, a normal crossing divisor $D$, top-form $\omega$, and singular cycle $\gamma$, as discussed in Kontsevich-Zagier.
Let $\omega: P \rightarrow C$ be the ring homomorphism obtained by integration, whose image is the ring of periods that you mention.  You ask whether the image $\omega(P)$ could be a field.
If it were, then the induced map $Spec(C) \rightarrow Spec(P)$ would be a $C$-point of the scheme $Spec(P)$, whose image is a closed point of the scheme.  As $P$ is the inductive limit of finitely-generated subrings $P_M$, we find that the induced map $Spec(C) \rightarrow Spec(P_M)$ has image a closed point of $Spec(P_M)$ for any motive $M$ which generates a sufficiently large ring of periods (or am I making a mistake about projective limits of affine varieties?).
This, incidentally, is opposite to the expectations of Grothendieck's period conjecture, which states that the image of $Spec(C) \rightarrow Spec(P_M)$ should be a generic point!
If the map $Spec(C) \rightarrow Spec(P_M)$ has image a closed point, then (since $Spec(P_M)$ is defined over $Q$), its image is a point defined over $\bar Q$.  It follows that the dimension of the $Q$-Zariski closure of this point is zero.
But this dimension (zero) is equal (as remarked by Yves Andre in his paper "Galois Theory, Motives, and Transcendental Numbers") to the transcendence degree $TrDeg_Q[Per(M)]$, where $Per(M)$ is the set of periods of the motive $M$.
So, if one chooses a motive whose periods generate a transcendental extension of $Q$ (e.g., whose periods include $2 \pi i$), one should find a contradiction.
As for the second question... I'll try to say something when I'm not about to meet with students.

A: I think the questions were about unconditional proofs or counter examples. I don't have an answer to any of those questions but I think it is still interesting to understand how the yoga of motives suggests natural answers to theses questions. Even though this may seem trivial to people familiar with the subject.
Let's work in the setting of Voevodsky's $\otimes$-triangulated categories $DM^{eff}(\mathbb{Q}):= DM_{gm}^{eff}(Spec(\mathbb{Q});\mathbb{Q}) \subset DM_{gm}(Spec(\mathbb{Q});\mathbb{Q}) =: DM(\mathbb{Q})$. Remember that the latter is obtained by formally inverting $\mathbb{Q}(1)$ and that it is a rigid $\otimes$-triangulated category.
Question 1: Is the ring of (effective) periods a field?
Following Beilinson's "Remarks on Grothendieck's standard conjecctures", let's assume
Motivic conjecture: There exists a non degenerate t-structure on Voevodsky's category $DM(\mathbb{Q}) := DM(Spec(\mathbb{Q});\mathbb{Q})$ and such that the Betti realization function $\omega_B: DM(\mathbb{Q}) \to D^bMod_f(\mathbb{Q})$ is a $t$-exact $\otimes$-functor.
This is an extremely strong conjecture as it implies the standard conjectures in characteristic 0.
Under this conjecture, the heart of the motvitic $t$-structure is a tannakian category $MM(\mathbb{Q})$. We have Betti and Rham realization functors $\omega_B,\omega_{dR}: MM(\mathbb{Q}) \rightrightarrows Mod_f(\mathbb{Q})$. And we can define
$$
  Per := Isom^\otimes(\omega_{dR},\omega_{B})
$$
This is a fpqc-torsor under the motivic Galois group $G_B := Aut^\otimes(\omega_B)$.
Define the algebra of motivic periods as the ring of regular functions on the Betti/de Rham torsor:
$$
  P_{mot} := \mathcal{O}(Per)
$$
Integration of differential forms (or more generally the Riemann-Hilbert correspondance) defines an $\mathbb{C}$-point
$$
  Spec(\mathbb{C}) \longrightarrow Per
$$
The image of the corresponding morphism $P_{mot} \to \mathbb{C}$ is the ring of periods $P$.
Note: I think this whole part is actually known unconditionnally in the setting of Nori's motives (see arXiv:1105.0865v4).
Period conjecture: The morphism $P_{mot} \to P$ is an isomorphism.
Now based on these tiny little conjectures we can say
Prop: $P_{mot}$ is not a field so $P$ isn't either.
Proof: Indeed in his comment G-torsor whose ring of regular functions is a field.   @quasi-coherent explained how faithfull flatness would imply that if $P_{mot}$ were a field then it would be algebraic over $\mathbb{Q}$ which contradicts the fact that $2\pi i$ belongs to the image of $P_{mot}\to \mathbb{C}$.
Question 2 Is it true that $(P_{mot}^{eff})^\times = \overline{\mathbb{Q}}^\times$?
This post is getting too long already so I'll try and write down the rest later but the basic idea is that invertible effective motives are Artin motives. This can be proved in terms of weights or niveau (level).


text:
Q: Word for a message that most people find plain but a smaller group see as supportive I feel like there's an idiom for this, such as if someone makes a comment that might seem innocuous at face value so you dismiss it, but another group of people who are more extreme might see as a sign that the person is on their side.
Something like "Well, some people, criminals, who are coming into this country don't belong here." Where a racist or a white nationalist might think "He supports our vision of the pure race," but the rest of us would think "Yeah, I don't want criminals coming into our country".
I feel like it's similar to "false flag" or something, but I can't remember quite the right word.
An example sentence, in response to a statement by someone else to call them out on their ____-ing:

What you're doing here is saying "This is Mexico's fault" but that's a ____ for people who don't think Mexicans belong here.

A: A shibboleth is a word or term that is only used in a certain way by a certain group of people, and it enables these people to recognise a fellow member. Outsiders may not notice anything out of the ordinary, and/or they may be unable to properly use the term.
Some general, tangentially related terms are sign, tell-tale, pejorative, dysphemism, discours.

A: I think you mean a dog whistle

dog whistle noun
(TO CALL DOG) a whistle used to train dogs, with a very high sound that humans cannot hear
(POLITICS) (disapproving): a remark, speech, advertisement, etc. by a
  politician that is intended to be understood by a particular group,
  especially one with feelings of racism or hatred, without actually
  expressing these feelings: "Attacks on "political correctness" can be a
  dog whistle to rally white voters."

A: This is sometimes referred to as coded [X] (where X is usually racism).
It's usually used by opponents of the speaker to imply the presence of the "dog whistle" ...

A: It's a logical fallacy known as conflation.

Conflation happens when the identities of two or more individuals, concepts, or places, sharing some characteristics of one another, seem to be a single identity, and the differences appear to become lost.1 In logic, it is the practice of treating two distinct concepts as if they were one, which produces errors or misunderstandings as a fusion of distinct subjects tends to obscure analysis of relationships which are emphasized by contrasts.
Conflation in logical terms is very similar to, if not identical to, equivocation.

(Source: Wikipedia.) You said:

Something like "Well, some people, criminals, who are coming into this country don't belong here.". Where a racist or a white nationalist might think "He supports our vision of the pure race" but the rest of us would think "Yeah I don't want criminals coming into our country".

In your example, the racist conflates the simple statement Well, some people, criminals, who are coming into this country don't belong here." with their own extreme beliefs; hence they incorrectly assume that the speaker is in agreement with them.
Whereas the more level-headed listener takes the statement at face value, without combining it with any extraneous, irrelevant meanings.


text:
Q: does anyone know why this keeps crashing, it started crashing when i added in the average does anyone know why this keeps crashing, it started crashing when i added in the average. if anyone know plz help im new to codeing and this is complex to me thanks
#include <iostream>
#include <vector>
using namespace std;
int main()
{
    int integers;
    int average;
    int sum = 0;
    vector<int> numbers;
    cout << "Please enter in integers and enter 0 to stop: ";
    while (cin >> integers) {
        if (integers == 0) {
            sum = sum + integers;
            break;
        }
        numbers.push_back(integers);

    }
    int y = numbers.size();
    for (int i = 0; i < y; i++) {
        cout << numbers[i] << " ";
        average = (sum / integers);
        cout << "The average is: " << average << endl;
        return 0;
    }
}

A: By the time you reach your for loop the integers variable has a value of 0. In this statement:
average = (sum / integers);

you are dividing by 0 thus causing undefined behavior and/or exception depending on the implementation. That being said you are not calculating the sum nor the average correctly.


text:
Q: AsyncTask OnPostExecute interface listener java.lang.NullPointerException error First of all, my AsyncTask works perfect while fetching data to show on my activity. But when i click to start another activity, i get java.lang.NullPointerException error right here:
protected void onPostExecute(JSONObject jsonArray) {
        //super.onPostExecute(jsonArray);
        Error Here -> onTaskComplete.setMyTaskComplete(jsonArray);
        if(pDialog != null)
            pDialog.dismiss();
        /*if(jsonArray != null){
            arrVer(jsonArray);
        }*/
    }

Anybody has any idea what may cause the problem?

A: Try this...
protected void onPostExecute(JSONObject jsonArray) {
        //super.onPostExecute(jsonArray);

    if(jsonArray!=null){
        onTaskComplete.setMyTaskComplete(jsonArray);
        if(pDialog != null)
            pDialog.dismiss();
        //rest of your code
    }
}

PS:
Make sure that you are recieving JSONObject or JSONArray or String as paramter of this function. That could be reason for Exceptions.


text:
Q: Data structure to find integers within a query range efficiently There is an arbitrary amount of distinct unsigned integer values within a known range.
The number of integer values is << the number of integers within the range.
I want to build a data structure which allows the following runtime complexities:

*

*Insertion in O(1)

*After insertion is done:

*

*Deletion in O(1)

*Get all values within a query range in O(k) with k being the number of result values (returned values do not have to be sorted)

Memory complexity is not restricted. However, an astronomically large amount of memory is not available ;-)
Here is an example:

*

*range = [0, 1023]

*insert 42

*insert 350

*insert 729

*insert 64

*insert 1

*insert 680

*insert 258

*find values in [300;800] ; returns {350, 729, 680}

*delete 350

*delete 680

*find values in [35;1000] ; returns {42, 258, 64, 729, 258}

*delete 42

*delete 258

*find values in [0; 5] ; returns {1}

*delete 1

Is such a data structure even possible? (with the aid of look-up tables etc)?
An approximation I thought about would be:

*

*Bin the inserted values into buckets. 0..31 => bucket 0, 32..63 => bucket 1, 64..95 => bucket 2, 96..127 => bucket 3, ...

*Insertion: find bucket id using simple shifting arithmetic, then insert it into an array per bucket

*Find: find bucket id of start and endpoint using shifting arithmetic. Look through all values in the first and last bucket and check if they are within the range or outside the range. Add all values in all intermediate buckets to the search result

*Delete: find bucket id using shifting. Swap value to delete with last value in bucket, then decrement count for this bucket.
Downside: if there are many queries which query a range which has a span of less than 32 values, the whole bucket will be searched every time.
Downside 2: if there are empty buckets within the range, they will also be visited during the search phase.

A: Theoretically speaking, a van Emde Boas tree is your best bet, with O(log log M)-time operations where M is the size of the range. The space usage is quite large, though there are more efficient variants.
Actually the theoretical state of the art is described in the paper On Range Reporting in One Dimension, by Mortensen, Pagh, and Patrascu.
I'm not sure if the existing lower bounds rule out O(1), but M won't be large enough to make the distinction matter. Instead of the vEB structure, I would just use a k-ary trie with k a power of two like 32 or 64.
EDIT: here's one way to do range search with a trie.
Let's assume each datum is a bit pattern (easy enough; that's how the CPU think of it). Each subtree consists of all of the nodes with a certain prefix. For example, {0000, 0011, 0101, 1001} is represented by the following 4-ary trie, where X denotes a null pointer.
+---+---+---+---+
|00\|01\|10\|11X|
+--|+--|+--|+---+
   |   |   |
   |   |   +----------------------------+
+--+   |                                |
|      +------------+                   |
|                   |                   |
v                   v                   v
+---+---+---+---+   +---+---+---+---+   +---+---+---+---+
|00\|01X|10X|11\|   |00X|01\|10X|11X|   |00X|01\|10X|11X|
+--|+---+---+--|+   +---+--|+---+---+   +---+--|+---+---+
   |           |           |                   |
   v           v           v                   v
  0000        0011        0101                1001

A couple optimizations quickly become apparent. First, if all of the bit patterns are the same length, then we don't need to store them at the leaves—they can be reconstructed from the descent path. All we need is the bitmap, which if k is the number of bits in a machine word, fits nicely where the pointer from the previous level used to be.
+--------+--------+--------+--------+
|00(1001)|01(0100)|10(0100)|11(0000)|
+--------+--------+--------+--------+

In order to search the trie for a range like [0001, 1000], we start at the root, determine which subtrees might intersect the range and recurse on them. In this example, the relevant children of the root are 00, 01, and 10. The relevant children of 00 are the subtrees representing the prefixes 0001, 0010, and 0011.
For k fixed, reporting from a k-ary trie is O(log M + s), where M is the number of bit patterns and s is the number of hits. Don't be fooled though—when k is medium, each node occupies a couple cache lines but the trie isn't very high, so the number of cache misses is pretty small.

A: You could achieve your target (O(1),O(1) and O(k)) if the query operation required that it be told the value of at least one existing member that is already in the relevant range (the lower bound perhaps). Can you provide a guarantee that you will already know at least one member of the range? I guess not. I will expand if you can.
I'll now focus on the problem as specified. Each number in the data structure should form part of a linked list, such that each number knows the next highest number that is in the data structure. In C++
struct Number {
    struct Number *next_highest;
    int value;
};

Obviously, the largest value in the set will have next_highest==NULL, but otherwise this->value < this->next_highest->value
To add or remove or query, we need to be able to find the existing Numbers which are close to a particular lookup value.
set<Number *, specialized_comparator_to_compare_on_value_t >

Insertion and deletion would be O(log(N)), and query would be O(log(N)+k). N is the number of values currently in the set, which as you say will be much less than M (the number of possible values of the relevant datatype). Therefore log(N) < log(M). But in practice, other methods should also be considered, such as tries and such datastructures.


text:
Q: GWT: com.google.gwt.core.client.JavaScriptException. only using Internet Explorer Before explain my problem, I have to say that my GWT version is 2.2.0 and the error only has place when I use Internet Explorer (in this case IE 8).
I have a little GWT project which contains a button that throws the next method:
private void expotarExpediente(VistaExpediente vista) {
    final String templateURL = GWT.getHostPageBaseURL() + "exportar?id="
            + vista.getId();
    Window.open(
            templateURL,
            "Resultado de expotar el expediente: "
                    + vista.getNumeroExpediente(), "");
}

This method creates a template URL to call to a classic HTTPServlet ("exportar") which generates a Zip File to be downloaded by users.
The sentence  Window.open(...) open a window in the browser that allows download the file.
This works correctly in all browsers except Internet Explorer.
The thrown exception is the next:
The thrown exception is the next
10:08:31.208 [ERROR] [sistemadefiniciontramites] Uncaught exception escaped
com.google.gwt.core.client.JavaScriptException: (Error): Argumento no válido.
 number: -2147024809
 description: Argumento no válido.
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:237)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:129)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
    at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
    at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:214)
    at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
    at java.lang.Thread.run(Unknown Source)
I can´t find any decent solution searching by google. I would like to know if someone has had this problem or a similar problem before and if he or she could overcome it.
Thanks and excusme for my poor English.

A: Internet Explorer does not like spaces in window name when calling window.open(). So your string:
"Resultado de expotar el expediente: " + vista.getNumeroExpediente()

should be without spaces.