text:
Q: Embedded File gets corrupted after extraction from MS Word/PPT 2010 on Windows 7 I have a tricky situation here.
When I extract a file embedded as an object in an MS Word (docx) / PPT (pptx) file (copy & paste the embedded file object on your desktop),
the extracted file is corrupted. (Some junk characters get appended at the start of the file and certain characters are missing from the end of the file).
I started facing the issue after I started using Windows 7!
Any known bugs in Office 2010 on Windows 7?
Text File (Original)

Text File (After Copying & Pasting from a PPT (text file embedded as an object))

A: Hey man I had the same problem and think I was able to solve it, at least in my case.  I had mostly zip files embedded in powerpoint, and what I found initially is that I could only extract them into a windows explorer directory by a copy-and-paste method, however this left the zip files corrupted in a strange way where the file structure was intact but the files could not be unzipped.  However I absolutely needed this data so I started to experiment with other ways to recover it.
Long story short, there is no means of extracting the file from powerpoint in the typical/intuitive ways that you would try first, without it getting corrupted.
What you have to do instead is literally double-click the icon in the powerpoint slide and let it open with the default app associated with that extension.  In my case, they were zip files, so once the zip program opened up I was able to extract the zipped files to wherever I wanted.
If your embedded file is in a weird format, or the default program for that type isn't helpful for re-saving it in another location, you might have to get creative with the filetype associations in windows to get it to open in something that will allow you to copy/save your file.  Fortunately in my case I didn't have to go that far, but I suspect it could be done if necessary.
Hope that helps.


