text:
Q: Theorem Poincare-Bendixson In the proof of the following theorem it is not clear to me how the Poincare-Bendixson theorem is applied.
Theorem. If $X=\left ( X_{1},X_{2} \right )$ is a class field $C^{1}$ in $\Delta \subset \mathbb{R}^{2}$, $\Delta $ simply connected set with  $divX=\frac{\partial X_{1}}
{\partial x_{1}}+\frac{\partial X_{2}}{\partial x_{2}}\neq 0$,
for all points of $\Delta$, then $X$ does not have periodic orbits in $\Delta$.
Exercise. Show that
$\begin{matrix}
\, \, \, {x}'=2x-x^{5}-y^{4}x\\ {y}'=y-y^{3}-yx^{2}
\end{matrix}$.
it does not have periodic orbits.
Doing $X_{1}=2x-x^{5}-y^{4}x$ and $X_{2}=y-y^{3}-yx^{2}$ and applying the previous theorem to the following exercise to show that it does not have periodic orbits, I get $divX=3-5x^{4}-y^{4}-3y^{2}-x^{2}$ it seems to me that for very small $x$ and $y$ values it is not necessarily less than zero. Unless I was wrong in calculating the divergence.
Is there another way than Bendixson's criterion to solve this exercise?
Thanks for your help.


text:
Q: How to put static and dynamic number in numberOfSectionsInCollectionView and numberOfItemsInSection? I have UICollectionView and I would like to put a another Header as sample below (dark blue color).
In numberOfSectionsInCollectionView, I able to get the dynamic header 1 & 2 and CollectionView Cell if I use distinctNames.count. and return [groups[section][@"infos"] count]; in numberOfItemsInSection.
My question is, how can I add in extra header (something like static header as below) / cell in numberOfSectionsInCollectionView / numberOfItemsInSection if I have another section and cell to add in?
Can I use return distinctNames.count + 1; for additional header? And how can I set in numberOfSectionsInCollectionView?
Please help. Thank you.
- (NSInteger) numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
    return distinctNames.count + 1;
}

- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {

    if (section == 0) {
        return 1;
    }
    }
return [groups[section][@"infos"] count];
}

redpajama_set_name: RedPajamaStackExchange


text:
Q: Display post content from wp_nav_menu? I have made a wp menu that lists a bunch of posts.
I am able to list these posts' titles but not its content.
wp_nav_menu(array( 'menu' => 'Compatibility Matrix') );
How do i display the contents of each item (post title) ?

A: You can't list the post's content with the wp_nav_menu function, that is solely used to create a navigation menu with the post/page titles or custom title that you assign the menu item.
You need to use a loop to display the content.  This is a very basic loop:
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>

    <?php the_content(); ?>

<?php endwhile; ?>
<?php endif; ?>

You can modify it to suit your needs.  Here are a couple resources to help you out:
http://codex.wordpress.org/The_Loop
http://wp.tutsplus.com/tutorials/theme-development/a-beginners-guide-to-the-wordpress-loop/


text:
Q: A clean interface for hooking into sectioning commands Is there an easy way to hook LaTeX's sectioning commands, short of the good ol' \let + \def (or, with xparse, \let + \RenewDocumentCommand{s O{} m})? I'm looking for something in the spirit of everypage, everyshi and the like.
The titlesec package offers a hook but the section name does not seem to be available there. I want to perform custom actions for every section, i.e. for each instance of \chapter{...}, \section{...}, \subsection{...} etc..
Currently I have a \let + \RenewDocumment command to insert an invisible fixme note after each section.
MWE
\documentclass{article}
\pagestyle{empty}
\usepackage{xparse}
\usepackage[inline,draft,nomargin]{fixme}
\fxusetheme{color}

\makeatletter
\let\kmue@section=\section
\RenewDocumentCommand\section{ s O{} m}{%
  \IfBooleanTF{#1}{%
    \kmue@section*{#3}%
  }{%
    \kmue@section{#3}%
    \fxnote[noinline]{{\color{black}#3}}%
  }
}
\makeatother

\begin{document}
  \listoffixmes
  \section{A}
  \fxwarning{First warning}
  \section{B}
  \fxerror{Second error}
\end{document}

(I'm aware that the code is broken as it doesn't respect the second argument.)

Question
Is there something more like
\everychapter[starred=false]{\fxnote{...}}

instead of a home-grown redefinition? The \fxnote command should be able to access the section title.

A: You can rely on the LaTeX definitions contained within \section to distinguish between the optional argument and/or whether you used a starred version. From my point of view, you should tap into \@sect (non-starred) or \@ssect (starred):

\documentclass{article}
\pagestyle{empty}
\usepackage{etoolbox}
\usepackage[inline,draft,nomargin]{fixme}
\fxusetheme{color}

\makeatletter

% Somewhat like \everysection[starred=false]{\fxnote{...}}
% \@sect#1#2#3#4#5#6[#7]#8
\patchcmd{\@sect}% <cmd>
  {\@xsect}% <search>
  {\fxnote[noinline]{{\color{black}#7}}%
   \@xsect}% <replace>
  {}{}% <success><failure>

% Somewhat like \everysection[starred=true]{\fxnote{...}}
% \@ssect#1#2#3#4#5
\patchcmd{\@ssect}% <cmd>
  {\@xsect}% <search>
  {\fxnote[noinline]{{\color{black}#5}}%
   \@xsect}% <replace>
  {}{}% <success><failure>

\makeatother

\begin{document}
\listoffixmes
\section{A}
\fxwarning{First warning}
\section*{B}
\fxerror{Second error}
\end{document}

Argument #7 is the optional title for \section, while #8 is the mandatory title. Argument #5 for \section* points to the mandatory title.
However, this is no cleaner than redefining \section to suit your needs, in my opinion.


text:
Q: Expected_Conditions returns TimeoutException while using element_to_be_clickable method through selenium & python 3 I am trying to automate using selenium and python 3 , below is my code what I have tried :
element = WebDriverWait(driver, 10).until(
EC.element_to_be_clickable((By.XPATH, '//*[@id="download"]/span'))
)
element.click()

HTML :

        Download To Excel

I want to click on "Download To Excel button" but everytime I execute the code whether I search it by xpath or class it doesn't executes and gives timeout error when I increase timeout it doesn't helps or I use Driver.waitthat also doesn't helps.
stacktrace :
EC.element_to_be_clickable((By.XPATH, '//*[@id="download"]/span'))
  File "c:\program files (x86)\python36-32\lib\site-packages\selenium\webdriver\support\wait.py", line 80, in until
    raise TimeoutException(message, screen, stacktrace)
  selenium.common.exceptions.TimeoutException: Message

What am I missing here ?
EDIT 2 :
time.sleep(5)
if driver.find_element_by_id('download'):
    print ("Element exists")
time.sleep(5)
if driver.find_element_by_xpath((("//a[@class='urBtnStd1 urV' and @id='download' and @title='Download To Excel']/span[@class='urBtnPadding']"))):
    print ("Element exists1")

Stacktrace of edit 2 :
Element exists
Traceback (most recent call last):
  File "C:\Users\c5242046\Desktop\test2\backupautomation\bkpalertv1\bkpv1.py", line 73, in <module>
    if driver.find_element_by_xpath((("//a[@class='urBtnStd1 urV' and @id='download' and @title='Download To Excel']/span[@class='urBtnPadding']"))):
  File "c:\program files (x86)\python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 385, in find_element_by_xpath
    return self.find_element(by=By.XPATH, value=xpath)
  File "c:\program files (x86)\python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 955, in find_element
    'value': value})['value']
  File "c:\program files (x86)\python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 312, in execute
    self.error_handler.check_response(response)
  File "c:\program files (x86)\python36-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: Unable to find element with xpath == //a[@class='urBtnStd1 urV' and @id='download' and @title='Download To Excel']/span[@class='urBtnPadding']

A: To click on the element with text as Download To Excel you have to induce WebDriverWait  and can use either of the following options :

*

*CSS_SELECTOR :
WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "a.urBtnStd1.urV#download[title='Download To Excel']>span.urBtnPadding"))).click()

*XPATH :
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, "//a[@class='urBtnStd1 urV' and @id='download' and @title='Download To Excel']/span[@class='urBtnPadding']"))).click()


text:
Q: Google PHP Client API: Insufficient Permission I have PHP code that use Google PHP Client API to use Drive service.
<?php
require_once 'Google/Client.php';
require_once 'Google/Service/Drive.php';

const CLIENT_ID = '[MYCLIENTID]';
const SERVICE_ACCOUNT_NAME = '[MYSERVICEACCOUNID]';

// Make sure you keep your key.p12 file in a secure location, and isn't
// readable by others.
const KEY_FILE = './[MYPRIVATEKEY].p12';

// Load the key in PKCS 12 format (you need to download this from the
// Google API Console when the service account was created.
$client = new Google_Client();
$client->setApplicationName("Google Drive Sample");

$key = file_get_contents(KEY_FILE);
$client->setClientId(CLIENT_ID);
$client->setAssertionCredentials(new Google_Auth_AssertionCredentials(
  SERVICE_ACCOUNT_NAME,
  array('https://www.googleapis.com/auth/drive'),
  $key)
);

$client->setClientId(CLIENT_ID);

if ($client->getAuth()->isAccessTokenExpired()) {
  $client->getAuth()->refreshTokenWithAssertion();
}

// Get the json encoded access token.
$token = $client->getAccessToken();

echo "<pre>";
$service = new Google_Service_Drive($client);
$service->apps->listApps();
echo "</pre>";
?>

I had CLIENT_ID, SERVICE_ACCOUNT_NAME and KEY_FILE correctly installed. When I run the code I get the following error messages:
Fatal error:  Uncaught exception 'Google_Service_Exception' with message 'Error calling GET https://www.googleapis.com/drive/v2/apps: (403) Insufficient Permission' in C:\xampp\htdocs\oauth\Google\Http\REST.php:79
Stack trace:
#0 C:\xampp\htdocs\oauth\Google\Http\REST.php(44): Google_Http_REST::decodeHttpResponse(Object(Google_Http_Request))
#1 C:\xampp\htdocs\oauth\Google\Client.php(499): Google_Http_REST::execute(Object(Google_Client), Object(Google_Http_Request))
#2 C:\xampp\htdocs\oauth\Google\Service\Resource.php(195): Google_Client->execute(Object(Google_Http_Request))
#3 C:\xampp\htdocs\oauth\Google\Service\Drive.php(1281): Google_Service_Resource->call('list', Array, 'Google_Service_...')
#4 C:\xampp\htdocs\oauth\drive_client.php(41): Google_Service_Drive_Apps_Resource->listApps()
#5 {main}
  thrown in C:\xampp\htdocs\oauth\Google\Http\REST.php on line 79