text:
Q: A sum of powers formula? (I was just playing around, I don't know if this is correct) So for reference, I'm just a high school student, who doesn't know that much maths stuff. But I noticed a pattern in binary numbers where, if you have all ones that is one less than if you have the next value (e.g. $1111$ is $1$ less than $10000$ - by definition). I generalised this to be a sum of base $2$ to $n$, and created a very simple sum:
$$\sum_{k=0}^{n} 2^k = 2^{n+1} - 1$$
This was pretty simple, and was pretty obvious. I tried generalising and came up with the thing below:
$$\sum_{k=0}^{n} a^k = \frac{a^{n+1}-1}{a-1}$$
I'm not sure if this thing is actually correct, as I was just playing around. If it is correct can someone forward me to the offical proof.
Thanks

A: You are correct! Well done!
For additional practice, I would encourage you strongly to try and prove the equality you found, before looking it up online.
There are two ways of proving the statement. Traditionally, one would define $$S=\sum_{k=0}^n a^k$$ and then observe the value of $$aS - S.$$
However, based on your reasoning, I would advise you look at what the sum looks like in base $a$. What does $a^n$ look like in base $a$?

redpajama_set_name: RedPajamaStackExchange


text:
Q: unable to capture command process id I am trying to capture the process id of the flume command with in a linux script.
the script is being executed in nohup mode : nohup flume.sh &
flume.sh:
flume-ng agent --conf . -Dflume.root.logger=info,console -Djavax.net.debug=info,console --conf-file FLUME_Surya.conf --name IBMMQ  --classpath $CLASSPATH -Dcom.ibm.mq.cfg.useIBMCipherMappings=false
echo $! > /biph/edl/SG/jobs/Src-104000-IPS_SG/CUL_FLUME_PROCESS_ID.txt

after the script is execute the text file is still empty, please advice

A: $! contains the process id of the most recent background job.  That is, job placed in the background by putting a & at the end of the line.  In your script nothing is put into the background, and thus $! is empty.  (The echo command line will open the file, creating it if it doesn't exist and truncate it if it does.  But it has nothing to write to it.)


text:
Q: Problem drawing Kiviat diagram From  this post, I started to play with TikZ/PGF to draw a Kiviat Diagram froma a file .dat
Suppose to have two file table1.dat and table2.dat live these
%table1
column1 column2
8.109115e-001 3.446073e+000
3.971423e+000 3.740758e+000
1.556075e+000 2.252708e+000
2.642666e+000 4.191069e-001
8.282436e-001 1.144885e+000
3.009910e+000 4.566687e+000
1.314856e+000 7.618901e-001
3.270395e+000 4.129085e+000

%table2
colonna1 colonna2 colonna3 colonna4
4.073618e+000 4.785835e+000 3.393676e+000 3.474143e+000
4.528960e+000 2.426878e+000 3.788701e+000 1.585497e+000
6.349341e-001 4.001402e+000 3.715662e+000 4.751110e+000
4.566879e+000 7.094317e-001 1.961135e+000 1.722304e-001
3.161796e+000 2.108806e+000 3.277389e+000 2.193722e+000
4.877020e-001 4.578678e+000 8.559334e-001 1.907792e+000
1.392491e+000 3.961037e+000 3.530230e+000 3.827584e+000
2.734408e+000 4.797462e+000 1.591642e-001 3.976000e+000
4.787534e+000 3.278703e+000 1.384615e+000 9.343630e-001
4.824443e+000 1.785584e-001 2.308570e-001 2.448822e+000
7.880654e-001 4.245647e+000 4.856589e-001 2.227931e+000
4.852964e+000 4.669966e+000 4.117289e+000 3.231565e+000

Here it is the explained code:
\documentclass{report}

\usepackage{tikz}
\usetikzlibrary{calc}

\usepackage{pgfplotstable}

\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\setlength{\PreviewBorder}{5mm}
\pagestyle{empty}

\makeatletter
\newcommand{\Kiviat}[5]{
% #1 - Table file
% #2 - List of the axis label. His lenght cannot be higher that the number of column of the table.
%      It can be lower
% #3 - Color list. His lenght cannot be higher that the number of column of the table.
%      It can be lower
% #4 - Pitch of th grid lines
% #5 - Axis line width

% LOAD TABLE
% The table must be n x m where each n column is the m plot in function of the angle.
% The first row(labeled by pgfplots table like 0) must contain the name of every column
\pgfplotstableread{#1}\table

% COMPUTETATION OF TABLE DIMENSION
%->number of axis
\pgfplotstablegetrowsof{\table}
\pgfmathsetmacro{\axisNumber}{\pgfplotsretval-1}
%\show\axisNumber

%-> number of the column to compute
\pgfplotstablegetcolsof{\table}
\pgfmathsetmacro{\columnNumber}{\pgfplotsretval-1}
%\show\columnNumber

% LOAD AXIS LABEL
\def\namesAxis{#2}
\foreach \x[count=\kk] in \namesAxis{}

\pgfmathparse{\kk<=(\axisNumber+1)}
\ifnum\pgfmathresult=0
\errmessage{The number of labels is greater that number of column of the table loaded}
\fi

% LOAD COLOR LIST
\def\listaColori{#3}
\foreach \mese[count=\numeroColori] in \listaColori{}
%\show\numeroColori

\pgfmathparse{\numeroColori<=(\columnNumber+1)}
\ifnum\pgfmathresult=0
\errmessage{Il numero dei colori è maggiore delle colonne dei dati}
\fi

% COMPUTE THE MAXIMUM ELEMENT INTO THE TABLE TO COMPUTE THE RADIUS OF KIVIAT DIAGRAM
% -> starting value
\def\maxRadius{0}

\count1=0%\columnNumber
\count2=0%\axisNumber
\countdef\val=0
\def\maxRadius{0}

\loop
\ifnum\count1<\columnNumber
\advance\count1 by 1

{\loop
\ifnum\count2<\axisNumber
\advance\count2 by 1

\pgfplotstablegetelem{\count2}{[index]\count1}\of\table

\pgfmathparse{\maxRadius<\pgfplotsretval}

\ifnum\pgfmathresult=1
\pgfmathsetmacro{\maxRadius}{\pgfplotsretval}
\node (Max) at (0,\maxRadius){};
\fi
\repeat}

\count2=0
\repeat
% now the value of the maximum value into the table is stored in coordinate y of (Max) point in pt units.
% It must be converted in unit less number in centimenter and saved into \radius variable

\pgfextracty{\pgf@x}{(Max)}
%pgfmathsetmacro{\radius}{}
\pgfmathsetmacro{\radius}{ceil(abs(\pgf@x)*2.54/72)}

% COMPUTE THE GRID LINES NUMBER
\def\pitch{#4}
\pgfmathsetmacro{\numberTick}{\radius/\pitch}

% AXIS LINE WIDTH
\def\lwidth{#5}

% COMPUTE OF THE ANGLE BETWEEN THE AXIS
\pgfmathsetmacro{\ang}{360/(\axisNumber+1)}

% COMPUTE OF TICK RADIUS
\pgfmathsetmacro{\tickRadius}{1.5*\lwidth}

% GRID DRAWING
\begin{pgfscope}
\pgfsetlinewidth{.5pt}
\pgfsetstrokecolor{gray!50}
\foreach \altezza in {0,1,...,\numberTick}{
\pgfmathsetmacro{\dist}{\altezza*\pitch}
\foreach \axis in {0,1,...,\axisNumber}{
\ifnum\axis=0
\pgfpathmoveto{\pgfpointpolar{\ang*(\axis+1)}{\dist cm}}%
\else
\pgfpathlineto{\pgfpointpolar{\ang*(\axis+1)}{\dist cm}}
\fi}
\pgfpathclose
\pgfusepath{stroke}
}
\end{pgfscope}

% AXIS  and CIRCLE TICK DRAWING
\foreach \axis in {0,1,...,\axisNumber}{
\draw[->, line width=\lwidth pt] (0,0)--++(\ang*\axis:{\radius+1});
\foreach \tickPosition in {1,...,\numberTick}{
\fill (\ang*\axis:\pitch*\tickPosition)circle(\tickRadius pt);
}
}

% TICK DRAWING
\foreach \tick in {1,2,...,\radius}{
\node[anchor=south west] at (\tick,0){\tick};
}

% AXIS LABELING
\foreach \axis[count=\kk] in \namesAxis{
% \ang between 270 and 360
\pgfmathparse{(\ang*(\kk-1))<360&&(\ang*(\kk-1))>270}
\ifnum\pgfmathresult=1
\def\anchor{north west}
\fi

% \ang between 180 and 270
\pgfmathparse{(\ang*(\kk-1))<270&&(\ang*(\kk-1))>180}
\ifnum\pgfmathresult=1
\def\anchor{north east}
\fi

% \ang between 90 and 180
\pgfmathparse{(\ang*(\kk-1))<180&&(\ang*(\kk-1))>90}
\ifnum\pgfmathresult=1
\def\anchor{south east}
\fi

% \ang between  0 and 90
\pgfmathparse{(\ang*(\kk-1))<90&&(\ang*(\kk-1))>0}
\ifnum\pgfmathresult=1
\def\anchor{south west}
\fi

% \ang nei 4 punti cartinali
% east
\pgfmathparse{(\ang*(\kk-1))==0}
\ifnum\pgfmathresult=1
\def\anchor{west}
\fi
% nord
\pgfmathparse{(\ang*(\kk-1))==90}
\ifnum\pgfmathresult=1
\def\anchor{south}
\fi
% west
\pgfmathparse{(\ang*(\kk-1))==180}
\ifnum\pgfmathresult=1
\def\anchor{east}
\fi
% south
\pgfmathparse{(\ang*(\kk-1))==270}
\ifnum\pgfmathresult=1
\def\anchor{north}
\fi

\node[anchor=\anchor] at ({\ang*(\kk-1)}:{\radius+1}){\axis};
}

% FILE PLOTTING
\pgfplotstableforeachcolumn\table\as\nomeColonne{%
\begin{pgfscope}

% color definition
\pgfmathsetmacro{\cucu}{\pgfplotstablecol+1}
\foreach \var[count=\kk] in \listaColori{
\ifnum\kk=\cucu
\pgfsetstrokecolor{\var}
\fill[shift={(\radius cm+2 cm,-\pgfplotstablecol cm+\radius cm)},\var] (0,0)rectangle(.5,-.5);
\node[shift={(\radius cm+2 cm,-\pgfplotstablecol cm+\radius cm)}, anchor=west] at (.5,-.25){\nomeColonne};
\breakforeach
\fi
}

\foreach \axis in {0,1,...,\axisNumber}{
\pgfplotstablegetelem{\axis}{[index]\pgfplotstablecol}\of\table
\pgfmathsetmacro{\data}{\pgfplotsretval}
\ifnum\axis=0
\pgfpathmoveto{\pgfpointpolar{\ang*\axis}{\data cm}}%
\else
\pgfpathlineto{\pgfpointpolar{\ang*\axis}{\data  cm}}
\fi
}
\pgfsetlinewidth{2pt}
\pgfclosepath
\pgfusepath{stroke}
\end{pgfscope}}
}
\makeatother

\begin{document}

\begin{tikzpicture}%[scale=.65]
\Kiviat{table1.dat}
{row1,row2,ro3,row4,row5,ro6,row7,row8}
{red,orange}
{.5}
{1}
\end{tikzpicture}

\begin{tikzpicture}%[scale=.65]
\Kiviat{table2.dat}
{row1,row2,row3,row4,row5,row6,row7,row8,ro9,row10,row11,row12}
{red,orange,green!50!black,yellow!70!black}
{.5}
{1}
\end{tikzpicture}

\end{document}

These are the results
For sure is not the best and more efficient code possible to write but it is a beginning.
Indeed, there is a big problem. If i scale the tikzpicture, not every component is scaled in the right way.
I'd like to introduce some pgfkeys to play with much more input. Can somebody help me?
Many thanks in advance

A: I've taken a different approach: I draw the plots using pgfplots, which makes it possible to use stuff like the legend functions and plot styles.
I have also assumed that the row and column titles are in the datafile. I'm not sure if that's what is going to be the case for you, but I thought that this would make it easier to plot different datasets. It should be easy enough to change to an argument similar to the one you used, though.
The plots are resizable through a scale factor that influences a base length in the plot. This keeps all the font sizes and line widths unchanged. If you want to actually scale everything down, you should go with what Martin suggested.
Maybe this approach is not what you need, but I think at least the algorithm for searching for the maximum value in a table using pgfplotstable should be useful.
\documentclass{minimal}

\usepackage{pgfplots}
\usepackage{listings}

\usepackage{pgfplotstable}

\begin{document}

\newcommand\kiviat[1]{
\def\filename{#1}

\pgfplotstablevertcat{\dataA}{\filename} % Load table
\pgfplotstablegetrowsof{\dataA} % Determine no. of rows
\pgfmathsetmacro{\rows}{\pgfplotsretval}
\pgfplotstablegetcolsof{\dataA} % Determine no. of cols
\pgfmathsetmacro{\cols}{\pgfplotsretval-1} % Correct offset
\pgfplotstablevertcat{\dataA}{\dataA} % Double the table to close gap after last point
% Read table again with "header=false" which gives us access to the header names
\pgfplotstableread[header=false]{\filename}{\headertable}

% Not implemented: "\startingcol" could be used to switch between
%  row names in file and row names as argument
\def\startingcol{1}

% Find largest element
\pgfmathsetmacro\maxval{0}
\foreach \i in {\startingcol,...,\cols} {%
  \pgfplotstablesort[sort key={[index] \i},sort cmp={float >}]\sorted{\dataA}
  \pgfplotstablegetelem{0}{[index] \i}\of{\sorted}
  \pgfmathsetmacro\newval{ceil(max(\pgfplotsretval,\maxval))}
  \global\let\maxval=\newval
}

\pgfplotsset{every axis }

\newdimen\radius
\pgfmathsetlength\radius{4cm*\scalefactor}

\tikzstyle{grid}=[gray]

% Draw the grid
\foreach \i in {1,...,\rows} {
  \draw [grid,thick,->] (0,0) -- (\i/\rows*360:\radius+1em); % Spokes
  \pgfplotstablegetelem{\i}{[index] 0}\of{\dataA}
  % Spoke labels: some trigonometry to determine offset, needs tweaking
  \pgfmathsetmacro\dist{abs(cos(\i/\rows*360)*3}
  \node at (\i/\rows*360:\radius+\dist ex+1.5em) [anchor=center] {\pgfplotsretval};
  % Points and grid lines
  \foreach \j in {1,...,\maxval} {
    \draw [fill,grid,black] (\i/\rows*360:\j*\radius/\maxval) circle (1pt);
    \pgfmathsetmacro\nexti{\i+1}
    \draw [grid] (\i/\rows*360:\j*\radius/\maxval) -- (\nexti/\rows*360:\j*\radius/\maxval);
  }
}

% Tick labels
\foreach \j in {0,...,\maxval} {
  \node [anchor=south west,inner xsep=0pt,inner ysep=2pt] at (0:\j*\radius/\maxval) {\j};
}

% The actual plot area
\begin{axis}[anchor=center,
scale only axis, width=2\radius, height=2\radius, hide axis,
xmin=-\maxval,xmax=\maxval,ymin=-\maxval,ymax=\maxval,
legend style={ at={(1.03,1.08)}, anchor=north west}
]
\foreach \n in {\startingcol,...,\cols} {
% pgfplots doesn't know polar coordinate systems, that's why we'll use cos and sin
\addplot +[no markers,thick] table [x expr=cos(\pgfplotstablerow/\rows*360)*\thisrowno{\n},y expr=sin(\pgfplotstablerow/\rows*360)*\thisrowno{\n}] {\dataA};
\pgfplotstablegetelem{0}{\n}\of{\headertable}
\addlegendentryexpanded{\pgfplotsretval}
}
\end{axis}
}

\tikzstyle{every plot}+=[line width=2pt] % Can be used to influence plot style
\def\scalefactor{.65} % Scale factor multiplies the base length, everything else is relative to that
\begin{tikzpicture}
 \kiviat{table1.dat}
\end{tikzpicture}

\tikzstyle{every plot}+=[line width=1pt]
\def\scalefactor{1}
\begin{tikzpicture}
\pgfplotsset{cycle list name=exotic}
 \kiviat{table2.dat}
\end{tikzpicture}

\end{document

A: I created a package to create tkz-kiviat diagram from a file.date . I add another example in this post
how-to-draw-kiviat-diagrams
The example number 5 kiviat example used an external file. My package is based on TikZ and pgfplotstable.
:
You can see that I use a lot of options ans styles from TikZ
\begin{tikzpicture}
\tkzKiviatDiagramFromFile[
        scale=.5,
        label distance=.5cm,
        gap     = 1,label space=3,
        lattice = 10]{tableae.dat}
\tkzKiviatLineFromFile[thick,
                       color      = blue,
                       mark       = ball,
                       ball color = blue,
                       mark size  = 4pt,
                       fill       = blue!20]{tableae.dat}{2}
\tkzKiviatLineFromFile[thick,
                       color      = red,
                       mark       = ball,
                       ball color = red,
                       mark size  = 4pt,
                       fill       = red!20]{tableae.dat}{1}
\end{tikzpicture}

A: AFAIK you have to use the transform canvas option to scale complex tikzpictures,
e.g. [transform canvas={scale=2}], otherwise only the coordinates are scaled.
See section 22.4 "Canvas Transformations" in the pgfmanual.
You also can just put the whole picture in a \scalebox or \resizebox (graphicx package).
Update:
I tested your document now with [transform canvas={scale=2}].
The scaling seems work but the bounding box is gone. I would really suggest to use \scalebox or \resizebox as described for this question. They work fine.


text:
Q: How can change my Ubuntu One profile and Ubuntu developer profile email address? How can change my Ubuntu profile and Ubuntu developer profile email address?
I have a Profile email that soon cease to exist and want replace it.
I created an Ubuntu Phone developer account but auto filled in the email that Ubuntu One has - this in a few weeks I will cease to have access to - how can I change both emails?
Probably if change main profile it will change developer profile?

A: You should be able to add a new email, and change the default on your Ubuntu One Single Sign On.

*

*Go to https://login.ubuntu.com/ and login with your current e-mail and password.

*Under Personal Details click on Manage email address:

*Enter in a new email address in this field:

*Verify your new email address, by following the instructions they send to that email.

*Under "Preferred email address" you should now be able to select your new email.
Since your developer account uses the same Ubuntu One SSO, It should pick up on the settings, otherwise the field is unchangeable from there:

However you can change the e-mail you use for receiving pay-pal payments under "My Account":


text:
Q: Convert website to webapplication (User Controls) I'm developing a website in asp.net and now I need to convert it to a webapplication.
I created a new project with a new webapplication template and copy me files. I did a right click in the sollution and convert to webapplication and it worked fine, the vs2010 has created a design.vb files for each webform and it's good.
But, there are some webforms that uses some user controls and this user control doesn't created the declation in design.vb. I'd like to know if is there any way to fix the declations in webform to a my desing file to be used in code-behine ???
Thanks

A: You can right click on each user control and select Convert To Web Application (or something like that) individually to generate the designer files.

A: There is no easy way to do this through VS. You can alternatively try ReSharper's Adjust Namespace functionality.


text:
Q: column header viewport doesn't scroll I have a list in a scrollpane. The list fills with Strings that are longer than the list viewport, so I get horizontal scrolling OK. When I tried to add a columnheaderviewport with a label, that viewport won't scroll with the main viewport. It tries to scroll, flashing where the label text should be, but immediately returning to the default size/view.
Is using a column header only for scrollpanes with tables inside? That's the only examples I can find on the 'net. The java doc tutorials say nothing about tables only, and the column header should track the main viewport.
I'm using JDK 1.7 and Netbeans 8.0.

A: In the process of writing a small example, I inadvertently increased the amount of text in the label to more than what the label would display. Then the viewport started scrolling, tracking the main viewport scroll. I had read that the component in the column header viewport had to be same width as the main viewport, but apparently it's the content, not the component size that matters.
So, yes, a column header viewport can be scrollable with a list, not just tables.


text:
Q: Unable to connect to BLE: [CoreBluetooth] XPC connection invalid error I am using an Adafruit nRF8001 bluetooth module with an Arduino Nano micro controller. The goal is to connect the nRF8001 to an iOS application. This connection was successfully made using an Arduino Uno. However, when switching to the Arduino Nano, the connection cannot be made and the following is printed to the XCode console: "[CoreBluetooth] XPC connection invalid".
The class that attempts to make the connection implements CBCentralManagerDelegate and CBPeripheralDelegate.
To find the error, I write to the console in each of the delegate functions. I found that the "XPC connection invalid" message is printed 0.004 seconds after initializing the CBCentralManager object. After this, the centralManagerDidUpdateState delegate method is called, and the CBCentralManager passed to this function has a state of CBManagerStatePoweredOn. Then I use the CBCentralManager to call scanForPeripheralsWithServices. This is the last message that I receive because the didDiscoverPeripheral method is never called.
On a separate post, I found that other people found success by adding a privacy description. I added a "Privacy - Bluetooth Peripheral Usage Description" in the project's Info.plist without any luck.
I really appreciate any help.


text:
Q: Tomcat thread waiting on and locking the same resource Consider the following Java\Tomcat thread dump:
"http-0.0.0.0-4080-4" daemon prio=10 tid=0x0000000019a2b000 nid=0x360e in Object.wait() [0x0000000040b71000]
   java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x00002ab5565fe358> (a org.apache.tomcat.util.net.JIoEndpoint$Worker)
    at java.lang.Object.wait(Object.java:485)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.await(JIoEndpoint.java:458)
    - locked <0x00002ab5565fe358> (a org.apache.tomcat.util.net.JIoEndpoint$Worker)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:484)
    at java.lang.Thread.run(Thread.java:662)

Is this a deadlock? It seems that the same resource (0x00002ab5565fe358) is both locked and waited on - what does it mean?

A: Its more like an infinite wait(). It would have said something like id1 is BLOCKED on monitor owned by id2


text:
Q: Monitor and record ethernet port upload speeds Can I use Mathematica to monitor and record ethernet port upload speeds?
I briefly looked at DeviceStream; not sure if that can be made to work or if that's the best place to start.
I used some (not cheap) video equipment to screen record my FTP upload progress. If there is a way to have Mathematica (or preferably a CDF document) monitor and record upload speeds, that would be useful.  Or if this is something Linux can handle, I'm open to going that route.


text:
Q: Codeigniter imagens nao carrega Sou novo utilizando o CI, e estou tendo problemas com ele pois ele não carrega as imagens em ambiente localhost (usando XAMPP). Já inspecionei e verifiquei se o caminho esta tudo ok, e esta de fato, mas nada da imagem carregar.
Já testei em localhost, mas sem utilizar o CI e a imagem carrega normalmente, gostaria que alguém com mais conhecimentos que eu me ajudasse.

        <?php foreach ($products as $product): ?>

                <?php echo form_open("shop/add"); ?>

<?php echo $product->name; ?>

                        <?php echo img(array(
                            'src' => 'img/'.$product->image,
                            'class' => 'thumb',
                            'alt' => $product->name)); ?>

$<?php echo $product->price; ?>

                <?php echo form_close(); ?>

        <?php endforeach; ?>

$config['base_url'] = 'http://localhost/carrinho/';

A: O problema era que a pasta images estava dentro de Application, coloquei um nivel fora e Funcionou! problema resolvido.


text:
Q: Rejecting class com.google.firebase.database.FirebaseDatabase because it failed compile-time verification Today in a new android project i got myself stuck on this problem.
I Initialized Firebase authentication and Database.
Auth works fine.
My first attempt to retrive a firebase DB reference failed with this logcat:
05-16 00:13:53.621 13078-13078/lorenzogangemideveloper.insurancehelper E/System: stat file error, path is /data/app/lorenzogangemideveloper.insurancehelper-1/lib/arm64, exception is android.system.ErrnoException: stat failed: ENOENT (No such file or directory) 05-16 00:13:53.716 13078-13078/lorenzogangemideveloper.insurancehelper A/FirebaseApp: Firebase API initialization failure.
                                                                                java.lang.reflect.InvocationTargetException
                                                                                at java.lang.reflect.Method.invoke(Native Method)
                                                                                at java.lang.reflect.Method.invoke(Method.java:372)
                                                                                at com.google.firebase.FirebaseApp.zza(Unknown Source)
                                                                                at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
                                                                                at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
                                                                                at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
                                                                                at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
                                                                                at android.content.ContentProvider.attachInfo(ContentProvider.java:1840)
                                                                                at android.content.ContentProvider.attachInfo(ContentProvider.java:1815)
                                                                                at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
                                                                                at android.app.ActivityThread.installProvider(ActivityThread.java:5563)
                                                                                at android.app.ActivityThread.installContentProviders(ActivityThread.java:5136)
                                                                                at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5061)
                                                                                at android.app.ActivityThread.access$1600(ActivityThread.java:187)
                                                                                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1645)
                                                                                at android.os.Handler.dispatchMessage(Handler.java:111)
                                                                                at android.os.Looper.loop(Looper.java:194)
                                                                                at android.app.ActivityThread.main(ActivityThread.java:5877)
                                                                                at java.lang.reflect.Method.invoke(Native Method)
                                                                                at java.lang.reflect.Method.invoke(Method.java:372)
                                                                                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1020)
                                                                                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:815)
                                                                                Caused by: java.lang.NoSuchMethodError: No static method getNoBackupFilesDir(Landroid/content/Context;)Ljava/io/File; in class Lcom/google/android/gms/common/util/zzw; or its super classes (declaration of 'com.google.android.gms.common.util.zzw' appears in /data/app/lorenzogangemideveloper.insurancehelper-1/base.apk:classes33.dex)
                                                                                at com.google.firebase.iid.zzh.zzeK(Unknown Source)
                                                                                at com.google.firebase.iid.zzh.<init>(Unknown Source)
                                                                                at com.google.firebase.iid.zzh.<init>(Unknown Source)
                                                                                at com.google.firebase.iid.zzd.zzb(Unknown Source)
                                                                                at com.google.firebase.iid.FirebaseInstanceId.getInstance(Unknown Source)
                                                                                at java.lang.reflect.Method.invoke(Native Method)
                                                                                at java.lang.reflect.Method.invoke(Method.java:372)
                                                                                at com.google.firebase.FirebaseApp.zza(Unknown Source)
                                                                                at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
                                                                                at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
                                                                                at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
                                                                                at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
                                                                                at android.content.ContentProvider.attachInfo(ContentProvider.java:1840)
                                                                                at android.content.ContentProvider.attachInfo(ContentProvider.java:1815)
                                                                                at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
                                                                                at android.app.ActivityThread.installProvider(ActivityThread.java:5563)
                                                                                at android.app.ActivityThread.installContentProviders(ActivityThread.java:5136)
                                                                                at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5061)
                                                                                at android.app.ActivityThread.access$1600(ActivityThread.java:187)
                                                                                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1645)
                                                                                at android.os.Handler.dispatchMessage(Handler.java:111)
                                                                                at android.os.Looper.loop(Looper.java:194)
                                                                                at android.app.ActivityThread.main(ActivityThread.java:5877)
                                                                                at java.lang.reflect.Method.invoke(Native Method)
                                                                                at java.lang.reflect.Method.invoke(Method.java:372)
                                                                                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1020)
                                                                                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:815)  05-16 00:13:53.828 13078-13078/lorenzogangemideveloper.insurancehelper A/FirebaseApp: Firebase API initialization failure.
                                                                                java.lang.reflect.InvocationTargetException
                                                                                at java.lang.reflect.Method.invoke(Native Method)
                                                                                at java.lang.reflect.Method.invoke(Method.java:372)
                                                                                at com.google.firebase.FirebaseApp.zza(Unknown Source)
                                                                                at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
                                                                                at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
                                                                                at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
                                                                                at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
                                                                                at android.content.ContentProvider.attachInfo(ContentProvider.java:1840)
                                                                                at android.content.ContentProvider.attachInfo(ContentProvider.java:1815)
                                                                                at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
                                                                                at android.app.ActivityThread.installProvider(ActivityThread.java:5563)
                                                                                at android.app.ActivityThread.installContentProviders(ActivityThread.java:5136)
                                                                                at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5061)
                                                                                at android.app.ActivityThread.access$1600(ActivityThread.java:187)
                                                                                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1645)
                                                                                at android.os.Handler.dispatchMessage(Handler.java:111)
                                                                                at android.os.Looper.loop(Looper.java:194)
                                                                                at android.app.ActivityThread.main(ActivityThread.java:5877)
                                                                                at java.lang.reflect.Method.invoke(Native Method)
                                                                                at java.lang.reflect.Method.invoke(Method.java:372)
                                                                                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1020)
                                                                                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:815)
                                                                                Caused by: java.lang.NoSuchMethodError: No static method zzyv()Lcom/google/android/gms/common/util/zze; in class Lcom/google/android/gms/common/util/zzh; or its super classes (declaration of 'com.google.android.gms.common.util.zzh' appears in /data/app/lorenzogangemideveloper.insurancehelper-1/base.apk:classes33.dex)
                                                                                at com.google.android.gms.internal.zzatt.zzn(Unknown Source)
                                                                                at com.google.android.gms.internal.zzatp.<init>(Unknown Source)
                                                                                at com.google.android.gms.internal.zzatt.zzLP(Unknown Source)
                                                                                at com.google.android.gms.internal.zzatp.zzbu(Unknown Source)
                                                                                at com.google.android.gms.measurement.AppMeasurement.getInstance(Unknown Source)
                                                                                at java.lang.reflect.Method.invoke(Native Method)
                                                                                at java.lang.reflect.Method.invoke(Method.java:372)
                                                                                at com.google.firebase.FirebaseApp.zza(Unknown Source)
                                                                                at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
                                                                                at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
                                                                                at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
                                                                                at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
                                                                                at android.content.ContentProvider.attachInfo(ContentProvider.java:1840)
                                                                                at android.content.ContentProvider.attachInfo(ContentProvider.java:1815)
                                                                                at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
                                                                                at android.app.ActivityThread.installProvider(ActivityThread.java:5563)
                                                                                at android.app.ActivityThread.installContentProviders(ActivityThread.java:5136)
                                                                                at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5061)
                                                                                at android.app.ActivityThread.access$1600(ActivityThread.java:187)
                                                                                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1645)
                                                                                at android.os.Handler.dispatchMessage(Handler.java:111)
                                                                                at android.os.Looper.loop(Looper.java:194)
                                                                                at android.app.ActivityThread.main(ActivityThread.java:5877)
                                                                                at java.lang.reflect.Method.invoke(Native Method)
                                                                                at java.lang.reflect.Method.invoke(Method.java:372)
                                                                                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1020)
                                                                                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:815)  05-16 00:13:54.140 13078-13305/lorenzogangemideveloper.insurancehelper E/NativeCrypto: ssl=0x7f77c8b500 cert_verify_callback x509_store_ctx=0x7f6a720af8 arg=0x0 05-16 00:13:54.140 13078-13305/lorenzogangemideveloper.insurancehelper E/NativeCrypto: ssl=0x7f77c8b500 cert_verify_callback calling verifyCertificateChain authMethod=ECDHE_ECDSA 05-16 00:13:54.430 13078-13330/lorenzogangemideveloper.insurancehelper E/MPlugin: Unsupported class: com.mediatek.common.telephony.IOnlyOwnerSimSupport 05-16 00:13:54.467 13078-13328/lorenzogangemideveloper.insurancehelper E/GED: Failed to get GED Log Buf, err(0) 05-16 00:14:03.706 13078-13078/lorenzogangemideveloper.insurancehelper E/AndroidRuntime: FATAL EXCEPTION: main
                                                                                Process: lorenzogangemideveloper.insurancehelper, PID: 13078
                                                                                java.lang.VerifyError: Rejecting class com.google.firebase.database.FirebaseDatabase because it failed compile-time verification (declaration of 'com.google.firebase.database.FirebaseDatabase' appears in /data/app/lorenzogangemideveloper.insurancehelper-1/base.apk:classes12.dex)
                                                                                at com.google.firebase.database.FirebaseDatabase.getInstance(Unknown Source)
                                                                                at lorenzogangemideveloper.insurancehelper.compagnie.frag_lista_compagnie.onStart(frag_lista_compagnie.java:110)
                                                                                at android.support.v4.app.Fragment.performStart(Fragment.java:2218)
                                                                                at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1340)
                                                                                at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1528)
                                                                                at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1595)
                                                                                at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:758)
                                                                                at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2363)
                                                                                at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2149)
                                                                                at android.support.v4.app.FragmentManagerImpl.optimizeAndExecuteOps(FragmentManager.java:2103)
                                                                                at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2013)
                                                                                at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:710)
                                                                                at android.os.Handler.handleCallback(Handler.java:815)
                                                                                at android.os.Handler.dispatchMessage(Handler.java:104)
                                                                                at android.os.Looper.loop(Looper.java:194)
                                                                                at android.app.ActivityThread.main(ActivityThread.java:5877)
                                                                                at java.lang.reflect.Method.invoke(Native Method)
                                                                                at java.lang.reflect.Method.invoke(Method.java:372)
                                                                                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1020)
                                                                                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:815)

I tryed this solution but it doesn't works --> link
Here's the class where i try to get the DB reference:
public class frag_lista_compagnie extends Fragment {

    //INTERFACCIA
    private OnListaCompagnieFragmentInteractoinListener InterfacciaListaCompagnie;

    //PARAMETRI
    private static final String ARG_PARAM1 = "param1";
    private static final String ARG_PARAM2 = "param2";
    private String mParam1;
    private String mParam2;

    //UI
    RecyclerView Recycle;

    //OGGETTI
    List<Compagnia> Compagnie;
    Adapter_compagnie Adapter;

    //DATABASE
    DatabaseReference ReferenceCompagnie;

    public frag_lista_compagnie() {
        // Required empty public constructor
    }

    public static frag_lista_compagnie newInstance(String param1, String param2) {
        frag_lista_compagnie fragment = new frag_lista_compagnie();
        Bundle args = new Bundle();
        args.putString(ARG_PARAM1, param1);
        args.putString(ARG_PARAM2, param2);
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (getArguments() != null) {
            mParam1 = getArguments().getString(ARG_PARAM1);
            mParam2 = getArguments().getString(ARG_PARAM2);
        }
            Compagnie = new ArrayList<>();
            Compagnie.add(new Compagnia());
            Compagnie.add(new Compagnia());
            Adapter = new Adapter_compagnie(Compagnie);
            //
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view =inflater.inflate(R.layout.fragment_lista_compagnie, container, false);
        Recycle = (RecyclerView)view.findViewById(R.id.RecycleListaCompagnie);
        return view;
    }

    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
        if(getArguments().getString(ARG_PARAM1,"").equals("Interact"))
        if (context instanceof OnListaCompagnieFragmentInteractoinListener) {
            InterfacciaListaCompagnie = (OnListaCompagnieFragmentInteractoinListener) context;
        } else {
            throw new RuntimeException(context.toString()
                    + " must implement OnFragmentInteractionListener");
        }
    }

    @Override
    public void onDetach() {
        super.onDetach();
        InterfacciaListaCompagnie = null;
    }

    @Override
    public void onStart() {
        super.onStart();
        Recycle.setLayoutManager(new LinearLayoutManager(getContext()));
        Recycle.setItemAnimator(new DefaultItemAnimator());
        Recycle.setAdapter(Adapter);
        ReferenceCompagnie = FirebaseDatabase.getInstance().getReference(FirebaseAuth.getInstance().getCurrentUser().getUid()
+ "/Compagnie");
        ReferenceCompagnie.addValueEventListener(new ValueEventListener() {
            @Override
            public void onDataChange(DataSnapshot dataSnapshot) {
                if(dataSnapshot.exists())
                    for(DataSnapshot compagnia: dataSnapshot.getChildren())
                    {
                        Compagnia x = (Compagnia) compagnia.getValue();
                        x.setKiave(compagnia.getKey());
                        boolean AlredyThere=false;
                        for(int i=0;i<Compagnie.size();i++) {
                            if (Compagnie.get(i).getKiave().equals(x.getKiave())) {
                                Compagnie.set(i, x);
                                AlredyThere=true;
                                Adapter.notifyDataSetChanged();
                            }
                        }
                        if(!AlredyThere) {
                            Compagnie.add(x);
                            Adapter.notifyItemInserted(Compagnie.size() - 1);
                        }

                    }
                else
                    Log.i("ReferenceCompagnie","No data from server");

            }

            @Override
            public void onCancelled(DatabaseError databaseError) {
                Snackbar.make(getView(),R.string.errore_list_compagnie,Snackbar.LENGTH_LONG).show();
            }
        });
    }

    @Override
    public void onStop() {
        super.onStop();
        ReferenceCompagnie.addValueEventListener(null);
    }

    interface OnListaCompagnieFragmentInteractoinListener {
        void onFragmentInteraction(Uri uri);
    } }