What may be wrong with the code?

A: The apps#list method requires authorization with the scope https://www.googleapis.com/auth/drive.apps.readonly. Just add it to the array of scopes:
$client->setAssertionCredentials(new Google_Auth_AssertionCredentials(
  SERVICE_ACCOUNT_NAME,
  array('https://www.googleapis.com/auth/drive', 'https://www.googleapis.com/auth/drive.apps.readonly'),
  $key)
);

A: You must even disable Google drive api for your project in Developer Console under Apis & auth


text:
Q: SQL Server datecolumn NOT greater than another date column I have this statement in T-SQL
[dateReturned] [DATE] NULL
   CONSTRAINT [Date_Returned] CHECK (dateReturned >= dateRented),

but when I execute the whole query I am getting this error.

Msg 8141, Level 16, State 0, Line 17
  Column CHECK constraint for column 'dateReturned' references another column, table 'Rental'.
  Msg 1750, Level 16, State 0, Line 17
  Could not create constraint. See previous errors.

What is wrong with the statement?

A: Multi-column CHECK constraints must be defined at the table level. Constraints defined at the column level can't reference other columns
From the documentation :

You can apply multiple CHECK constraints to a single column.
You can also apply a single CHECK constraint to multiple columns by creating it at the table level.

Taken from another MSDN page:
ALTER TABLE dbo.Vendors ADD CONSTRAINT CK_Vendor_CreditRating
CHECK (CreditRating >= 1 AND CreditRating <= 5)


text:
Q: Custom ftp authentication not called for every login I have added File.appendtext logger in ftp authentication DLL.but I observed that it doesnot log for every ftp loggin.
At first login it writes in log-file but next login it doesn't write in log-file.if I enter wrong password next time then it writes in log-file.
Is there session maintained for successful login?
what is the best approach for audit logger inside ftp DLL?

A: Execute following command to disable caching of FTP server.
Appcmd.exe set config -section:system.ftpServer/caching/credentialsCache.enabled:"False" /commit:apphost
This command will make entry in applicationHost file which is located at "C:\Windows\System32\inetsrv\config\ applicationHost"


text:
Q: Swagger Looks Empty Magento 2.4.2 I had updated the Magento 2.3.5 to Magento 2.4.2 the my Swagger is not working i shows the Empty page. The console shows some error and there is a syntax error in swagger like it is showing but i had checked the code is proper in file Can anyone suggest why it is happening.

I had found this if enable these below options the swagger is not working.

A: I was with the same issue.
This occurs by a conflict between the javascript files the theme and the files from swagger when it are merged.
To resolve this, you should go to: Stores > Settings > Configuration > Advanced > Developer
In JavaScript Settings change Merge JavaScript Files from Yes to No.
I hope that it help you.

A: You need to pass admin token in the api_key field.

Generate admin token

POST : http://localurl/rest/V1/integration/admin/token?username=admin_user&password=admin_pass
Now add this token in api_key filed in upper right corder and apply. Check now. If still the page shown as blank then refresh the page.
Check this for more details. Thanks!


text:
Q: How to make a word processor in Arduino (C/C++) where the text is coming character by character? I'm using the Adafruit_ST7735 (with the Adafruit_GFX) library to display stuff on my 1.8 TFT display. When I set the tft.setTextWrap(false); it does wrap the text but it doesn't care about words. For example, it wraps it like this:

I like to play basketball and I really like to play computer games

And I need to make it look like this:

I like to play bask-etball and I reallylike to play comp-uter games

Short words put on the next line but longer words split into two lines connected with a - would allow me to display much more text than putting each word on a new line. My main struggle with this is that the characters are coming one by one in an SD manner like this:
File myFile = SD.open(file_name);
if (myFile) {
  while (myFile.available() > myFile.size() - 300) {
    tft.write(myFile.read());
  }
  myFile.close();
} else {
  tft.print("Error opening file.");
}

How would I go about writing such a word processor for the incoming characters so short words (i.e containing less or equal to 5 characters) get transferred on the next line and longer words (i.e containing more than 5 characters) get cut with a - and one part is on one line and the other is on the next line (like the last example)?