A: Open firebase docs and check the Gradle Dependency Line under the Guide tab. Here you will see a list of service,Compare your service version of real-time database
with the list.Currently the latest version is

com.google.firebase:firebase-database:10.2.6

Make sure your firebase-database version in your build.gradle(Module: app) is same as in the Gradle dependency line


text:
Q: New-ADUser : Cannot bind parameter because parameter 'co' is specified more than once I saw some questions which has kinda the same title, but none of them solved my problem, I don't get why I get this error. Here's my code :
$NORMAL_ACCOUNTS = Import-Excel -Path "data_norm.xlsx"

$TEMPLATE_NORMAL_ACCOUNT = Get-ADUser anUser -Properties c, CN, co, Company, Country, Description, DisplayName, DistinguishedName, employeeType, GivenName, Manager, Name, Organization, otherMailbox, preferredLanguage, PrimaryGroup, SamAccountName, sn, StreetAddress, Surname, Title, UserPrincipalName
$TEMPLATE_NORMAL_ACCOUNT.UserPrincipalName = $NULL

$OTHER_EMAIL = $NULL

FOREACH($NORMAL in $NORMAL_ACCOUNTS)
{

    $OTHER_EMAIL = @("$($NORMAL.otherMailbox)")

    New-ADUser `
        -Instance $TEMPLATE_NORMAL_ACCOUNT `
        -c "$($NORMAL.c)" `
        -CN "$($NORMAL.CN)" `
        -co "$($NORMAL.co)" `
        -Company "$($NORMAL.Company)" `
        -Country "$($NORMAL.Country)" `
        -Description "$($NORMAL.Description)" `
        -DisplayName "$($NORMAL.DisplayName)" `
        -DistinguishedName "$($NORMAL.DistinguishedName)" `
        -employeeType "$($NORMAL.employeeType)" `
        -GivenName "$($NORMAL.GivenName)" `
        -Manager "$($NORMAL.Manager)" `
        -Name "$($NORMAL.Name)" `
        -Organization "$($NORMAL.Organization)" `
        -otherMailbox $OTHER_EMAIL `
        -preferredLanguage "$($NORMAL.preferredLanguage)" `
        -PrimaryGroup "$($NORMAL.PrimaryGroup)" `
        -SamAccountName "$($NORMAL.SamAccountName)" `
        -sn "$($NORMAL.sn)" `
        -StreetAddress "$($NORMAL.StreetAddress)" `
        -Surname "$($NORMAL.Surname)" `
        -Title "$($NORMAL.Title)" `
        -UserPrincipalName "$($NORMAL.UserPrincipalName)" `
        -AccountPassword (Read-Host -AsSecureString "INPUT USER PASSWORD") `
        -Enabled $FALSE

}

And I get (in French) this error :
New-ADUser : Impossible de lier le paramètre, car le paramètre «co» est spécifié plusieurs fois. Pour fournir plusieurs valeurs aux paramètres qui les
acceptent, utilisez la syntaxe de tableau. Par exemple, «-parameter valeur1,valeur2,valeur3».
Au caractère D:\Users\pmonties\OneDrive - Professional\Documents\VARONIS - I-TRACING\CREATE_ACCOUNTS.ps1:22 : 9
+         -co "$($NORMAL.co)" `
+         ~~~
    + CategoryInfo          : InvalidArgument : (:) [New-ADUser], ParameterBindingException
    + FullyQualifiedErrorId : ParameterAlreadyBound,Microsoft.ActiveDirectory.Management.Commands.NewADUser

I tried to remove the "co" attribute part from the code, and then I get this error :
A positional parameter cannot be found that accepts argument "FR"

Any ideas ?


text:
Q: How to get a specific configuration in youtube-dl? I want to make the following as my best parameter to youtube-dl to consider while downloading a media file.
/media/$ youtube-dl -c -f youtube-dl 'bestvideo[height<=720]+bestaudio/best[height<=720 VideoID

I made a config file according to https://github.com/ytdl-org/youtube-dl#configuration, but it's currently empty.
I am trying to figure out what to write in the config file.
$ cat ~/.config/youtube-dl/config
$ youtube-dl --version
2019.09.28

Using Debian testing (all updated).

A: Your ~/.config/youtube-dl/config should be:
-f bestvideo[height<=720]+bestaudio/best[height<=720]

usage: youtube-dl url
youtube-dl will download the best audio and the best audio separately then it will be merged.
You can use the -k option to keep the downloaded files (audio + video).


text:
Q: How I can access to specific item in the generic list So I would like to make windows form in c#, which will have 2 textboxes one will be username, and other will be password... Also I will have a button LogIn.
When user press button LogIn, program will read through txt file, in which I have stored few usernames, they are stored like this (username, password, accNum, accBalance), so in the case that user enter correct username and password it should display in other form accNum and accBalance.
Until now I have this
 private void btnLogIn_Click(object sender, EventArgs e)
    {
        List<User> users = new List<User>();
        User currentuser = new User();

        string str;
        string[] strarray;
        StreamReader sr = new StreamReader("path..");
        while (sr.Peek() >= 0)
        {
            str = sr.ReadLine();
            strarray = str.Split(',');
            currentuser.username = strarray[0];
            currentuser.password = strarray[1];
            currentuser.accNumber = double.Parse(strarray[2]);
            currentuser.accBalance = double.Parse(strarray[3]);
            users.Add(currentuser);
        }
    }
}
public class User
{
    public string username { get; set; }
    public string password { get; set; }
    public double accNumber { get; set; }
    public double accBalance { get; set; }
}

When I try to output my users I am getting just last user, probably it is overwriting, position 0 in List, and I don't know how to avoid that...

A: You have to create the user object which you are adding to a List<User> for each User new. If you don't create a new User object for every specified User, you are just adding a reference to the same User to List<User> which results that every change you apply to one of the User objects stored in List<User> affects all other entries of the List<> because every entry is a reference to the same User object.
In your case this means you have to create a new User object in every iteration of the while loop:
List<User> users = new List<User>();
StreamReader sr = new StreamReader("path..");

while (sr.Peek() >= 0)
{
    var str = sr.ReadLine();
    var strarray = str.Split(',');

    var currentuser = new User();  //Creating a new user for every iteration
    currentuser.username = strarray[0];
    currentuser.password = strarray[1];
    currentuser.accNumber = double.Parse(strarray[2]);
    currentuser.accBalance = double.Parse(strarray[3]);
    users.Add(currentuser);
}


text:
Q: При выполнении запроса с EXECUTE IMMEDIATE ошибка: ORA-01422: exact fetch returns more than requested number of rows declare
    res varchar2(200);
    tabnam varchar2(200) := 'DWH_gate.T$TERMINAL';
    colnum int := 3;
    colnam varchar2 (32) := 'ID_AGENT';
begin
    EXECUTE IMMEDIATE 'select '||colnam||' from DWH_gate.T$TERMINAL' into res;
    dbms_output.put_line (res);
end;

Этот запрос выдает ошибку. Я так понимаю, что ошибка в том, что выводится не одна строка, а несколько, и скорее всего нужен курсор. Но сколько не пытался, все равно ошибка появляется.
Или есть немного измененный запрос:
declare
    res varchar2(200);
    tabnam varchar2(200) := 'DWH_gate.T$TERMINAL';
    colnum int := 3;
    colnam varchar2 (32) := 'ID_AGENT';
begin
    res := 'select '||colnam||' from DWH_gate.T$TERMINAL';
    EXECUTE IMMEDIATE res;
    dbms_output.put_line (res);
end;

Но в нем выводится просто select ID_AGENT from DWH_gate.T$TERMINAL.
Как сделать, чтобы получить результат запроса?

A: Посмотрим, о чём говорится в ошибке:
declare
    res varchar2(200);
    tabnam varchar2(200) := 'hr.employees';
    colnam varchar2 (32) := 'last_name';
begin
    EXECUTE IMMEDIATE 'select '||colnam||' from '||tabnam into res;
    dbms_output.put_line (res);
end;
/
ORA-01422: exact fetch returns more than requested number of rows

"Вы хотели получить одну запись, но в результате же их много"
Или жизненый пример, нельзя посадить в машину всех 20 желаюших поехать, в ней всего пять мест. В жизни обычно это удаётся, но в примере выше - нет.
Надо предусмотреть, что записей будет много, или другими словами - поместить их в коллекцию. Например (на db<>fiddle):
declare
    type restype is table of varchar2 (64);
    res restype;
    tabnam varchar2 (64) := 'hr.employees';
    colnam varchar2 (32) := 'last_name';
begin
    EXECUTE IMMEDIATE 'select '||colnam||' from '||tabnam bulk collect into res;
    for i in 1..res.count loop
        dbms_output.put_line (res(i)); end loop;
end;
/

Abel
Ande
[...]
Zlotkey


text:
Q: Sticky footer with comment box like WhatsApp I was just wondering, can we add a sticky footer with comment box like WhatsApp on to our website. And to display the comment on the same page. Is there way to do so?
Here is my HTML code
<!DOCTYPE html>

      <link rel="stylesheet" href="main.css" type="text/css" />
    <title>ChatRoom</title>

       test

Here is the CSS of my site
    body {
    padding: 0;
    margin: 0;
    font-family: Lucida Grande, Helvetica, Arial, sans-serif;
    font-size: 12px;
}

#navigation {
  position: fixed;
  top: 0;
  width: 100%;
  color: #ffffff;
  height: 10%;
  text-align: center;
  padding-top: 15px;
  /* Adds shadow to the bottom of the bar */
  -webkit-box-shadow: 0px 0px 8px 0px #000000;
  -moz-box-shadow: 0px 0px 8px 0px #000000;
  box-shadow: 0px 0px 8px 0px #000000;
  /* Adds the transparent background */
  background-color: rgba(60, 179, 113, 1.0);
  color: rgba(60, 179, 113, 1.0);
}

#navigation a {
    font-size: 40px;
    padding-left: 15px;
    padding-right: 15px;
    color: white;
    text-decoration: none;
}

#content {
    width: 600px;
    padding-top: 70px;
    padding-bottom: 30px;
    margin-left: auto;
    margin-right: auto;
}

#content img {
    padding-top: 20px;
    padding-bottom: 30px;
}

Can anyone help me with it please?

A: Yes sure you can do that. For the sticky footer the trick is to position the footer absolute and do bottom:0 so that the footer sticks to the bottom with respect to the container. Also you would need to write some Javascript logic to manipulate the comments.
Here is a rough JSFiddle implementation for the example. If you have any questions ask. Hope this helps!

A: No, if that's all you have, there isn't a way to do so.
You need server logic to accomplish your task.


text:
Q: C File processing and matching help I have an assignment in college in which we are required to read in two .dat (aascii) files that we created with an earlier program, both of which are sorted.
One is a client account file  which contains the clients balance and account number and name, the other is a transaction file that contains the account number and the transactions for that account.
This program has to match the account numbers and create a new and updated clients file by adding the transaction amount to the balance of the client based on the accounts number.
I have this working fine except for when there is a duplicate transaction for example if the transaction file contains 2 separate transactions for the 2nd client my code will print the updated balance after both transactions instead of a cumulative balance.
I am just wondering if anyone can shed any light on how to solve this problem. My code is attached, thanks in advance.
#include <stdio.h>
#include <conio.h>
int main()
{
    int account,matches=0;     /* account number */
    char date[ 30 ]; /* account Date */
    double balance, saleamount,total=0, x;  /* account SaleAmount */
    int transaccount;
    char name [ 30 ];

    FILE *cfPtr;     /* cfPtr = clients.dat file pointer */
    FILE *ctPtr;    /* cfPtr = transaction.dat file pointer */
    FILE *cfPtr2;    /* cfPtr2 = new client file */

    cfPtr2 = fopen( "clientupdate.dat", "w" );

    /* fopen opens file; exits program if file cannot be opened */
    if ( ( cfPtr = fopen( "clients.dat", "r" ) ) == NULL ) {
        printf( "clients could not be opened\n" );
        fflush(stdin);
    } /* end if */
    else
        if( ( ctPtr = fopen( "transactions.dat", "r" ) ) == NULL)
        {
            printf( "File could not be opened\n" );
            fflush(stdin);
        }
    else { /* read account, date,name, balance and SaleAmount from files */
        fscanf( cfPtr, "%d%s%lf", &account, &name, &balance );
        fflush(stdin);

        fscanf( ctPtr, "%d%s%lf", &transaccount, &date, &saleamount );
        fflush(stdin);

        printf( "%-13s%-10s%s\n", "  Account", "Name", "Balance" );
        printf("|----------------------------------|\n");
        while( !feof(ctPtr))
        {

            while( !feof(cfPtr) &&matches==0 )
            {

                if(account == transaccount)
                {
                   matches=1;
                    total=0;
                    x = balance+saleamount;
                    total = total + x;
                    balance = total;

                printf("  %-10d%-10s%.2lf\n", account, name, total);
                }
                else
                {

                    fscanf( cfPtr, "%d%s%lf", &account, &name, &balance );
                    fflush(stdin);
                }

            }
            fprintf( cfPtr2, "%d %s %.2lf\n", account, name, total );
            fscanf( ctPtr, "%d%s%lf", &transaccount, &date, &saleamount );
            fflush(stdin);
           matches=0;

        }

        fclose( cfPtr2 );
        getch();
}

A: Although I can't believe they're actually still teaching COBOL (under the guise of C), I'll help you out, since, unlike some who seek help here, you've actually put in quite a bit of work :-)
The trick is to not print after every update but rather wait until the account number transitions, the print out the previous final details.
And, since you'll reach the end of the transaction file while processing the last account, you'll have to do that one more time after you exit the loop.
Here's the detailed steps.

Introduce three more variables, char lastname[30], int lastaccount and double lastbalance. Ensure that lastaccount is initialised to -1.
Then your code can catch the transitions of account number by simply checking the values of lastaccount and account. The storage of all three fields is to ensure that you can print out details for the previous account even though you've already read in the new account details.

Before matches = 1, insert the following code:
if (lastaccount != account) {
    if (lastaccount != -1)
        printf("  %-10d%-10s%.2lf\n", lastaccount, lastname, lastbalance);
    lastaccount = account;
    strcpy (lastname, name);
}

You'll also need to include string.h to get the prototype for strcpy.
This will catch the transitions of account number and print the details for the last one (unless the last one was account number -1 of course since that means there is no previous one). But whether it prints or not, it sets up for the next transition.

Immediately after balance = total, add lastbalance = balance;. This will maintain the most recent balance for the current account so that it can be printed on transition.
Unlike the account number and name, this has to be done for every transaction rather than every account. That's because the account/name don't change for an account but the closing balance does (for every single transaction).

Outside of the loop, immediately before fclose (cfPtr2);, put the code:
if (lastaccount != -1)
    printf("  %-10d%-10s%.2lf\n", lastaccount, lastname, lastbalance);

This prints the details for the final account, assuming that there were any processed at all. As mentioned earlier, this is needed because you'll reach the end of the file without having done a transition due to changed account number.

And, please, as a final request:

*

*get rid of conio.h and use getchar() instead of getch().

*if possible, ditch Turbo C and use gcc - it's so much better :-)

*don't fflush(stdin).

*use the canonical int main (void) ....

*return something from main (although I think that's relaxed in later versions of the standard).

I won't post my actual code (unless you guarantee it's not homework) but the following transcript shows that those changes should be enough to fix your current issues:
$ cat clients.dat
1 Pax 4.2
2 Roger 0

$ cat transactions.dat
1 1/2/3 112.3
1 2/3/4 -22.1
2 3/4/5 7

$ ./qq
  Account    Name      Balance
|----------------------------------|
  1         Pax       94.40
  2         Roger     7.00