A: This problem is called hyphenation and it is not trivial. Text editors like MS Word also have this feature, see https://practicaltypography.com/hyphenation.html
There exist algorithms for hyphenation (https://en.wikipedia.org/wiki/Hyphenation_algorithm), e.g. Knuth-Liang algorithm, Donald Knuth wrote the famous TeX (https://en.wikipedia.org/wiki/TeX)
Hyphenation in c#
Best word wrap algorithm?
There is libraries in C like https://github.com/hunspell/hyphen that are also very complex. Possibly search the net with search word 'hyphenation' if you find an easier solution. The problem in general is complex (syllable detection,...)
i think the easiest solution is to skip hyphenation completely and use whitespaces to separate the words (in a sentence between any words are whitespaces...)

A: You would change
tft.write(myFile.read());

to read into a intermediate string, where you do the hyphenation.
If the memory on your Arduino is not enough for a full hyphenation libary

*

*Depending on where the text is coming from, and if it is always shown in the same columnns you could do the hyphenation manually in the text file (and fill the lines with spaces) or

*you could half-automatically mark all positions beforehand, where hyphenation is possible. An algorithm just deletes these markers in the intermediate string or replaces them with newlines

*there are abridged hyphenation libraries that find not all hyphenation positions, but are much better than no hyphenation

A: The simplest hyphenation algorithm (assuming school English) is to break a word at the last consonant* which will fit on the line. But that requires multiple steps:

*

*Put letters on line one word (between punctuation*) at a time

*Detect character limit of line

*Step backwards to either a consonant or punctuation.

I have denoted lists with asterisks* above.
Punctuation: space, hyphen, apostrophe, quote (can you escape quotes cleanly?), general punctuation
Consonant: easily listed
The quick br-
own fox jump-
ed over the sl-
ow lazy dog.
Four sco-
re and s-
even y-
ears ago
our for-
efathers
set
forth on
this new
contin-
ent


text:
Q: Hyper V Windows 8.1 Pro won't work. Virtualisation is enabled in BIOS I bought Windows 8.1 pro so I could use the Hyper-V Virtualisation.
I have the correct Hardware

 - Intel(R) Core(TM) i5-4200M CPU @ 2.5GHZ
 - Toshiba C55-A-1N1.

In TaskManager->Performance it says
Virtualisation:       Disabled
Hyper-V support:      Yes

In Turn Windows features on or off Window for Hyper-V it says
Hyper-V                                - ticked with a square tick(Partial tick)
    Hyper-V Management Tools           - ticked
         Hyper-V GUI Management Tools  - ticked
         Hyper-V Module for Windows PowerShell
                                       - ticked.
    Hyper-V Platform                   - not able to tick (greyed out)

Hyper-V manager opens but I cannot create a Virtual Machine.

The laptop manufacture Toshiba have assured me that the laptop has the
capability and it is a Microsoft problem.
I spent 4+ hours getting bounced around Microsoft tele-operators/technicians
repeating the same problem to each. I am now waiting on a call back I was
promised two days ago. I am starting to think there is a known problem that
no-body want to admit.

So the question is.
1. Does anyone know how to fix this? or
2. Is anyone aware of a bug in Windows 8.1 Pro resulting in Hyper-V not working?

********************************************************************
Continuation after Answer from varun_mc
********************************************************************

This is the message I get from hovering over the greyed out checkbox Hyper-V Platform in Windows  Features.
"Hyper-V cannot be installed: Virtuallisation support is disabled in the firmware."

This could mean Toshiba has turned it off for security or something.
The output from coreinfo does not mention EPT, see below.
**********************************************************************
Intel(R) Core(TM) i5-4200M CPU @ 2.50GHz
Intel64 Family 6 Model 60 Stepping 3, GenuineIntel
Microcode signature: 00000016
HTT         *   Hyperthreading enabled
HYPERVISOR  -   Hypervisor is present
VMX         *   Supports Intel hardware-assisted virtualization
SVM         -   Supports AMD hardware-assisted virtualization
X64         *   Supports 64-bit mode

SMX         -   Supports Intel trusted execution
SKINIT      -   Supports AMD SKINIT

NX          *   Supports no-execute page protection
SMEP        *   Supports Supervisor Mode Execution Prevention
SMAP        -   Supports Supervisor Mode Access Prevention
PAGE1GB     *   Supports 1 GB large pages
PAE         *   Supports > 32-bit physical addresses
PAT         *   Supports Page Attribute Table
PSE         *   Supports 4 MB pages
PSE36       *   Supports > 32-bit address 4 MB pages
PGE         *   Supports global bit in page tables
SS          *   Supports bus snooping for cache operations
VME         *   Supports Virtual-8086 mode
RDWRFSGSBASE    *   Supports direct GS/FS base access

FPU         *   Implements i387 floating point instructions
MMX         *   Supports MMX instruction set
MMXEXT      -   Implements AMD MMX extensions
3DNOW       -   Supports 3DNow! instructions
3DNOWEXT    -   Supports 3DNow! extension instructions
SSE         *   Supports Streaming SIMD Extensions
SSE2        *   Supports Streaming SIMD Extensions 2
SSE3        *   Supports Streaming SIMD Extensions 3
SSSE3       *   Supports Supplemental SIMD Extensions 3
SSE4a       -   Supports Streaming SIMDR Extensions 4a
SSE4.1      *   Supports Streaming SIMD Extensions 4.1
SSE4.2      *   Supports Streaming SIMD Extensions 4.2

AES         *   Supports AES extensions
AVX         *   Supports AVX intruction extensions
FMA         *   Supports FMA extensions using YMM state
MSR         *   Implements RDMSR/WRMSR instructions
MTRR        *   Supports Memory Type Range Registers
XSAVE       *   Supports XSAVE/XRSTOR instructions
OSXSAVE     *   Supports XSETBV/XGETBV instructions
RDRAND      *   Supports RDRAND instruction
RDSEED      -   Supports RDSEED instruction

CMOV        *   Supports CMOVcc instruction
CLFSH       *   Supports CLFLUSH instruction
CX8         *   Supports compare and exchange 8-byte instructions
CX16        *   Supports CMPXCHG16B instruction
BMI1        *   Supports bit manipulation extensions 1
BMI2        *   Supports bit manipulation extensions 2
ADX         -   Supports ADCX/ADOX instructions
DCA         -   Supports prefetch from memory-mapped device
F16C        *   Supports half-precision instruction
FXSR        *   Supports FXSAVE/FXSTOR instructions
FFXSR       -   Supports optimized FXSAVE/FSRSTOR instruction
MONITOR     *   Supports MONITOR and MWAIT instructions
MOVBE       *   Supports MOVBE instruction
ERMSB       *   Supports Enhanced REP MOVSB/STOSB
PCLMULDQ    *   Supports PCLMULDQ instruction
POPCNT      *   Supports POPCNT instruction
LZCNT       *   Supports LZCNT instruction
SEP         *   Supports fast system call instructions
LAHF-SAHF   *   Supports LAHF/SAHF instructions in 64-bit mode
HLE         -   Supports Hardware Lock Elision instructions
RTM         -   Supports Restricted Transactional Memory instructions

DE          *   Supports I/O breakpoints including CR4.DE
DTES64      *   Can write history of 64-bit branch addresses
DS          *   Implements memory-resident debug buffer
DS-CPL      *   Supports Debug Store feature with CPL
PCID        *   Supports PCIDs and settable CR4.PCIDE
INVPCID     *   Supports INVPCID instruction
PDCM        *   Supports Performance Capabilities MSR
RDTSCP      *   Supports RDTSCP instruction
TSC         *   Supports RDTSC instruction
TSC-DEADLINE    *   Local APIC supports one-shot deadline timer
TSC-INVARIANT   *   TSC runs at constant rate
xTPR        *   Supports disabling task priority messages

EIST        *   Supports Enhanced Intel Speedstep
ACPI        *   Implements MSR for power management
TM          *   Implements thermal monitor circuitry
TM2         *   Implements Thermal Monitor 2 control
APIC        *   Implements software-accessible local APIC
x2APIC      -   Supports x2APIC

CNXT-ID     -   L1 data cache mode adaptive or BIOS

MCE         *   Supports Machine Check, INT18 and CR4.MCE
MCA         *   Implements Machine Check Architecture
PBE         *   Supports use of FERR#/PBE# pin

PSN         -   Implements 96-bit processor serial number

PREFETCHW   *   Supports PREFETCHW instruction

Maximum implemented CPUID leaves: 0000000D (Basic), 80000008 (Extended).

Logical to Physical Processor Map:
**--  Physical Processor 0 (Hyperthreaded)
--**  Physical Processor 1 (Hyperthreaded)

Logical Processor to Socket Map:
****  Socket 0

Logical Processor to NUMA Node Map:
****  NUMA Node 0

No NUMA nodes.

Logical Processor to Cache Map:
**--  Data Cache          0, Level 1,   32 KB, Assoc   8, LineSize  64
**--  Instruction Cache   0, Level 1,   32 KB, Assoc   8, LineSize  64
**--  Unified Cache       0, Level 2,  256 KB, Assoc   8, LineSize  64
****  Unified Cache       1, Level 3,    3 MB, Assoc  12, LineSize  64
--**  Data Cache          1, Level 1,   32 KB, Assoc   8, LineSize  64
--**  Instruction Cache   1, Level 1,   32 KB, Assoc   8, LineSize  64
--**  Unified Cache       2, Level 2,  256 KB, Assoc   8, LineSize  64

Logical Processor to Group Map:
****  Group

****************************************************************************

The intel product description as described on their website
(http://ark.intel.com/products/76348/Intel-Core-i5-4200M-Processor-3M-Cache-up-to-3_10-GHz)
states that ETP is part of the package. See the relevant section below.

Advanced Technologies
Intel® Turbo Boost Technology ‡ 2.0
Intel® vPro Technology ‡    No
Intel® Hyper-Threading Technology ‡     Yes
Intel® Virtualization Technology (VT-x) ‡   Yes
Intel® Virtualization Technology for Directed I/O (VT-d) ‡  No
Intel® VT-x with Extended Page Tables (EPT) ‡   Yes
Intel® TSX-NI   Yes
Intel® 64 ‡     Yes
Enhanced Intel SpeedStep® Technology    Yes
Thermal Monitoring Technologies Yes
Intel® Identity Protection Technology ‡ Yes
Intel® VT-x with Extended Page Tables (EPT) ‡   Yes

I guess from now on I will be wanting to see something working before I pay.
Pretty hard when you are buying over the internet.

A: Hovering over the disabled "Hyper-V Platform" option should give you a hint on why it is disabled:

Here are few things I would check:

*

*Make sure that the Hardware-assisted virtualization is enabled in the BIOS.

*Make sure Data Execution Prevention (DEP) is enabled in BIOS.

*Make sure your processor is 64 bit and has Second Level Address Translation (SLAT) capabilities. And then confirm SLAT is enabled in BIOS.

You can use Sysinternal's CoreInfo.exe to determine if your machine supports Virtualization and SLAT. Tool can be downloaded from Microsoft Technet site: http://download.sysinternals.com/files/Coreinfo.zip
Run "CoreInfo.exe -v" from elevated command prompt.
Coreinfo v3.31 - Dump information on system CPU and memory topology
Copyright (C) 2008-2014 Mark Russinovich
Sysinternals - www.sysinternals.com

Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHz
Intel64 Family 6 Model 62 Stepping 4, GenuineIntel
Microcode signature: *******

HYPERVISOR      -       Hypervisor is present
VMX             *       Supports Intel hardware-assisted virtualization
EPT             *       Supports Intel extended page tables (SLAT)

If you see "-" here, it means your processor does NOT support SLAT; if it is a "*", then it supports SLAT. You should ideally see the output as above before enabling Hyper-V.
Here is a more detailed MSDN article:
http://msdn.microsoft.com/en-us/library/windows/apps/jj863509(v=vs.105).aspx


text:
Q: How to build a microservice with scheduler and his be scalable? I'm building a microservice that integrates data from a SOAP webservice. For this I am using a scheduler that once per day searches for new data and writes to my mongodb database. Since the standard of microservice's is to have one database per service, and my service integrates data and serves that data for another service, how am I going to scale a microservice with these two things together? I will have problem integrating the data, such as duplicated data, so I thought of two solutions:
1 - Divide my microservice in two: one will be responsible for integrating data with webservice SOAP and another will be responsible for serving this data, so I can scale this service. The problem is that it escapes the concept of microservice: a one database for service.
2 - Keep a single microservice and to solve the problem of scalability I could create a parameter to tell the other microservices not to run the scheduler, leaving only a microservice responsible for integrating the data. However, I do not know if this works and it seems to me a bad solution.
What is the best solution? Is there another alternative?


text:
Q: Are the coordinate functions of a Hamel basis for an infinite dimensional Banach space discontinuous? The question is in the title really, but I suppose I could at least fix some notation here.
Let $X$ be an infinite dimensional Banach space - over the reals for the sake of concreteness. Use choice to produce a Hamel basis $(x_i)_{i \in I}$ for $X$. I have the impression that this basis should necessarily interact badly with the topology and, therefore, not be of much (any?) use for doing analysis on $X$, but I've never really thought about why this should be the case.
Is there a rigorous sense in which we can say that this basis is "useless"?
One way to make this precise (although I'd be interested in other points of view) might be to consider the corresponding linear functionals $(f_i)_{i \in I}$ - uniquely determined by taking $f_i(x_j)$ equal to $1$ or $0$ according as $i=j$ or not. I would be very surprised if it were possible for any of these functionals to be continuous, but this conviction is based only on my vague notion that a Hamel basis for $X$ must be somehow "pathological" and not on any sound reasoning.
Because I have no idea how to approach this question (admittedly also because I don't think this is a particularly constructive thing to be dwelling on at this time of year...) I thought I would appeal to the hard-earned wisdom of the good people of Mathematics Stack Exchange.
Edit for clarity: I actually already know at most finitely many of the coordinate functions can be continuous (see comment below) which is, now that I think about it, a fairly critical failure in and of itself and probably enough to justify the word "useless" above. My question is whether they must all be discontinuous.

A: Your impression is right. Hamel bases and topology interact badly in infinite-dimensional spaces. An easy example would be the space of real polynomial functions in one variable over the interval $[0, 1]$ equipped with norm
$$\lVert p \rVert = \int_0^1\lvert p(x)\rvert\, dx.$$
Then clearly $\{1, x, x^2, \ldots\}$ is a Hamel basis. We then have a family of linear functionals
$$P_j(a_0+a_1x+\ldots+a_nx^n)=\begin{cases} a_j & j \le n \\ 0 & \text{otherwise}\end{cases}$$
which we may call projectors but only in the algebraic sense. In fact they are not continuous.
Take $(x-1)^n$. Then
$$\int_0^1 \left\lvert (x-1)^n \right\rvert\, dx = \frac{(-1)^{n+1}}{n+1}\to 0,$$
but $P_0\big( (x-1)^n \big)=(-1)^n$, that is, $P_0$ maps a convergent sequence into a non-regular one. We can find similar examples for the other $P_j$.

Of course the previous space was not complete. This is in the nature of things: a consequence of Baire cathegory theorem is that a Hamel basis in a Banach space is necessarily uncountable and thus it needs be an object much more complicated. There is something we can say in this case too, though. In fact, I recall having seen this as an exercise somewhere:
Exercise Let $(V, \lVert \cdot \rVert)$ be a normed space and $H\subset V$ an algebraic basis. Then for all $x \in V$ we have
$$x=P_{h_1}(x)h_1 + \ldots P_{h_k}(x)h_k$$
for uniquely determined $h_1 \ldots h_k \in H$. The mappings $P_h$ thus defined are linear. Call $\tau$ the coarsest topology on $V$ s.t. those mappings are all continuous. Then the following are equivalent:

*

*$\tau$ coincides with the norm topology;

*$H$ is finite.

EDIT
Here's a proof for $1 \Rightarrow 2$. Suppose $H$ is not finite. For each $h_1 \ldots h_k \in H$ and $\varepsilon >0$, let
$$B(h_1 \ldots h_k, \varepsilon) = \{x \in V \mid \lvert P_{h_j}(x) \rvert < \varepsilon,\ j=1 \ldots k \}.$$
Those sets form a fundamental system of neighborhoods of the origin for the topology $\tau$ and so for the norm topology too. Fix $h_1 \ldots h_k$ and $\varepsilon$. Since $H$ is infinite we can find $h \in H, h \ne h_1 \ldots h_k$. Call $r_h=\{\lambda h \mid \lambda \in \mathbb{K}\}$. This set clearly is unbounded. We have $r_h \subset B(h_1 \ldots h_k, \varepsilon)$ and so $B(h_1 \ldots h_k, \varepsilon)$ is unbounded too.
We have thus shown that every $\lVert \cdot \rVert$-neighborhood of the origin of $V$ needs be unbounded. This is a contradiction.


text:
Q: How can I use netty to build reliable UDP? How can I use netty to build reliable UDP?
Modify netty's source code?
Or use netty as low level, and implement reliable at the application layer?
Thank you!
Best Regards!

A: It depends on your application's design. It is much easier to build a thin application layer (with simple data frame with sequence numbering, acknowledgement frame with received sequence number, and optional timer handlers to implement re-transmission) than modifying the Netty UDP transport source to add these things.
This approach might face some issues like, sending frames bigger thank IP frames, you have handle application PDU fragmentation, later you might have to keep adding more things to the layer. Any way I would do this only if TCP or SCTP (Netty 4.X supports SCTP) can not be used for the purpose.


text:
Q: Symfony 4.3 - Cannot autowire service argument in nested inheritance I have 3 services and 1 controller. The problem is that the grandpa service has a problem to autowire its constructor argument.

*

*RegistrationController has action that hasRegisterDB service as argument.

*RegisterDB extends DBALProvider service.

*DBALProvider extends BaseService service.

*DBALProvider has constructor that autowires some arguments and saves them to properties that are returned by getters.

*BaseService has constructor that does not autowire argument so its property is null (not null expected).

Bare minimum code:
RegistrationController.php
 class RegistrationController extends AbstractController
    {
      public function register(RegisterDB $registerDB)
      {
        $registerDB->registerUser();die;
      }
    }

RegisterDB.php
class RegisterDB extends DBALProvider
{
  public function registerUser()
  {
    dump($this->getTranslator());
    dump($this->getContext());
  }
}

DBALProvider.php
class DBALProvider extends BaseService
{
  private $context;

  public function __construct(EntityManagerInterface $entityManager)
  {
    $this->context = $entityManager->getConnection();
  }

  protected function getContext()
  {
    return $this->context;
  }
}

BaseService.php
class BaseService
{
  private $translator;

  public function __construct(TranslatorInterface $translator)
  {
    $this->translator = $translator;
  }

  protected function getTranslator()
  {
    return $this->translator;
  }
}

The problem is that in RegisterDB.php 1st dump dump($this->getTranslator()); outputs null but 2nd dump shows expected connection object. What's wrong with my inheritance chain?
Thanks for feedback.

A: This really has nothing to do with autowiring, but with how inheritance works.
Since your BaseService expects an instance of TranslatorInterface you need to pass it to the parent constructor in your DBALProvider class:
class DBALProvider extends BaseService
{
  private $context;

  public function __construct(EntityManagerInterface $entityManager, TranslatorInterface $translator)
  {
    $this->context = $entityManager->getConnection();
    parent::__construct($translator);
  }

  protected function getContext()
  {
    return $this->context;
  }
}


text:
Q: LEFT JOIN doesn't working I have 2 taxonomies: city and street.
I need to get postmeta for one of my plugins.
Working code for only one taxonomy:
SELECT *
FROM $wpdb->postmeta
LEFT JOIN $wpdb->posts ON($wpdb->posts.ID = $wpdb->postmeta.post_id)
LEFT JOIN $wpdb->term_relationships ON ($wpdb->postmeta.post_id = $wpdb->term_relationships.object_id)
LEFT JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)
WHERE meta_key LIKE 'rwp_rating%'
  AND ($wpdb->term_taxonomy.taxonomy = 'city'
       AND $wpdb->term_taxonomy.term_id = '2')

but if I append
AND ($wpdb->term_taxonomy.taxonomy = 'street' AND $wpdb->term_taxonomy.term_id = '5')

it returns empty result.
Also I tried to do that:
SELECT *
FROM $wpdb->postmeta
LEFT JOIN $wpdb->posts ON ($wpdb->posts.ID = $wpdb->postmeta.post_id)
LEFT JOIN $wpdb->term_relationships ON ($wpdb->postmeta.post_id = $wpdb->term_relationships.object_id)
LEFT JOIN $wpdb->term_taxonomy AS t1 ON ($wpdb->term_relationships.term_taxonomy_id = t1.term_taxonomy_id)
LEFT JOIN $wpdb->term_taxonomy AS t2 ON ($wpdb->term_relationships.term_taxonomy_id = t2.term_taxonomy_id)
WHERE meta_key LIKE 'rwp_rating%'
  AND (t1.taxonomy = 'city'
       AND t1.term_id = '2')
  AND (t2.taxonomy = 'street'
       AND t2.term_id = '3331');

And it doesn't working too.
Please Note: I need to match both, like: city = 2 AND street = 2
not: city = 2 OR street = 2

A: Your first attempt will not work because a single taxonomy record can not have both street and city in it.
Update your second attempt to this :
SELECT * FROM $wpdb->postmeta
LEFT JOIN $wpdb->posts ON ($wpdb->posts.ID = $wpdb->postmeta.post_id)
LEFT JOIN $wpdb->term_relationships ON ($wpdb->postmeta.post_id = $wpdb->term_relationships.object_id)
LEFT JOIN $wpdb->term_taxonomy as t1 ON ($wpdb->term_relationships.term_taxonomy_id = t1.term_taxonomy_id AND t1.taxonomy = 'city')
LEFT JOIN $wpdb->term_taxonomy as t2 ON ($wpdb->term_relationships.term_taxonomy_id = t2.term_taxonomy_id AND t2.taxonomy = 'street')
WHERE meta_key LIKE 'rwp_rating%' AND t1.term_id = '2' AND t2.term_id = '3331');


text:
Q: How to read characters and get length of characters in a text file? I have a java text file named "text_in.txt" which contains
IDESOFMARCH

which is 11 characters in length, how do I go about finding the length of this file and appending an 'X' character to the end of H so that the text may be broken up into blocks of 2 characters each to be used for RSA encryption/decryption.
Example: ID ES OF MA RC HX
I have a main() which calls the encrypt method from my rsa.java file (files, private, public keys)
code.encrypt(files, 17, 2773);

files contains "text_in.txt" and "text_out.txt" and a boolean true which opens both files.
The main is calling this:
public void encrypt(FileInOut files, int e, int n) {

//Get the in file length and add a 'X' if uneven character blocks
    if((files.length() % 2) == 1)
      files.write("X");

//Print a 0 in the encrypted file to represent the end of a line
    if(files != char)
      files.write("0");

A: Well borrowing an answer from Reading a plain text file in Java
String str = new String(Files.readAllBytes(Paths.get("text_in.txt")));
int len = str.length();


text:
Q: resize images using NicEdit I am testing and looking for a wysiwyg editor and I found a pretty functional one called nicEdit. Problem is that using firefox all functions are working properly but using chrome, when image is placed, resize option frame doesn't work! How to solve it? If not, any other similar one? Some functions of Tiny MCE are not working  with chrome too. Thank you.

A: Use nicEdit and alter code this way in nicEdit.js:
var nicImageButton=nicEditorAdvancedButton.extend({addPane:function(){this.im=this.ne.selectedInstance.selElm().parentTag("IMG");this.addForm({"":{type:"title",txt:"Add/Edit Immagine"},width:{type:"text",txt:"Width",style:{width:"150px"}},src:{type:"text",txt:"URL",value:"http://",style:{width:"150px"}},alt:{type:"text",txt:"Alt Text",style:{width:"100px"}},align:{type:"select",txt:"Align",options:{none:"Default",left:"Left",right:"Right"}}},this.im)},submit:function(B){var C=this.inputs.src.value;if(C==""||C=="http://"){alert("You must enter a Image URL to insert");return false}this.removePane();if(!this.im){var A="javascript:nicImTemp();";this.ne.nicCommand("insertImage",A);this.im=this.findElm("IMG","src",A)}if(this.im){this.im.setAttributes({width:this.inputs.width.value,src:this.inputs.src.value,alt:this.inputs.alt.value,align:this.inputs.align.value})}}});nicEditors.registerPlugin(nicPlugin,nicImageOptions);

you have to add simply
,width:{type:"text",txt:"Width",style:{width:"150px"}}

and
width:this.inputs.width.value,

to add the option to insert width parameter.

A: Here is a full code with height edit option, in addition to the width
based on what Yuri Refolo explained
var nicImageButton=nicEditorAdvancedButton.extend({addPane:function(){this.im=this.ne.selectedInstance.selElm().parentTag("IMG");this.addForm({"":{type:"title",txt:"Add/Edit Image"},width:{type:"text",txt:"Width",style:{width:"150px"}},height:{type:"text",txt:"Height",style:{width:"150px"}},src:{type:"text",txt:"URL",value:"http://",style:{width:"150px"}},alt:{type:"text",txt:"Alt Text",style:{width:"100px"}},align:{type:"select",txt:"Align",options:{none:"Default",left:"Left",right:"Right"}}},this.im)},submit:function(B){var C=this.inputs.src.value;if(C==""||C=="http://"){alert("You must enter a Image URL to insert");return false}this.removePane();if(!this.im){var A="javascript:nicImTemp();";this.ne.nicCommand("insertImage",A);this.im=this.findElm("IMG","src",A)}if(this.im){this.im.setAttributes({width:this.inputs.width.value,height:this.inputs.height.value,src:this.inputs.src.value,alt:this.inputs.alt.value,align:this.inputs.align.value})}}});nicEditors.registerPlugin(nicPlugin,nicImageOptions);


text:
Q: Sitecore Application access denied We've just taken over a site based in Sitecore and the Windows Event Log is showing exceptions occurring whenever someone is logged into the admin.
Anybody know how to fix this? It looks like their missing a permission for something but I can't work out what I'd need to do to fix it.
Exception information:
    Exception type: AccessDeniedException
    Exception message: Application access denied.
   at Sitecore.Diagnostics.Assert.HasAccess(Boolean accessAllowed, String message)
   at Sitecore.Diagnostics.Assert.CanRunApplication(String application)
   at Sitecore.Shell.Applications.Analytics.TrackingField.TrackingFieldDetailsPage.OnLoad(EventArgs e)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Request information:
    Request URL: http://www.SITENAME.com/sitecore/shell/~/xaml/Sitecore.Shell.Applications.Analytics.TrackingFieldDetails.aspx?db=master&id={31D7150F-352B-4800-8FDF-C90CDAD17D67}&la=en&vs=7&di=1&fld={B0A67B2A-8B07-4E0B-8809-69F751709806}&scDisabled=true
    Request path: /sitecore/shell/~/xaml/Sitecore.Shell.Applications.Analytics.TrackingFieldDetails.aspx
    User host address: 195.138.205.241
    User: sitecore\USERNAME
    Is authenticated: True
    Authentication Type:
    Thread account name: NT AUTHORITY\NETWORK SERVICE

Thread information:
    Thread ID: 136
    Thread account name: NT AUTHORITY\NETWORK SERVICE
    Is impersonating: False
    Stack trace:    at Sitecore.Diagnostics.Assert.HasAccess(Boolean accessAllowed, String message)
   at Sitecore.Diagnostics.Assert.CanRunApplication(String application)
   at Sitecore.Shell.Applications.Analytics.TrackingField.TrackingFieldDetailsPage.OnLoad(EventArgs e)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

A: It might be due to some of your recent configuration changes.
Do an IIS Reset or Restart your machine.
It should work.

A: It seems like a security related issue with the web server hosting your site.
Open the IIS manager in the server
Select your site
Go to its advanced settings
Under Process model, change the value of the field Identity to Network Service

If you are still experiencing a problem, open the command prompt and enter:
net localgroup "Performance Monitor Users" /add "NETWORK SERVICE"

This will give more access to the sitecore user in the server

A: These sitecore knowledge base links may help, as the stack traces look very similar.
https://kb.sitecore.net/articles/848772
https://kb.sitecore.net/articles/000050
Pulled from this post: http://www.seanholmesby.com/sitecore-accessdeniedexception-in-the-content-editor/


text:
Q: How to configure maven tomcat port in eclipse? I have a maven web project, when I issue a maven build with this goal > clean install tomcat:run, this will launch the tomcat server. Anyhow the server were fail to launch because of this error:

[ERROR] Failed to execute goal
  org.codehaus.mojo:tomcat-maven-plugin:1.1:run (default-cli) on project
  WebEngineering: Could not start Tomcat: Protocol handler
  initialization failed: java.net.BindException: Address already in use
  :8080 -> [Help 1]

I just realize there were another application were using port 8080, I don't want to lose it. May I know how could I change my current project port number other than 8080?

A: In pom.xml, where you declared the apache tomcat maven plugin, you would set or change the port number, Ex:
<plugin>
    <groupId>org.apache.tomcat.maven</groupId>
    <artifactId>tomcat7-maven-plugin</artifactId>
    <!-- or if you want to use tomcat 6.x
    <artifactId>tomcat6-maven-plugin</artifactId>
    -->
    <version>2.0</version>
    <configuration>
      <!-- http port -->
      <port>9090</port>
      <!-- application path always starts with /-->
      <path>/</path>
      ...
</plugin>

See Run an embeded Tomcat

A: In Project Explorer, on Servers tab, expand your server.
There open the catalina.properties file and at the end of the file you can select the port you want to use like:
 `bio.http.port=9090`

Sorry, that is for VMWare. For Tomcat open the server.xml file and edit the port.
There you should have a connector with port = 8080. Just change to another value.


text:
Q: Date format in bash Simple bash question... I suppose, I'm new.
I have substract date from system time
date_from=`date -d "30 minutes ago"`

after, I want format the result in $date_from  in 'yyyy-mm-dd'
how can I do that?

A: date -d "30 minutes ago" +%Y-%m-%d

It is very likely, though, that 30 minutes ago it was the same day :)

A: You can append a format string:
date -d "30 minutes ago" +"%Y-%m-%d"

A: As you can't guarantee that 30 minutes ago would be the same day, your best solution would be convert the current date/time into seconds from 1970, subtract 30*60 seconds, and then convert this back into a date.
I could do this in a script, not sure how to do it in one line.
Something like:
CURRENT=date +%S
CURRENTMINUS30=expr $CURRENT - (30*60)
OLD = date -d@`CURRENTMINUS30`

That's untested though. I'll have a go at getting the script to work and post it's contents, and perhaps someone else can do it in one line.


text:
Q: In Google Cloud Datastore, how can I check if a write operation failed? I'm using GAE for PHP, but I don't think that the language matters. I'm trying to use transactions, but the same thing would apply to any regular datastore
 batch operations (like insert, update, or upsert).
I don't see any way to check the result of those operations. They appear to return the version of the entity, but how do I know if one of the operations in a batch failed (for any reason)?
Thanks


text:
Q: variadic template function to concatenate std::vector containers While learning about template parameter packs, I'm trying to write a clever, simple function to efficiently append two or more std::vector containers together.
Below are two initial solutions.
Version 1 is elegant but buggy, as it relies on side-effects during the expansion of the parameter pack, and the order of evaluation is undefined.
Version 2 works, but relies on a helper function that requires two cases.  Yuck.
Can you see if you can come up with a simpler solution?
(For efficiency, the vector data should not be copied more than once.)
#include <vector>
#include <iostream>

// Append all elements of v2 to the end of v1.
template<typename T>
void append_to_vector(std::vector<T>& v1, const std::vector<T>& v2) {
    for (auto& e : v2) v1.push_back(e);
}

// Expand a template parameter pack for side effects.
template<typename... A> void ignore_all(const A&...) { }

// Version 1: Concatenate two or more std::vector<> containers into one.
// Nicely simple, but buggy as the order of evaluation is undefined.
template<typename T, typename... A>
std::vector<T> concat1(std::vector<T> v1, const A&... vr) {
    // Function append_to_vector() returns void, so I enclose it in (..., 1).
    ignore_all((append_to_vector(v1, vr), 1)...);
    // In fact, the evaluation order is right-to-left in gcc and MSVC.
    return v1;
}

// Version 2:
// It works but looks ugly.
template<typename T, typename... A>
void concat2_aux(std::vector<T>& v1, const std::vector<T>& v2) {
    append_to_vector(v1, v2);
}

template<typename T, typename... A>
void concat2_aux(std::vector<T>& v1, const std::vector<T>& v2, const A&... vr) {
    append_to_vector(v1, v2);
    concat2_aux(v1, vr...);
}

template<typename T, typename... A>
std::vector<T> concat2(std::vector<T> v1, const A&... vr) {
    concat2_aux(v1, vr...);
    return v1;
}

int main() {
    const std::vector<int> v1 { 1, 2, 3 };
    const std::vector<int> v2 { 4 };
    const std::vector<int> v3 { 5, 6 };
    for (int i : concat1(v1, v2, v3)) std::cerr << " " << i;
    std::cerr << "\n";          // gcc output is:  1 2 3 5 6 4
    for (int i : concat2(v1, v2, v3)) std::cerr << " " << i;
    std::cerr << "\n";          // gcc output is:  1 2 3 4 5 6
}

A: A helper type: I dislike using intfor it.
struct do_in_order { template<class T>do_in_order(T&&){}};

Add up sizes:'
template<class V>
std::size_t sum_size( std::size_t& s, V&& v ) {return s+= v.size(); }

Concat.  Returns type to be ignored:
template<class V>
do_in_order concat_helper( V& lhs, V const& rhs ) { lhs.insert( lhs.end(), rhs.begin(), rhs.end() ); return {}; }

Micro optimization, and lets you concat vectors of move only types:
template<class V>
do_in_order concat_helper( V& lhs, V && rhs ) { lhs.insert( lhs.end(), std::make_move_iterator(rhs.begin()), std::make_move_iterator(rhs.end()) ); return{}; }

actual function.  Above stuff should be in a details namespace:
template< typename T, typename A, typename... Vs >
std::vector<T,A> concat( std::vector<T,A> lhs, Vs&&...vs ){
  std::size s=lhs.size();
  do_in_order _0[]={ sum_size(s,vs)..., 0 };
  lhs.reserve(s);
  do_in_order _1[]={ concat_helper( lhs, std::forward<Vs>(vs) )..., 0 };
  return std::move(lhs); // rvo blocked
}

apologies for any typos.

A: There is a related answer on concatenation of strings: https://stackoverflow.com/a/21806609/1190077 .
Adapted here, it looks like:
template<typename T, typename... A>
std::vector<T> concat_version3(std::vector<T> v1, const A&... vr) {
    int unpack[] { (append_to_vector(v1, vr), 0)... };
    (void(unpack));
    return v1;
}

This seems to work!
However, is the evaluation order of the template parameter pack now well-defined, or is it by accident that the compiler did the right thing?

A: The answer by Yakk (https://stackoverflow.com/a/23439527/1190077) works well.
Here is a polished version, incorporating my improvement to do_in_order and removing the sum_size external function:
// Nice syntax to allow in-order expansion of parameter packs.
struct do_in_order {
    template<typename T> do_in_order(std::initializer_list<T>&&) { }
};

namespace details {
template<typename V> void concat_helper(V& l, const V& r) {
    l.insert(l.end(), r.begin(), r.end());
}
template<class V> void concat_helper(V& l, V&& r) {
    l.insert(l.end(), std::make_move_iterator(r.begin()),
             std::make_move_iterator(r.end()));
}
} // namespace details

template<typename T, typename... A>
std::vector<T> concat(std::vector<T> v1, A&&... vr) {
    std::size_t s = v1.size();
    do_in_order { s += vr.size() ... };
    v1.reserve(s);
    do_in_order { (details::concat_helper(v1, std::forward<A>(vr)), 0)... };
    return std::move(v1);   // rvo blocked
}


text:
Q: How do we select data based on month and year in oracle query I have did my research and I found that it can be done in MSQL  with
SELECT * FROM sales WHERE month(sellDate) = 3 AND YEAR(sellDate) = 2017

But when I tried with Oracle , It returns me
ORA-00904: "YEAR": invalid identifier

Is there any Way I could call data based on month and year in oracle query ?
Solved
Thank you so much , I have also came out with a solution
This is how I did it .. :)
select * from sales where to_char(sell,'MM')='09' AND to_char(sell,'YYYY')='2018';

A: You can use extract or to_char, but as those are acting on the table column value they will cause every value in the table to be converted for comparison, which is wasteful and prevents any index on that column being used.
It would be better to convert your target year and month to match the data type of the column, and then use a range:
SELECT * FROM sales
WHERE sellDate >= date '2017-03-01'
AND sellDate < date '2017-04-01'

Or if the year and month are variables (so you can't use a date literal) you can use to_date() to convert the year and month to a date, and add_months() to find the start of the following month, e.g.:
SELECT * FROM sales
WHERE sellDate >= to_date('2017' || '03', 'YYYYMM')
AND sellDate < add_months(to_date('2017' || '03', 'YYYYMM'), 1)

and if you are passed the year and month as numbers instead of strings you can explicitly convert those to string with to_char.

A: You can use EXTRACT to get month and year from date.
For Example
SELECT Extract(YEAR
               FROM CURRENT_DATE),
       EXTRACT(MONTH
               FROM CURRENT_DATE)
FROM dual;

It will generate result as below.

So the query you posted in question can be re-written as below.
SELECT *
FROM sales
WHERE EXTRACT(MONTH
              FROM sellDate) = 3
  AND Extract(YEAR
              FROM sellDate) = 2017;

You can check the demo here

A: Basically, input this code in your structure.
Hope this helps.
 select * from sales where to_char(sell,'MM')='09' AND to_char(sell,'YYYY')='2018';

A: You can use to_char to get year/month:
SELECT * FROM dual WHERE to_char(sysdate,'MM') = 8 AND to_char(sysdate,'YYYY') = 2017

A: Try using Extract Please ensure sellDate is a date column or change it to date using to_date
SELECT * FROM sales WHERE EXTRACT(MONTH from sellDate) = 3 and EXTRACT(YEAR from sellDate) = 2017;


text:
Q: Error while unmarshalling in java I have an xml file already containing,
**< ?xml version="1.0" encoding="UTF-8" standalone="yes"?>
< customer id="100">
< age>22< /age>
< name>naveen< /name>
< /customer>**
for which my POJO class is
public class Customer {
String name;
int age;
int id;

public String getName() {
    return name;
}

public int getAge() {
    return age;
}

public int getId() {
    return id;
}

}
I am trying to unmarshall this by using JAXB as,
   File file = new File("sample.txt");
   JAXBContext jaxbContext = JAXBContext.newInstance(Customer.class);
   Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
   Customer customer = (Customer) jaxbUnmarshaller.unmarshal(file);
   System.out.println(customer);

But I am getting an exception as
unexpected element (uri:"", local:"customer"). Expected elements are (none)
Please help me out.

A: Currently there isn't enough information in you class for JAXB to know which class to instantiate based on the root element.  You can do one of the following:

*

*Add @XmlRootElement on your Customer class to explicitly map the Customer class to the customer root element.

*Use an unmarshal method that takes a Class parameter:
JAXBElement<Customer> je = unmarshaller.unmarshal(source, Customer.class);
Customer customer = je.getValue();

For More Information

*

*http://blog.bdoughan.com/2012/07/jaxb-no-annotations-required.html

*http://blog.bdoughan.com/2012/07/jaxb-and-root-elements.html

A: There might be 2 issue
1 - Correct the format of xml, I could saw spaces in the tag like use  instead of < use> better to use below xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<customer id="100">
    <age>22</age>
    <name>naveen</name>
</customer>

2 - and annotate your Jaxb class - use the below
@XmlRootElement
public class Customer {
@XmlElement
String name;
@XmlElement
int age;
@XmlAttribute
int id;

public String getName() {
    return name;
}

public int getAge() {
    return age;
}

public int getId() {
    return id;
}
}


text:
Q: Pandas copy previous day's data based on key and date range I have below dataframe in Pandas. I want to roll/copy the data for the missing dates withing the start/end dates.
I want to create rows for 3-MAR-21 and 4-MAR-21 as per below ---
For 3-MAR-21, all the three loans L1, L2 and L3 rows should be copied from 2-MAR-21
For 4-MAR-21, only L1 and L3 should be copied, because L2 ends on 3-MAR-21.

DATE
Loan ID
Stat Date
End Date
Rate

1-MAR-21
L1
1-MAR-21
10-MAR-21
100

1-MAR-21
L2
1-MAR-21
3-MAR-21
150

1-MAR-21
L3
1-MAR-21
31-MAR-21
160

----
---
---
---
---

2-MAR-21
L1
1-MAR-21
10-MAR-21
110

2-MAR-21
L2
1-MAR-21
3-MAR-21
160

2-MAR-21
L3
1-MAR-21
31-MAR-21
170

----
---
---
---
---

5-MAR-21
L1
1-MAR-21
10-MAR-21
90

5-MAR-21
L3
1-MAR-21
31-MAR-21
140

Update: Added more details

A: You could try:
# 4-MAR-21
rows = df.loc[df['DATE'] == '2-MAR-21, :]
rows['DATE] = '3-MAR-21'
df = df.append(rows, ignore_index=True)

# 5-MAR-21
rows = df.loc[
    (df["DATE"] == "2-MAR-21") & ((df["Loan ID"] == "L1") | (df["Loan ID"] == "L3")), :
]
rows["DATE"] = "4-MAR-21"
df = df.append(rows, ignore_index=True)

# Sort values
df = df.sort_values(by=["DATE"], ascending=True, inplace=False)
df = df.reset_index(drop=True)

A: Ok, I tried to solve this by multiple google search and it looks to give correct results, posting if someone else has similar need.
from datetime import timedelta, date

def daterange(start_date, end_date):
    for n in range(int((end_date - start_date).days)):
        yield start_date + timedelta(n)
import pandas as pd
import warnings
import numpy as np
warnings.simplefilter(action='ignore', category=FutureWarning)

data = {
  "DATE": ['3/1/2021', '3/1/2021', '3/1/2021', '3/2/2021', '3/2/2021', '3/2/2021', '3/5/2021', '3/5/2021'],
  "LOAN_ID": ['L1', 'L2', 'L3', 'L1', 'L2', 'L3', 'L1', 'L3'],
    "START_DATE": ['3/1/2021', '3/1/2021', '3/1/2021', '3/1/2021', '3/1/2021', '3/1/2021', '3/1/2021', '3/1/2021'],
    "END_DATE": ['3/10/2021', '3/3/2021', '3/31/2021', '3/10/2021', '3/3/2021', '3/31/2021', '3/10/2021', '3/31/2021'],
    "RATE": ['100', '150', '160', '110', '160', '170', '90', '140']
}

#load data into a DataFrame object:
df = pd.DataFrame(data)
df.DATE = pd.to_datetime(df.DATE)
df.END_DATE = pd.to_datetime(df.END_DATE)
print(df)
# Date range
start_date = date(2021, 3, 1)
end_date = date(2021, 3, 15)
# variable to hold prev date
prev_date = date(2021, 3, 1)
for single_date in daterange(start_date, end_date):
    # if date is found in dataset, don't do anything, don't know how to write inverse condition
    if (df.DATE == pd.Timestamp(single_date)).any():
        pass
    else:
        #print(single_date.strftime("%Y-%m-%d") +  " :: " + prev_date.strftime("%Y-%m-%d"))
        # get previous day's rows
        df_prev = df[df['DATE'].dt.date == pd.Timestamp(prev_date)]
        # filter by end date
        df_filtered = df_prev[df_prev['END_DATE'].dt.date >= pd.Timestamp(single_date)]
        #print(df_filtered)
        # replace DATE with missing date
        df_filtered['DATE'] =  pd.Timestamp(single_date)
        #print(df_filtered)
        # append dataset
        df=df.append(df_filtered, ignore_index=True)
        #print(df)

    prev_date = single_date

df.sort_values(by=['DATE'], inplace=True)
print(df)


text:
Q: heroku createsuperuser does not create a user. Does not make entry in auth_user table     (cfehome) C:\Dev\cfehome\verojewels>heroku run python manage.py
    createsuperuser
    Running python manage.py createsuperuser on ⬢ verojewels... up, run.7672
    (Free)
    Username (leave blank to use 'u48267'): shruti
    Email address: shruti.karva@gmail.com
    Password:
    Password (again):
    Superuser created successfully.

after this also, no entry in auth_user table is made

A: Execute following command to initialize database.
heroku run python manage.py migrate

Also don't forged to add Heroku Addon for database and correctly configure your Django project in settings.py.
If you are using Postgres, please check if you have something like following and DATABASES['default'] is not overridden.
import dj_database_url
DATABASES['default'] = dj_database_url.config()


text:
Q: What are the various types of science & engineering qualifications that Batman has? Is there any DC comic or any other authoritative source that states/lists the various science & engineering qualifications that Batman has?
EDIT:
I see that this question is on hold. However, please note that this question is not a duplicate. A question similar to this was asked previously but it did not specifically ask for the Batman's engineering & science qualifications.Consequently the answers did not address this topic( Batman's engineering & science qualifications) either.


text:
Q: Negation of $x \in A \cup B$. What is the negation of $x \in A \cup B$. Is it $x \in (\lnot A \cap \lnot B)$? Or is it, $x \notin (\lnot A \cap \lnot B)$? Or maybe something else?
Another question: how to distribute nonmembership of $x \notin (\lnot A \cap \lnot B)$?  Is it $x \notin \lnot A \land x \notin \lnot B$?

A: The negation is
$\lnot (x\in A \cup B) \iff \lnot [(x \in A) \vee (x \in B)] \iff \lnot (x \in A) \land \lnot(x \in B) \iff x \notin A \land x \notin B$

A: One has:
$$\neg(x\in (A\cup B)) ~{= x\notin (A\cup B) \\ = x\in (A\cup B)^\complement\\ = x\in (A^\complement\cap B^\complement) \\ = x\in A^\complement ~\land~ x\in B^\complement \\ = x\notin A~\land~x\notin B\\ = \lnot(x\in A)~\land~\lnot (x\in B)}$$
Similarly:
$$\neg(x\in (A\cap B)) ~{= x\notin (A\cap B) \\ = x\in (A\cap B)^\complement\\ = x\in (A^\complement\cup B^\complement) \\ = x\in A^\complement ~\lor~ x\in B^\complement \\ = x\notin A~\lor~x\notin B\\ = \lnot(x\in A)~\lor~\lnot (x\in B)}$$

Note: Although set compementation and logical negation are related concepts, we do not typically use $\lnot A$ to denote the set complement of $A$, rather we usually use $A^\complement$ or similar.  $~A', A^\mathsf c, \lower{0.25ex}\complement A\ldots~$

A: If $x$ is not in $A \cup B$, then $x$ is in neither $A$ nor $B$.  Hence $x$ must be outside both $A$ and $B$.  Thus it is in the complement of both $A$ and $B$.  That means $ x \in A^c \cap B^c$


text:
Q: R studio - Error in install.packages It is few hours I started to learn R and I encountered problem while installing ggplot2 package.
Problem:
> install.packages("ggplot2", dependencies = FALSE)
Installing package into 'C:/Users/Ramal/Documents/R/win-library/3.5'
(as 'lib' is unspecified)

trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.5/ggplot2_3.0.0.zip'
Content type 'application/zip' length 3579116 bytes (3.4 MB)
downloaded 3.4 MB

Error in install.packages : cannot open file 'C:/Users/Ramal/Documents/R/win-library/3.5/file1d0849aa2ba8/ggplot2/help/figures/logo.png': Permission denied

it is last version of R. and this question have been asked before in here.
but answers was not helpful to me. Could you help me in order to solve this problem?


text:
Q: Scandir function to output all .php pages to website - PHP I am trying to output all the .php files on my website to a page. I have managed to do it, to a certain extent.
I have managed to output all the files which are in my website directory. These include textfiles, image files, .php files, etc.
I just want the output to be .php files and for them to be hyper-linked.
This is currently my code:
<?php
$dir = '/home/website/allfiles';
$files = scandir($dir);
echo "
";
print_r($files);
echo "
";
?>

The code above just prints all the files (.txt, .jpeg, .php, etc) in a array listing.

A: To further my comment: You can make use of the glob() function (PHP 4 >= 4.3.0, PHP 5) and filter the file extensions you want to use/show.
Using: GLOB_BRACE

GLOB_BRACE - Expands {a,b,c} to match 'a', 'b', or 'c'

Here is a basic example:
<?php

$directory = "images/"; // Use your preferred folder
$files = glob($directory . '*.{jpg,jpeg,png,gif,doc,ppt}', GLOB_BRACE);

foreach($files as $file)
{
    echo ''.$file.'' . "
";
}

?>

If you don't want to use the filename as the shown text, you can use a general word, View file for example:
Simply replace: swapping '.$file.' for View file
echo ''.$file.'' . "
";

with:
echo 'View file' . "
";

Or using double quotes as the wrapped echo: (inverting the quotes for "'.$file.'")
echo "View file" . "
";

To open the file in a new window/tab use target='_blank'
Example:
echo "View file" . "
";


text:
Q: R Authentication error when looping search_tweets function (rtweet package) over vector of Twitter handles I've created a loop that runs through a vector of Twitter handles, and collects tweets from them using the search_tweets function from the rtweet package.
Downloading the latest version of rtweet
## install devtools package if it's not already
if (!requireNamespace("devtools", quietly = TRUE)) {
install.packages("devtools")
}

## install dev version of rtweet from github
devtools::install_github("mkearney/rtweet")

library(rtweet)

Creating token
## autheticate via web browser
token=create_token(
app = "My_app",
consumer_key = "My Consumer Key",
consumer_secret =
"My Secret Code",set_renv = FALSE)

Here are my my Twitter handles, stored in a vector
twitter_handles=c("@realDonaldTrump","@HillaryClinton","@MittRomney")

Then I loop through these handles, and store results of each handle as a unique dataframe
#Loop through the twitter handles & store the results as individual dataframes
for(handle in twitter_handles) {

  result <- search_tweets(handle, n = 3500 , include_rts = FALSE,retryonratelimit = TRUE)

if(length(result) != 0){

  result$`Twitter Handle` <- handle
  result$Source <- "Search"

  df_name <- paste(tolower(substring(handle, 2)),"_search")

  if(exists(df_name)) {
    assign(df_name, unique(rbind(get(df_name), result)))
  } else {
    assign(df_name, result)
  }
  }

  }

However when I do this, I get an error message

Warning: 32 - Could not authenticate you.
  Error in vector("list", ntimes) : invalid 'length' argument

However I don't think this is an authentication problem, because when I try with a random keyword/hashtag, I get results
data <- search_tweets("#rstats", n = 10, include_rts = FALSE,token = token)

My loop was working fine, but recently it has started throwing errors.
Any ideas on why this is happening, and whether there is a fix?
Your help is highly appreciated!

A: On the first error:

"Warning: 32 - Could not authenticate you. Error in vector("list",
  ntimes) : invalid 'length' argument"

in general, you'll encounter this error if you are using an older version of rtweet.
Why?
When Twitter updates their API's, they sometimes change the structure of the API GET requests. rtweet has to reformat their requests each time this happens, requiring you to use the latest version of rtweet to maintain connectivity to the Twitter API. Interestingly, some API calls will still succeed as those calls to the Twitter API are unchanged.
The error you encountered is referenced @ TwitterCommunity.com.
Obtaining the latest version of rtweet
To obtain the latest version of rtweet you can use the devtools package (after installing it).
## install devtools package if it's not already
if (!requireNamespace("devtools", quietly = TRUE)) {
  install.packages("devtools")
}

## install dev version of rtweet from github
devtools::install_github("mkearney/rtweet")

## load rtweet package
library(rtweet)

Related Errors

Error in vector("list", n.times) : invalid 'length' argument In
  addition: Warning message: rate limit exceeded.

A good place to look for tracked errors is the Github package tracking list on github for the rtweet package.

*

*https://github.com/mkearney/rtweet/issues/109
Token Security
This is an aside comment but my sense is you may also want to share your complete code without your API keys. You can do this in R by using ~/.Reviron.
# Reload .Renviron
# Do this to capture any edits to Environment variables
readRenviron("~/.Renviron")

# Generate a token
token <- create_token(
  app = "rtweet_51672443_test_application",
  consumer_key = Sys.getenv("RTWEET_CONSUMER_KEY"),
  consumer_secret = Sys.getenv("RTWEET_CONSUMER_SECRET_KEY")
)

where .Renviron contains:
RTWEET_CONSUMER_KEY="<Insert Consumer Key obtained from Titter>"
RTWEET_CONSUMER_SECRET_KEY="<Insert Consumer Secret Key obtained from Titter>"

I hope the above helps point you in the right direction.


text:
Q: Exception: The number of columns in the data does not match the number of columns in the range despite the range being created from data I'm trying to figure out what I'm missing here in this Google script. I keep getting the error

Exception: The number of columns in the data does not match the number of columns in the range. The data has 0 but the range has 15.

but it doesn't make sense to me.
Here's the bit of code in question:
var range = ReleaseSchedule.getRange(1,1,output_data_sheet.length,output_data_sheet[0].length);
range.setValues(output_data_sheet);

ReleaseSchedule is a new sheet in the active spreadsheet output_data_sheet is a 2 dimensional array. I have similar code working earlier in the script, but for some reason this one is throwing that exception and I can't figure out why. Any help or thoughts would be greatly appreciated.

A: I thought that the reason of this error of Exception: The number of columns in the data does not match the number of columns in the range. The data has 0 but the range has 15. might be as follows.

*

*output_data_sheet is 2 dimensional array.

*The array length of the 1st index of output_data_sheet is 15

*The empty array (the array length is 0) is included in the index except for 1st index.

When above output_data_sheet is used for setValues(), such error might occur. In order to remove this issue, how about the following modifications? Here, I would like to propose 2 patterns.
Pattern 1:
In this pattern, the empty elements are removed from output_data_sheet.
From:
var range = ReleaseSchedule.getRange(1,1,output_data_sheet.length,output_data_sheet[0].length);
range.setValues(output_data_sheet);

To:
output_data_sheet = output_data_sheet.filter(String);  // <--- Added
var range = ReleaseSchedule.getRange(1,1,output_data_sheet.length,output_data_sheet[0].length);
range.setValues(output_data_sheet);

Pattern 2:
In this pattern, the empty elements and the element smaller than the length of 15 add the elements for keeping the length of 15 for each index in output_data_sheet.
From:
var range = ReleaseSchedule.getRange(1,1,output_data_sheet.length,output_data_sheet[0].length);
range.setValues(output_data_sheet);

To:
output_data_sheet = output_data_sheet.map(r => r.length == 15 ? r : r.concat(Array(15 - r.length).fill("")));  // <--- Added
var range = ReleaseSchedule.getRange(1,1,output_data_sheet.length,output_data_sheet[0].length);
range.setValues(output_data_sheet);

References:

*

*filter()

*map()

A: In the next column to the last column of data you need, there might be some content that is not visible but it's there and that's what the script picks up.
I resolved this by adding the following line of code :-
ws.getRange("J1:J").clearContent();
Where J is the first empty column. I required data from column A to I.
PS :- The above code snippet is the part of function that calls all sheets within the folder and fetches the data from those sheets into one master sheet.


text:
Q: Lua os.date() - What's the difference between *t and !*t The first argument passed to os.date() is the format string. I've seen people use *t and !*t as the format string.
Is there a difference between the two?

A: The lua ref manual describes this:

If format starts with '!', then the date is formatted in Coordinated Universal Time

These two examples show the difference:
local t = os.date( "!%a %b %d, %H:%M")
print(t) -- Thu Oct 25, 04:01 (current UTC)

local t = os.date( "%a %b %d, %H:%M")
print(t) -- Thu Oct 25, 12:01


text:
Q: Disable Firestore's browser logging I am working on a web app that uses Firestore. Today I noticed that it is logging debug/etc info to the browser console. I don't recall seeing this before.
Here are some of the lines from the browser console
log:connect() index.js:32
log:connect() bypassed channel-test. index.js:32
log:connectTest_() index.js:32
log:GetForwardChannelUri: https://firestore.googleapis.com/google.firestore.v1beta1.Firestore/Listen/channel/test?VER=8 index.js:32
log:TestConnection: starting stage 2 index.js:32
log:Buffered index.js:32
log:Test Connection Finished index.js:32
log:connectChannel_() index.js:32
log:GetForwardChannelUri: https://firestore.googleapis.com/google.firestore.v1beta1.Firestore/Listen/channel?VER=8

I am using Vue, from a template based on the vue-cli webpack template.
This is happening both when I run the local dev server and from the production-built SPA.
Is there any way to disable this logging? Nowhere in the documentation mentions any kind of logging and Google didn't have anything either. I don't like it, because if I want to look for any actual output, I have to wade through Firestore's logging that I don't care about. I also don't like that it seems to log all data it returns to the console as well.
If it makes a difference, I am using the firebase v4.6.0 library from NPM.

A: FirebaseFirestore.setLogLevel(silent);

A: This was an issue with earlier versions of Firestore. I've since migrated to v4.12.1 and it no longer occurs.
I've since learned about the setLogLevel method from Jeff Padgett.
import * as firebase from 'firebase';
firebase.firestore.setLogLevel('silent');

Other valid values are 'error' and 'debug'.


text:
Q: NextJS tRPC Typescript errors: Argument of type X is not assignable to parameter of type 'void' / Type X is not assignable to type 'undefined' I had typescript strict mode set to true and these errors weren't coming up in VS Code but when I went to deploy to Vercel it picked them up and the build failed. I then turned strict mode off and these errors showed up in a number of locations in VS Code.
I'm new to typescript, so I'm well over my head here, and not sure how I can type these void and undefined items so the error is resolved.  I've spent 5 hrs crawling over the internet, probably with incorrect search terms, unable to find how to solve this.
below has an example of both issues:
// admin.tsx

import { trpc } from "../../utils/trpc";

function Admin(props: {id: number}) {

  // fetch data with id results in error:
  // Type '{ id: number; }' is not assignable to type 'undefined'.

  const { data: countdown, isLoading } = trpc.useQuery([
    "countdown.getCountdownAdmin",
    {
      id: props.id,
    },
  ]);

  // below relates to the parameter of type void error

  const utils = trpc.useContext();
  const mutateResults = trpc.useMutation(["countdown.updateResults"], {
    async onSuccess() {
      await utils.invalidateQueries(["countdown.getCountdownAdmin"]);
    },
  });

  // the error presents on this function.  Error message:
  // Argument of type '{ countdownId: number; }' is not assignable to parameter of type 'void'.

  async function generateResults() {
    const data = await mutateResults.mutateAsync({
      countdownId: countdown.id,
    });
  }
return (
{some unimportant stuff here}
  );
}

export default Admin;

On the server side (I've removed unrelated queries):
// countdown.ts

import { TRPCError } from "@trpc/server";
import { createProtectedRouter } from "./protected-router";
import { z } from "Zod";

export const countdownProtected = createProtectedRouter()
.query("getCountdownAdmin", {
    input: z.object({
      id: z.number(),
    }),
    async resolve({ ctx, input }) {
      const { id } = input;
      try {
        const countdown = await ctx.prisma.countdowns.findUnique({
          where: {
            id: id,
          },
          include: {
            UserCountdowns: {
              include: {
                User: {
                  include: {
                    Votes: {
                      where: {
                        countdownId: id,
                      },
                    },
                  },
                },
              },
            },
            Results: true,
            InviteCode: true,
          },
        });

        return countdown;
      } catch (e) {
        console.log(e);
        throw new TRPCError({
          code: "BAD_REQUEST",
        });
      }
    },
  })
.mutation("updateResults", {
    input: z.object({
      countdownId: z.number(),
    }),
    async resolve({ ctx, input }) {
      const { countdownId } = input;
      // const user = ctx.session?.user?.id;

      try {
        const data = await ctx.prisma.countdowns.findUnique({
          where: {
            id: countdownId,
          },
          include: {
            Votes: {
              include: {
                User: true,
              },
              orderBy: {
                id: "asc",
              },
            },
          },
        });

        // long and unrelated function here that I've cut out

      } catch (e) {
        console.log(e);
        throw new TRPCError({
          code: "BAD_REQUEST",
        });
      }
    },
  });


text:
Q: Retrieving users from Firebase database I am trying to retrieve my users name from my Firebase database and then make the "label" in my view controller present that name of the person I am retrieving from the database. been having a hard time with this, does anyone know how I can do this?
thank you!!!
This is the code I found online and was playing around with but had no luck with

override func viewDidLoad() {
        super.viewDidLoad()

        let db = Firestore.firestore()

        db.collection("users2").document("first name").getDocument { (document, Error) in

            //check for error
            if Error == nil {
                //check if document exists
                if document != nil && document!.exists {

                    let documentData = document!.data()

                    let Label.text = ...
                }

            }
        }

I use Cloud Firestore to store my users info
and the collection is "users2" and then in the document its just the users  first and last name and the uid which is equal to the document ID.
I dont know how to retrieve the the first name and then make my label present it in another view

A: Your code is now trying to load a document with ID first name, which likely doesn't exist. Since you say that the document ID is the UID, that should be:
let user = Auth.auth().currentUser
if user != nil {
    db.collection("users2").document(user.uid).getDocument { (document, Error) in
        if Error == nil {
            if document != nil && document!.exists {
                let documentData = document!.data()
                let Label.text = documentData["first name"]
            }
        }
        ...


text:
Q: UITextView linkTextAttributes set accessibility value I created a text view that has one line of text and part of the text is a link. I use linkTextAttributes to create that clickable link text, but I cannot get accessibility to work.
I am able to click on the link, but in "Accessibility Inspector", when I hover over the text view, it sees it as one accessibility element and won't be able to detect the clickable text.
However, in Accessibility Inspector, under Hierarchy section, I'm able to see the Link, but I just can't set it's accessibility label and value.

The entire text view is one accessibility element

However, it shows up under Hierarchy

I want to be able to modify the accessibility value in this MORE clickable text. But I am not able to get the accessibility of MORE text in code at all.

A: I don't think we can actually make it possible to voice over the link text seperately as it is still a string which do not have "isAccessibilityElement". However, this can be achieved If we create a CustomTextView with a label and a button.


text:
Q: Error de Sintaxis PHP/MySQLI ¿Que ocurre? Creo que esta bien construida, pero obviamente algo esta fallando.
Nombre de la Tabla: citas
Nombre de los Campos: idcita, horacita, diacita, asuntocita

Error de Consulta 1064 You have an error in your SQL syntax; check the
  manual that corresponds to your MySQL server version for the right
  syntax to use near 'diacita='2018-11-14' asuntocita='df' WHERE idcita
  = 22' at line 1

$fechaBD = $_POST['anio']."-".$_POST['mes']."-".$_POST['dia'];
$horaBD = $_POST['hora'].":".$_POST['min'];

    $modificarQuery = "UPDATE citas SET horacita='".$horaBD."' diacita='".$fechaBD."' asuntocita='".$_POST['asuntoCita']."' WHERE idcita = ".$idCita;

    $result = mysqli_query($conexion, $modificarQuery);

    if(!$result){
                  die("Error de Consulta ".mysqli_errno($conexion)." ".mysqli_error($conexion));

A: Sí, está bien formada, pero te faltan comas entre cada uno de los parámetros que le pasas a la consulta. La formación de update es la siguiente:
UPDATE table_name
SET column1=value, column2=value2,...
WHERE some_column=some_value

Añadiéndole las comas, debería funcionarte, salvo que tengas alguna columna que no corresponda a la tabla.


text:
Q: Bootstrap delete item in database In my website I have two accounts where one is for administrator and one is for user. Admin have the ability to edit, create and delete. All of this function that I implemented are working fine but now when I open my user in another browser and I execute a delete function from admin in another browser it is not auto updated to the user site. I need to manually refresh my page in my user site to see the current records.
What is the method to auto update/auto refresh the user page whenever there is a modification made from the administrator?
Below is my code in the controller where i execute the delete function. Please let me know where i can adjust my code to auto refresh the content in user site.
This is the access rules
public function accessRules()
{
    return array(
        array('allow',  // allow all users to perform 'index' and 'view' actions
            'actions'=>array('index'),
            'users'=>array('*'),
        ),
        array('allow',
            'actions'=>array('view','user'),
            'users'=>array('@'),
        ),
        array('allow', // allow admin user to perform 'admin' and 'delete' actions
            'actions'=>array('create','update', 'admin','delete'),
            'expression' => 'Yii::app()->user->isAdmin()'
        ),
        array('deny',  // deny all users
            'users'=>array('*'),
        ),
    );
}

This is the delete function
public function actionDelete($id)
{
    if(Yii::app()->request->isPostRequest)
    {
        // we only allow deletion via POST request
        $this->loadModel($id)->delete();

        // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser
        if(!isset($_GET['ajax']))
            $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));

    }
    else
        throw new CHttpException(400,'Invalid request. Please do not repeat this request again.');
}

A: I assume that you are familiar with using ajax in javascript. if not please have a look at this.
1.Now you can set a timer in your JavaScript which gets called sat after every 10 seconds. In this javascript code write the ajax call.
var myVar=setInterval(function(){myTimer()},1000);

function myTimer()
{
//ajax call here
}

.2 Make a controller which this ajax function will call. Say checkflag
public function actionCheckFlag()
{
//check timestamp here, calculate timer difference between current time and the time of change in Db.You have to make timestamp with the each Db table.
}

Set some criteria in above action lets say the difference between current time and change time of Db table is say 1 minute then return some flag. Based on this flag refresh update some specific element. lets say update gridView. Or you can reload the whole page like
location.reload();


text:
Q: SQL Server stored procedures questions I got simple 2 SQL Server stored procedure questions that need your help. I'm a newbie to SQL Server, so I got stuck with very simple syntax errors when I execute my code

*

*I got a table as below and I need to create a stored procedure named count_status that accepts a single argument and returns only the total number of animals of a particular conversation status and the code should not return the corresponding conservation status.

Species table

My code:
CREATE PROCEDURE count_status
     @ConservationStatus INT
AS
  SELECT COUNT(ID)
  FROM Species
  WHERE ConservationStatus = @ConservationStatus
GO;
END

And I got a syntax error for the above code. Could you help me with this?
Thanks

*Create a stored procedure named format_currency that accepts a character and a double number. It will return a varchar(32) with the symbol in the front, followed by the number to 2 decimal places. For example format_currency ('$',123.4) should return $123.4
I don't know how to write code for this.
Thanks.

A: For #1, I haven't tested this but I think you need to use a group by clause
CREATE PROCEDURE count_status @ConservationStatus int
AS
SELECT COUNT(ID)
FROM   Species
WHERE  ConservationStatus = @ConservationStatus
GROUP  BY ConservationStatus
GO;

For #2, note the input parm is decimal (12, 2), that defines 2 decimal places which should both pad anything like 123.1 and trim anything like 123.123
ALTER  FUNCTION format_currency
(
    @currency_symbol varchar(1),
    @currency_amount decimal(12, 2)
)
RETURNS varchar(12)
AS
BEGIN
    RETURN @currency_symbol + ltrim(cast(cast(@currency_amount as money) as varchar))
END
GO

if you have a current version of Sql Server you can also use this
ALTER  FUNCTION format_currency
(
    @currency_symbol varchar(1),
    @currency_amount decimal(12, 2)
)
RETURNS varchar(32)
AS
BEGIN
    RETURN '$' + FORMAT(@currency_amount,'#,###,##0.00')
END
GO

A: CREATE PROCEDURE count_status
     @ConservationStatus INT
AS
BEGIN
  SELECT COUNT(ID)
  FROM Species
  WHERE ConservationStatus = @ConservationStatus
END
GO;

Explanation :
  1) Use Begin After As 'this begins the procedure query'
  2) Use Go After end