For what it's worth, I'm not sure I quite agree with treating the tranasction file as the primary element. Since your job is to copy the account file with needed modifications (as specified in the transaction file), I'd prefer to process the account file as the primary unit.
It just seems cleaner to me that way.
And, in the interests of completeness, here's the code I came up with. I wouldn't suggest handing this in as an assignment since there are numerous things likely to get your mark reduced, things that matter a whole lot less in the real world but which educators have a particular bee in their bonnet about :-) Things like multiple return points, using #define instead of enum, and so on.
#include <stdio.h>
#include <string.h>

#define HDR_LINE 0
#define HDR_FULL 1

static void outHeader (int withHeading) {
    printf ("+-%-6s-+-%-10s-+-%-6s-+-%-6s-+-%-6s-+\n",
        "------", "----------", "------", "------", "------");
    if (withHeading)
        printf ("| %-6s | %-10s | %-6s | %-6s | %-6s |\n",
            " Acct ", "   Name   ", " Date ", "Amount", "Balnce");
}

static void closeFiles (FILE *pfCli, FILE *pfTxn, FILE *pfNew) {
    if (pfCli) fclose (pfCli);
    if (pfTxn) fclose (pfTxn);
    if (pfNew) fclose (pfNew);
}

static int openFiles (FILE **pfCli, FILE **pfTxn, FILE **pfNew) {
    *pfCli = *pfTxn = *pfNew = NULL;

    if ((*pfCli = fopen ("clients.dat", "r")) == NULL) {
        printf ("File clients.dat could not be opened\n");
        closeFiles (*pfCli, *pfTxn, *pfNew);
        return 0;
    }

    if ((*pfTxn = fopen ("transactions.dat", "r")) == NULL) {
        printf ("File transactions.dat could not be opened\n");
        closeFiles (*pfCli, *pfTxn, *pfNew);
        return 0;
    }

    if ((*pfNew = fopen ("clientupdate.dat", "w")) == NULL) {
        printf ("File clientupdate.dat could not be opened\n");
        closeFiles (*pfCli, *pfTxn, *pfNew);
        return 0;
    }

    return 1;
}

static void outCli (int acct, char *nm, double bal, char *ind) {
    if (acct == -1)
        printf ("| %6s | %-10s | %6s | %6s | %6.2lf | %s\n",
            "", nm, "", "", bal, ind);
    else
        printf ("| %6d | %-10s | %6s | %6s | %6.2lf | %s\n",
            acct, nm, "", "", bal, ind);
}

static void outTxn (char *date, double amt, double bal) {
    printf ("| %6s | %10s | %-6s | %6.2lf | %6.2lf |\n",
        "", "", date, amt, bal);
}

static void getTxn (FILE *fh, int *acct, char *date, double *amt) {
    if (feof (fh))
        *acct = -1;
    else
        fscanf (fh, "%d%s%lf\n", acct, date, amt);
}

static void getCli (FILE *fh, int *last, int *acct, char *nm, double *bal) {
    if (*last != -1)
        outCli (-1, "", *bal, "-->");
    *last = *acct;
    fscanf (fh, "%d%s%lf\n", acct, nm, bal);
}

int main (void) {
    int cli_acct, txn_acct, last_acct = -1;
    char txn_date[10], cli_nm[10];
    double cli_bal, txn_amt;
    FILE *fCli, *fTxn, *fNew;

    // Open all files, output header and load up first transaction.

    if (!openFiles (&fCli, &fTxn, &fNew))
        return 1;

    outHeader (HDR_FULL);

    getTxn (fTxn, &txn_acct, txn_date, &txn_amt);

    // Process every account.

    while (!feof (fCli)) {
        // Bring in an account and print starting balance.

        getCli (fCli, &last_acct, &cli_acct, cli_nm, &cli_bal);
        outHeader (HDR_LINE);
        outCli (cli_acct, cli_nm, cli_bal, "<--");

        // While account is not yet up to txn, output and read new.

        while (cli_acct < txn_acct) {
            fprintf (fNew, "%d %s %.2lf\n", cli_acct, cli_nm, cli_bal);
            outCli (-1, "", cli_bal, "-->");
            outHeader (HDR_LINE);
            fscanf (fCli, "%d%s%lf\n", &cli_acct, &cli_nm, &cli_bal);
            outCli (cli_acct, cli_nm, cli_bal, "<--");
        }

        // If they don't match, you have a orphan transaction.

        if ((cli_acct != txn_acct) && (txn_acct != -1)) {
            printf ("Orphan transaction for account # %d\n", txn_acct);
            closeFiles (fCli, fTxn, fNew);
            return 1;
        }

        // While account and transaction match, process transaction lines.

        while (cli_acct == txn_acct) {
            cli_bal = cli_bal + txn_amt;
            outTxn (txn_date, txn_amt, cli_bal);
            if (feof (fTxn))
                txn_acct = -1;
            else
                fscanf (fTxn, "%d%s%lf\n", &txn_acct, &txn_date, &txn_amt);
        }
        fprintf (fNew, "%d %s %.2lf\n", cli_acct, cli_nm, cli_bal);
    }

    // Output final lines if needed.

    if (last_acct != -1)
        outCli (-1, "", cli_bal, "-->");
    outHeader (HDR_LINE);

    // Close all files and exit successfully.

    closeFiles (fCli, fTxn, fNew);
    return 0;
}

Given the clients.dat of:
0 Mary 99.9
1 Pax 4.2
2 Bob 7
4 Roger 0
5 Nobody 9

and the transactions.dat of:
1 1/2/3 112.3
1 2/3/4 -22.1
4 3/4/5 7

this outputs:
+--------+------------+--------+--------+--------+
|  Acct  |    Name    |  Date  | Amount | Balnce |
+--------+------------+--------+--------+--------+
|      0 | Mary       |        |        |  99.90 | <--
|        |            |        |        |  99.90 | -->
+--------+------------+--------+--------+--------+
|      1 | Pax        |        |        |   4.20 | <--
|        |            | 1/2/3  | 112.30 | 116.50 |
|        |            | 2/3/4  | -22.10 |  94.40 |
|        |            |        |        |  94.40 | -->
+--------+------------+--------+--------+--------+
|      2 | Bob        |        |        |   7.00 | <--
|        |            |        |        |   7.00 | -->
+--------+------------+--------+--------+--------+
|      4 | Roger      |        |        |   0.00 | <--
|        |            | 3/4/5  |   7.00 |   7.00 |
|        |            |        |        |   7.00 | -->
+--------+------------+--------+--------+--------+
|      5 | Nobody     |        |        |   9.00 | <--
|        |            |        |        |   9.00 | -->
+--------+------------+--------+--------+--------+

and creates the clientupdate.dat of:
0 Mary 99.90
1 Pax 94.40
2 Bob 7.00
4 Roger 7.00
5 Nobody 9.00

Feel free to use that code for any purpose other than passing it off as your own homework.

A: Instead of outputting the results with printf right away, put the results into an array.
Once you are done with your while loops, use for loops to go through the array of stored data and look for duplicate transactions and merge them together printing out merged transactions.

A: I'm not sure the problem you've seen is related, but:

*

*fflush(stdin) gives undefined behavior -- don't do it. If you want to skip everything up to the next new-line, you can do what with scanf("%*[^\n'");

*while( !feof(ctPtr)) is almost guaranteed to cause problems -- it will generally make it it seem like the last read from the file is happening twice, duplicating the data.

The "duplicate transaction" sounds like it probably stems from the latter.

A: With help from pax and a good while playing with my own code i came up with this working solution. Thanks again for the help , Much appreciated.
#include <stdio.h>
#include <string.h>
int main(void)
{
    int account;     /* account number */
    char date[ 30 ]; /* account Date */
    double balance, saleamount; /* account SaleAmount */
    int transaccount;
    char name [ 30 ];
    int newaccount;
    char newname[ 30];
    double newbalance;
    int match=0;

    FILE *cfPtr;     /* cfPtr = clients.dat file pointer */
    FILE *ctPtr;    /* cfPtr = transaction.dat file pointer */
    FILE *cfPtr2;    /* cfPtr2 = new client file */

    cfPtr2 = fopen( "clientupdate.dat", "w" );

    /* fopen opens file; exits program if file cannot be opened */
    if ( ( cfPtr = fopen( "clients.dat", "r" ) ) == NULL ) {
        printf( "clients could not be opened\n" );

    } /* end if */
    else
        if( ( ctPtr = fopen( "transactions.dat", "r" ) ) == NULL)
        {
            printf( "File could not be opened\n" );

        }
    else { /* read account, date,name, balance and SaleAmount from files */
        fscanf( cfPtr, "%d%s%lf", &account, &name, &balance );

        fscanf( ctPtr, "%d%s%lf", &transaccount, &date, &saleamount );
        fscanf( cfPtr2, "%d%s%lf", &newaccount, &newname, &newbalance );
        while ( !feof( cfPtr ) )
        {
            transaccount=1;
            newbalance=balance;
            while ( !feof( ctPtr ) )
            {
                if(transaccount==account&&match==0)
                {
                 newbalance = balance + saleamount;
                 match++;
                }
                else
                    if(transaccount==account&&match>0)
                     newbalance = newbalance + saleamount;

                fscanf( ctPtr, "%d%s%lf", &transaccount, date, &saleamount );
            }
            rewind( ctPtr);
            match=0;

        fprintf( cfPtr2, "%d %s %.2f\n", account, name, newbalance );
        fscanf( cfPtr, "%d%s%lf", &account, name, &balance );
        }

        rewind( cfPtr2);
    }
        fclose( cfPtr2 );
        fclose( cfPtr );
        fclose( ctPtr );
        getchar();
    return 0;
}


text:
Q: Search Solr for a large number of specific documens I have read http://solr.pl/en/2011/12/19/do-i-have-to-look-for-maxbooleanclauses-when-using-filters/ and Too many boolean clauses exception in solr.
My Solr has about 2 million documents.  I can retrieve specific documents by set query or filter query to the IDs of the specific documents.  By doing this, I can find the facets and clusters among these specific documents.  The query I set is:
id:1234567 or id:1234567 or id:2345678 ...
However, when I have, say 200 specific documents, Solr complains that my query has too many boolean clauses.  Should I simply increase the maxBooleanClauses or there should be another approach for this kind of query?

A: I had the same issue of too many boolean clauses exception in solr.
You are having document ids, I had the acl ids(access control list)
Steps I have taken to overcome the issue is

*

*Increase the maxBooleanCLauses

*Used the in the filter query as &fq=acl:(id1 or id2...)

*If the count of acl is greater than 8000 then i am sending multiple request with the below logic
StringBuilder queryString = new StringBuilder(5000);
if (acls.length > 8000) {
    Integer aclCounter = 0;
    long requestCnt = Math.round(Math.ceil((acls.length / 8000.0)));
    for (int i = 0; i < requestCnt; i++) {
        queryString = new StringBuilder(acls.length * 10);
        queryString.append("&fq=acl:(");
        for (int j = 0; j < 8000 && aclCounter < acls.length; aclCounter++, j++) {
        queryString.append(acls[aclCounter]).append(APPEND_OR);
        }
         queryString.replace(queryString.length() - 4, queryString.length(), ")");
      // build the solr request and sent it to get the response
    }
}


text:
Q: pairwise relatively coprime triple Continuing my study on basic number theory and particularly the properties of pairwise relatively coprime numbers (with my interest being in gaining a basic understanding Euler's proof of $x^3+y^3=z^3$), suppose we have the following situation: (the following obviously has nothing to do with Euler's proof directly, just a problem i came up with to get a better grip on congruence and properties of pairwise coprime numbers)
Let $a,b,c$ satisfy $(a+c)^3+(b+c)^3=(a+b+c)^3$, where $a+c,b+c,a+b+c$ are pairwise relatively coprime integers. Can we conclude $(a,b)=1$?.  Or what, if anything, can we conclude about the pairwise relationship between $a,b,c$?
Consider the more general case of pairwise coprime integers $x,y,z$ satisfying $x^3+y^3=z^3$ Then suppose a prime $p$ divides $z-x$ and $z-y$.  Then $x^n\equiv z^n\,\equiv x^n+y^n\,\pmod p$ and so $y$ is divisible by p.  However if that is true and $z-y$ is divisible by p, then $z$ must also be divisible by p (since $(z,y)=1$) contradicting the original hypothesis.  Hence $(z-x,z-y)=1$.
Assuming that's correct can we simply substitute $(x,y,z)=(a+c,b+c,a+b+c)$ all pairwise coprime and conclude $(a,b)=1$?
The reason i ask is that if i use this proof directly i run into trouble with the logic.  For example the first step would involve, effectively, assuming a prime $p$ divides $a$ and $b$.  Then
$$a+c \equiv a+b+c\pmod p \,\Rightarrow  (a+c)^n\equiv (a+b+c)^n\,\equiv (a+c)^n+(b+c)^n\,\pmod p$$
and so $b+c$ is divisible by p, but how would you continue?  Unlike the previous example I can't see how to utilise the hypothesis on $a$.
I suppose we could run the argument again, focusing on $a+c$ and conclude that it too must be divisible by $p$.  Then if $a+c$ and $b+c$ are divisible by p, and $a$ and $b$ are divisible by $p$, then this contradicts $(a+c,b+c,a+b+c)=1$.  However, is this reasoning circular?

A: Let the prime $p$ divide $a$ and $b$. Then modulo $p$, $$ c^3+c^3\equiv c^3\pmod p.$$
Hence $p$ divides $c$ and then $p$ divides all of $a+c,b+c,a+b+c$, a contradiction.


text:
Q: matching criteria from my sql database So, I have a table of companies, that have a minimum criteria the customer has to meet.
for example:

*

*company 1 has a minimum electric spend of £35.

*company 2 has a minimum electric spend of £35.

*company 3 has a minimum electric spend of £45.

A customer will fill out the form, and say there electric spend is £53 is would pull all 3 companies from the database.
If a customer entered £40 it would pull companies 1 & 2 from the database.
I have a SQL query that I thought would work but didn't for obvious reasons:
SELECT * FROM `companies` WHERE `electric_spend` <= 35

But that query would only work with companies 1 & 2.
Any help would be appreciated, even a link to a website with the methods, correct operator or anything I would be over the moon.

A: I believe you will want to use the where x <= y AND z > a syntax in SQL, I believe you can also use SQL's IN command. HEre are some resources to help out.
https://www.w3schools.com/sql/default.asp
https://www.w3schools.com/sql/sql_and_or.asp
https://www.w3schools.com/sql/sql_in.asp
Side note: Whenever possible do logic in SQL statements rather than web server languages (PHP/.NET/etc). SQL is much more performant at data manipulation.

A: If I am reading this right then the answer is that the value you are testing against is incorrect.
You need to use the actual spend of the customer and not a fixed value of 35.
So your first customer would generate the query
SELECT * FROM companies WHERE electric_spend <= 53
The second customer would generate the query
SELECT * FROM companies WHERE electric_spend <= 40
So you need to build the query from the data.  To keep things safe use something like PDO to help build the query.

A: The most basic answer would be to use a query that takes a variable:
<?php

$customerSpend = 53;

$query = "SELECT * FROM `companies` WHERE `electric_spend` <= '$customerSpend'";

However that on its own isn't best practice, and a better answer would be to use something like PDO that helps insulate you against SQL injection attacks.
<?php

$customerSpend = 53;

$query = 'SELECT * FROM `companies` WHERE `electric_spend` <= :customerSpend';

$sth = $dbh->prepare($query, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));

$sth->execute(array(':customerSpend' => $customerSpend));


text:
Q: What's the benefit of OWL Import? I can use qualifiers by using a namespace, why do we need to import an ontology then? For example, if I've included a lexica from WordNet in my ontology, what benefits do I have of importing the WordNet ontology in my ontology? Does it help in querying using SPARQL? Any example?

A: By importing an ontology you gain access to its axioms, e.g. reasoning happens over the import-closure of the ontology.


text:
Q: Diferrence between running a function and call a function that return a function useEffect(() => {
    // parameter is the user state of the auth
    // onAuthStateChanged: method from auth library
    const unsubscribeFromAuth = auth.onAuthStateChanged(user => {
      setCurrentUser(user);
    })
    // returned function will be called on component unmount
    return () => unsubscribeFromAuth();
  }, []);

Can someone explain to me what is the difference between return () => unsubscribeFromAuth();
with returning unsubscribeFromAuth() directly?
Thanks

A:                         unsubscribeFromAuth():

you are simply calling the function and it will run immedietly
                   return () => unsubscribeFromAuth():

but this time you are not calling that function, rather give it to the useEffect hook as a cleanup function(according to React). and when the corresponding component unmount the cleanup function will then run to unsubscribe. without cleanup the component might not works after rerender as expected

A: When you call a function which has return like this
return () => unsubscribeFromAuth();

It is going to return a function using which you can call unsubscribeFromAuth directly
But if you call a function with this return
return unsubscribeFromAuth()

It returns the actual value by calling that function
Hope you understood


text:
Q: Can VkDeviceQueueCreateInfo::pQueuePriorities be null? From the official Vulkan Programming Guide:

The pQueuePriorities field is an optional pointer to an array of
floating point values representing the relative priority of work
submitted to each of the queues. These numbers are normalized numbers
in the range of 0.0 to 1.0. Queues with higher priority may be
allocated more processing resources or scheduled more aggressively
than queues with lower priority. Setting pQueuePriorities to nullptr
has the effect of leaving the queues at the same, default priority

However, when I enable the VK_LAYER_KHRONOS_validation layer I get the following error:

VUID-VkDeviceQueueCreateInfo-pQueuePriorities-parameter(ERROR / SPEC):
msgNum: -690544442 - Validation Error: [
VUID-VkDeviceQueueCreateInfo-pQueuePriorities-parameter ] Object 0:
VK_NULL_HANDLE, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0xd6d720c6
| vkCreateDevice: required parameter
pCreateInfo->pQueueCreateInfos[0].pQueuePriorities specified as NULL.
The Vulkan spec states: pQueuePriorities must be a valid pointer to an
array of queueCount float values
(https://vulkan.lunarg.com/doc/view/1.2.176.1/linux/1.2-extensions/vkspec.html#VUID-VkDeviceQueueCreateInfo-pQueuePriorities-parameter)

Should I consider that error as a warning? Or is the book just wrong?

A: The nice thing about the modern Vulkan validation layers is that they directly cite the validation rules they relate to. And their citations are searchable, as each validation rule has a unique name. So if you search for "VUID-VkDeviceQueueCreateInfo-pQueuePriorities-parameter" in the Vulkan specification, you'll find exactly one match:

pQueuePriorities must be a valid pointer to an array of queueCount float values

And of course, the one below that says:

queueCount must be greater than 0

So this is an error in the book. And I even checked the old Vulkan 1.0.10 specification (the oldest one I have) to make sure that yes, this parameter was always required to be provided. Maybe it was optional in pre-publication days, but I don't know of a released version where it was optional.


text:
Q: addpath and connection between matlab and C#? I have created matlab file (function) which contains save statement I have to save image histogram value(Hist)
folder_name = 'query';
addpath(folder_name);
file_name = [folder_name '\image(1)'];
 save(file_name,'Hist');

this runs perfectly using matlab with no problem the problem occurs when I run the code using C# after converting the matlab file to .dll file it cannot addpath to folder_name or find it although I have added the folder to the package of deployment tool


text:
Q: Почему не работает код в then? Делаю запрос на сервер, после получения ответа хочу вызвать свое событие change-state и передать его в родительский компонент. Но ничего не происходит.
this.axios.post('/api/v1.0/word/create/', {
  'word': this.word,
  'translate': this.translate,
  'context': this.context
})
.then((response)=>{
  console.log(response);
  this.$emit('change-state', 'default');
});

Response в консоль печатается.
Если вынести эту строчку за пределы всей функции, то она работает, но не дожидается ответа:
this.axios.post('/api/v1.0/word/create/', {
  'word': this.word,
  'translate': this.translate,
  'context': this.context
})

this.$emit('change-state', 'default');

Почему это событие не срабатывает внутри then?
UPD: Проект учебный и почти пустой, залил его на гитхаб:
https://github.com/kkomissarov/anki

A: Проблема была в том, что в момент, когда выполняется then, в this содержится несуществующий компонент. На самом деле, по моему вопросу это нельзя было понять, т.к. не приведен код компонентов.


text:
Q: Parcel middleware I'm having trouble using parcel's middleware.
It always says "No entries found"!
What am I doing wrong?
This is the code:
/* ----- Package Imports ----- */
import express from 'express';
import chalk from 'chalk';
import path from 'path';
/* ----- File Imports -----*/
import tools from './tools';

/* ----- End Imports -----*/
import Bundler from 'parcel-bundler';
const bundler = new Bundler('help.html', {});

/*<-------------- Start -------------->*/
const app = express();
app.use(bundler.middleware());

app.listen(2120, () => {
  console.log(chalk.white.bgRed('Server start...'));
  tools.loop(() => console.log(''), 2);
});


text:
Q: Force superclasses to include a no-argument constructor Regarding Spring Controllers; when a Constructor is included, a no-arg constructor must be included as well otherwise a 'NoSuchBeanDefinitionException' occurs. This message is very vague and caused me some headache.
We currently have an abstract controller class which most of our controllers extend from. It appeared that when my controller extended this class (Which has a 1 arg constructor), suddenly I received the 'NoSuchBeanDefinitionException'.
I'd like to help future developers (or even myself in the future) by forcing anyone extending the abstract controller to include a no-arg constructor. Is this possible?
Edit, adding code for clarity
Here's the class most of the controllers extend from, it includes a few helper methods:
public class AbstractController
{
     private String sessionName;
     // other attributes / final variables

     public AbstractController(String sessionName)
     {
         this.sessionName = sessionName;
     }

     public boolean isCommandInSession(HttpSession session)
     {
         return session.getAttribute(sessionName) != null;
     }

     // Other helper methods which include use of 'sessionName'
}

Example of one of many controllers, which works fine. Without the default constructor, or with only overriding the 1 arg constructor this controller will fail with 'NoSuchBeanDefinitionException'
@Controller
@SessionAttributes(SomeController.COMMAND)
@RequestMapping(SomeController.URL)
public class SomeController extends AbstractController
{
    private String command = "someUniqueSessionName";

    public SomeController()
    {
        super(COMMAND);
    }
}

A: You should refactor as below:
public class AbstractController
{
     public boolean isCommandInSession(HttpSession session)
     {
         return session.getAttribute(getSessionName()) != null;
     }

     abstract String getSessionName();
}


text:
Q: Selecting data from subdatasheet in MS Access In Access I have a table called School with a subdatasheet or inner-table, such as Teachers.
When clicking the + on Teachers I have a variety of information such as TeacherID, DateEmployed, TeacherScope, etc.
What I want to do is select, say, TeacherID and TeacherScope from within this subdatasheet. Of course if I do something like this...
SELECT Teachers.TeacherID FROM Teachers GROUP BY Teachers.TeacherID;

...it asks me to enter the parameter value of "Teachers.TeacherID".
I hope I'm making sense. This is just an example of what I'm trying to do and not the real table. I just want to be able to select data from within the subdatasheet and I have absolutely no idea how to do it.


text:
Q: Is there a way to passthru SMTP sendings to another server? we currently got a problem with our company smtp-server and our admin is currently not available. So I wanted to try to send the mails from another server. On our main server there is no connection possible due to a blacklist entry on our own system. So is there a way that I have in my script a server B that listens to this request and send this to the real smtp-server?
So that I can set my connection settings on Server A in PHPMailer to Server B and the B-Server then forwards/passes through the request to the SMTP-Server?
Does anyone knows help?
The problem ist not on Server A. A ping and telnet to all SMTP-Ports of other servers is possible. But a ping or telnet from Server B is possible.
I am thankful for any idea.
Thanks,
Robin

A: I just port-forwarded the requests from one to another server with iptables.
sysctl net.ipv4.ip_forward=1
iptables -t nat -A PREROUTING -s 1xx.xx.xx.xx -p tcp --dport 587 -j DNAT --to-destination 2xx.xx.xx.xx:587
iptables -t nat -A POSTROUTING -j MASQUERADE

Just replaced the placeholders with my two IP addresses and use the new server as relay for sending mails with smtp.
Thanks,
Robin


text:
Q: Is a regular sequence ordered? A regular sequence is an $n$-fold collection $\{r_1, \cdots, r_n\} \subset R$ of elements of a ring $R$ such that for any $2 \leq i \leq n$, $r_i$ is not a zero divisor of the quotient ring
$$ \frac R {\langle r_1, r_2, \cdots, r_{i-1} \rangle}.$$

Does the order of the $r_i$'s matter? That is, is any permutation of a regular sequence regular?

A: Not in general. A standard example is $R=k[x,y,z]$, where $k$ is a field. Then, $x,y(1-x),z(1-x)$ is regular but $y(1-x),z(1-x),x$ is not.
On the bright side, if $R$ is Noetherian, local then every permutation of a regular sequence is regular.
In fact more is true. We can extend this notion to modules over rings analogously. Then, if $M$ is a finitely generated module over a Noetherian, local ring, then every permutation of a regular sequence is regular.

A: In general, no. If $R$ is a local noetherian ring, then yes, though.
A counterexample is if $R = k[x,y,z]/(x-1)z$ over a field $k$, and the elements $x, (x-1)y$. This is a regular sequence even though $(x-1)y$ is a zerodivisor (so the swapped sequence is not regular).
It is true under local hypotheses by the Krull intersection theorem; see
http://amathew.wordpress.com/2010/10/30/the-notion-of-a-regular-sequence/

A: Here is a general result for when any permutations of elements of a regular sequence forms a regular sequence:
Let $A$ be a Noetherian ring and $M$ a finitely generated $A$-module. If $x_1,...,x_n$ be an $M$-sequence s.t. $x_i \in J(A)$ for $1 \leq i \leq n$, where $J(A)$ is the Jacobson radical of $A$, then any permutation of $x_1,...,x_n$ becomes an $M$-sequence.


text:
Q: How can I use different sets of date values depending on the date I am looking to automate a daily report for my company but I have run in to a bit of trouble. The report gets updated only on the 2nd working day of each month. I found some code on the SAS website which works out what the 2nd working day of any month is.
data scdwrk;
  /* advance date to the first day of the month using the INTNX function */
  second=intnx('month',today(),0);
  /* determine the day of the week using the WEEKDAY function */
  day=weekday(second);
  /* if day=Monday then advance by 1 */
  if day=2 then second+1;
  /* if day=Sunday then advance by 2 */
  else if day=1 then second+2;
  format second date9.;
run ;

I have also set a flag that compares todays date to the date from this generated by this piece of code.
I now need to find a way that if the code is run on the first working day of the month then it runs a particular set of macro date variables
%let start_date="&prevmnth;
%let end_date= &endprevmnth;
%let month= &prevyearmnth;

and then when its run on the 2nd working day of the month it uses the other set of macro date variables (calender month)
%let start_date="&currmnth;
%let end_date= &endcurrmnth;
%let month= &curryearmnth;

Any help on this would be greatly appreciated.

A: I have some recent code that does just this.  Here is how I tackled it.
First, create a table of holidays.  This can be maintained yearly.
Second, create a table with the first 5 days of the month that are not weekend days.
Third, delete holidays.
Finally, get the second value in the data set.
data holidays;
format holiday_date date9.;
informat holiday_date date9.;
input holiday_date;
datalines;
01JAN2015
19JAn2015
16FEB2015
03APR2015
25MAY2015
03JUL2015
07SEP2015
26NOV2015
25DEC2015
;

data _dates;
firstday = intnx('month',today(),0);
format firstday date date9.;
do date=firstday to firstday+5;
    if 1 < weekday(date) < 7 then
        output;
end;
run;

proc sql noprint;
delete from _dates
where date in (select holiday_date from holidays);

quit;

data _null_;
set _dates(firstobs=2);
call symput("secondWorkDay",put(date,date9.));
stop;
run;

%put &secondWorkDay;


text:
Q: How can a scratch org be created through the Salesforce API? I'm trying to create a developer tool that involves creating a scratch org programmatically. Is there a way to create a scratch org directly via the Salesforce API without using the sfdx CLI tool?
If so, which endpoint(s) can be used to create a scratch org?
Is the API that the sfdx CLI tool uses publicly accessible/documented?

A: You can use the ScratchOrgInfo object in the SOAP API to create and delete Scratch Orgs. This means you'll need a WSDL and some language that supports SOAP in order to do this.

A: The source code for sfdx is available via GitHub. Take a look there to see how it functions. No guarantee you'll find everything you need, but it's a good starting point.
Note that this was announced by Salesforce earlier this year.


text:
Q: Is the pushforward of the dualizing sheaf of a stable curve locally free? Let $f : C\rightarrow S$ be a proper flat morphism whose geometric fibers are stable curves in the sense of Deligne-Mumford.
Let $\omega_{C/S}$ be its dualizing sheaf. Must $f_*\omega_{C/S}$ be locally free?
I'm happy to assume that $S$ is connected and locally noetherian, but I don't want to make any other assumptions.

A: Yes, it is locally free of rank $g$ and it is called the Hodge bundle. The way to prove this is by combining duality with "cohomology and base change". The latter tells you that given a proper flat family $f:X\to S$ and an $S$-flat coherent sheaf $F$ on $X$, if
$$
b^p_s(F):R^pf_\ast F\otimes_{\mathscr O_S}k(s)\to H^p(X_s,F_s)
$$
are isomorphisms for $p=i$ and $p=i+1$ (and all $s\in S$), then $R^{i+1}f_\ast F$ is locally free.
We need to apply this to our family of stable curves $f:C\to S$ with $F=\omega=\omega_{C/S}$ and $i=-1$. Cohomology and base change certainly commute for $i=-1$, that is, the maps $b^{-1}(\omega)$ are trivially isomorphisms. The maps $b^0(\omega)$ are also isomorphisms by the duality isomorphism $R^1f_\ast \omega_{C/S}\cong \mathscr O_S$. Indeed, by cohomology and base change again, if $R^{p+1}f_\ast F$ is locally free around $s\in S$, then $b^p_s(F)$ is an isomorphism.


text:
Q: AirPods Pro show as connected on iPhone, but don't appear as Speaker On my iPhone 11, my AirPods Pro show as connected in the Bluetooth settings, but are not available as an option as an external speaker.
One of or a combination of the following will eventually work, but never consistently:

*

*Resetting my AirPods: https://support.apple.com/en-gb/HT209463

*Forgetting and reconnecting my AirPods.

*Threatening to reboot my iPhone (ie. Press lock and volume, and reaching the screen where you can swipe to reboot)

*Actually rebooting my iPhone

Both my iPhone's OS and the AirPods firmware are up to date.
Does anyone know what the root cause might be, or a consistent way to resolve it?
Any help would be really appreciated.


text:
Q: How to use multiple conditions in IIF expressions in ssrs to return a value I am a beginner in SSRS and maybe this may sound easy, I have a dataset like below.

What I want to achieve is:

For column region and country I used a Row Groups. For column New lead I used this expression =IIF(Fields!TextA.Value=Fields!TextB.Value AND Fields!Subject.Value = "New Lead" AND NOT(Fields!Category.Value = "Closed"), Fields!Total.Value + 1, nothing) to get Total value for each Subject and just change the harcoded value for Fields!Subject.Value for Column Contract, Qualify but the value is not populated. I Checked there is no typo for hardcoded value. I can achieved this by using matrix but the columns arrangement for new Lead, Contract and Qualify is not like I wanted.

A: It sounds like you're thinking programmatically and adding the total one by one.
Fields!Total.Value + 1

You want to SUM the Totals if it matches the given Subject (and A = B and Not Closed).
=SUM(
    IIF(Fields!TextA.Value = Fields!TextB.Value AND Fields!Subject.Value = "New Lead" AND NOT(Fields!Category.Value = "Closed")
        , Fields!Total.Value, 0))

Are TextA and TextB always the same? If so, you can remove that part.
You're probably also going to need to Group By your Area to make it look like your mock-up - otherwise Thailand would sum up Bangkok and Phuket.


text:
Q: SQLite command gives different output on Python than DB Browser I entered the code in the triple quotation marks below into the DB Browser, SQL Executor, and it output the values which I desired. When I used the python code, which is what the below is, all the values within the database table are output. What have I done wrong? In order to use SQLites Y-m-d format I've already had to change every date input and output.
SQL = ("""SELECT *
       FROM Vat
       WHERE %s >= DateTimeSet""")%(self.Date)
       Cursor = self.Connection.cursor()
       for row in Cursor.execute(SQL):
          print(row)