instruction stringlengths 0 30k ⌀ |
|---|
|.net|linq|.net-core|entity-framework-core| |
null |
```
<div className="product-information-tabs">
<nav>
<div className="nav nav-tabs">
<a href="#" className={`nav-link ${activeTab === "Description" ? "active" : ""}`} onClick={(e) => {
e.preventDefault()
setActiveTab("Description")
}}>
Description
</a>
<a href="#" className={`nav-link ${activeTab === "Additional Information" ? "active" : ""}`} onClick={(e) => {
e.preventDefault()
setActiveTab("Additional Information")
}}>
Additional Information
</a>
</div>
</nav>
<div className="tab-content">
<div className={`tab-pane fade ${activeTab === "Description" ? "active show" : ""}`}>
Some Content
</div>
<div className={`tab-pane fade ${activeTab === "Additional Information" ? "active show" : ""}`}>
Some Content
</div>
<div className={`tab-pane fade ${activeTab === "Specification" ? "active show" : ""}`}>
Some Content
</div>
<div className={`tab-pane fade ${activeTab === "Review" ? "active show" : ""}`}>
Some Content
</div>
</div>
</div>
```
**styles.css**
```
.fade{
transition: opacity 0.15s linear;
}
.fade:not(.show){
opacity: 0;
visibility: hidden;
}
.tab-content > .tab-pane{
display: none;
}
.tab-content > .active.show{
display: block;
opacity: 1;
visibility: visible;
}
```
I have an issue that when trying to switch tabs with animations got various limitations if I want to have the content only be displayed when the classname has ```active``` but without animations since display properties could not be applied to transition properties. However, I had also tried to use ```opacity``` and ```visibility``` properties but without display properties will make the content have too much redundant spaces so are there any best ways to have the content only be displayed when active with transitions but without any redundant spaces?
I tried and tried again and could not find a solution that satisfies the conditions so would like to seek help for solutions as there are much limitations to have properties satisfied. Also I took some references from other websites and tried to apply but it still could not take in effect |
User
TextFormField(
enableInteractiveSelection: false,
controller: _runningKmsController,
keyboardType: TextInputType.number,
inputFormatters: [
LengthLimitingTextInputFormatter(3)
],
onChanged: (value) {
calculateTotalKms();
monthlyTotalCost();
monthlyTotalEvCost();
calculateTotalCostPerMonth();
calculateTotalCostPerMonthEv();
calculateMonthlySavings();
},
cursorColor: AppTheme.appColors,
textAlign: TextAlign.center,
decoration: InputDecoration(
fillColor: Colors.white,
// hintText: 'Enter your text here',
border: UnderlineInputBorder(
borderSide: BorderSide(color: AppTheme.appColors),
),
),
),
TextFormField(
enableInteractiveSelection: false,
textAlign: TextAlign.center,
keyboardType: TextInputType.number,
cursorColor: AppTheme.appColors,
controller: _noOfWorkDaysController,
inputFormatters: [LengthLimitingTextInputFormatter(2)],
onChanged: (value) {
calculateTotalKms();
monthlyTotalCost();
monthlyTotalEvCost();
calculateTotalCostPerMonth();
calculateTotalCostPerMonthEv();
calculateMonthlySavings();
},
decoration: InputDecoration(
fillColor: Colors.white,
// hintText: 'Enter your text here',
border: UnderlineInputBorder(
// borderRadius: BorderRadius.circular(2.0),
borderSide: BorderSide(color: AppTheme.appColors),
),
),
),
I have 2 text form fields. Restrictions are required from 50 to 250 in the runningkmscontroller. A pop-up should be shown once the user shifts to the next tab. If the user enters a value less than or greater than the given range, validation should be performed. Additionally, onChange() function calculates different values. How can I achieve this? Please provide a solution. |
EBS volume is now supported by AWS Fargate. AWS announced it in Jan-2024.
https://aws.amazon.com/about-aws/whats-new/2024/01/amazon-ecs-fargate-integrate-ebs/
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_data_volumes.html |
I have a C++ code from the Sapera LT SDK user manual that acquires images from a Nano camera and displays them live. The problem arises when I attempt to build a project in Visual Studio 2022, as I encounter numerous errors.
**I have provided detailing the steps outlined in the manual to build the project.**
(I have followed these steps meticulously, but I am still encountering issues during the build process.)
--------------------------------------
Sapera LT ++ - Creating an Application
The following sections describe how to create a Sapera LT ++ application in Visual C++
2013/2015/2017/2019.
Visual Studio 2013/2015/2017/2019
Follow the steps below to compile and link an application that uses the Basic Classes:
• Include SapClassBasic.h in the program source code (it includes all other required headers)
• Add $(SAPERADIR)\Classes\Basic and $(SAPERADIR)\Include in Project | Properties | C/C++ |
General | Additional Include Directories
• If you are building a 32-bit application, insert
$(SAPERADIR)\Lib\Win32\SapClassBasic.lib in Project | Add Existing Item …
• If you are building a 64-bit application, insert
$(SAPERADIR)\Lib\Win64\SapClassBasic.lib in Project | Add Existing Item …
• In Project | Properties | C/C++ | Code Generation | Runtime Library, choose the option
Multi- threaded DLL (in release mode) or Multi-threaded Debug DLL (in debug mode)
Follow the additional steps below to compile and link an application that uses the GUI Classes:
• Include SapClassGui.h in the program source code (it includes all other required headers)
• Add $(SAPERADIR)\Classes\Gui in Project | Properties | C/C++ | General | Additional Include
Directories
• If you are building a 32-bit application, insert
$(SAPERADIR)\Lib\Win32\VS2013\SapClassGui.lib (or
VS2015/VS2017/2019) and
SapClassGuiD.lib in Project | Add Existing Item …
• If you are building a 64-bit application, insert
$(SAPERADIR)\Lib\Win64\VS2013\SapClassGui.lib (or
VS2015/VS2017/2019) and
SapClassGuiD.lib in Project | Add Existing Item …
• In Project | Properties | General, select Not Set for Character Set
• In Project | Properties | General for SapClassGui.lib, select Excluded From Build for
Debug
• In Project | Properties | General for SapClassGuiD.lib, select Excluded From Build for
Release
----------------------------------
**Here is the code that I am using.**
```
#include "SapClassGui.h"
#include "conio.h"
#include "SapClassBasic.h"
// Transfer callback function is called each time a complete frame is transferred
void XferCallback(SapXferCallbackInfo* pInfo)
{
// Display the last transferred frame
SapView* pView = (SapView*)pInfo->GetContext();
pView->Show();
}
// Example program
int main()
{
// Allocate acquisition object
SapAcqDevice* pAcq = new SapAcqDevice("Genie_M640_1", FALSE);
// uses camera default settings
//new SapAcqDevice("Genie_M640", "MyCamera.ccf");//loads configuration file
// Allocate buffer object, taking settings directly from the acquisition
SapBuffer* pBuffer = new SapBuffer(1, pAcq);
// Allocate view object to display in an internally created window
SapView* pView = new SapView(pBuffer, (HWND)-1);
// Allocate transfer object to link acquisition and buffer
SapAcqDeviceToBuf* pTransfer = new SapAcqDeviceToBuf(pAcq,pBuffer, XferCallback, pView);
// Create resources for all objects
BOOL success = pAcq->Create();
success = pBuffer->Create();
success = pView->Create();
success = pTransfer->Create();
// Start a continuous transfer (live grab)
success = pTransfer->Grab();
printf("Press any key to stop grab\n");
getch();
// Stop the transfer and wait (timeout = 5 seconds)
success = pTransfer->Freeze();
success = pTransfer->Wait(5000);
printf("Press any key to terminate\n");
getch();
// Release resources for all objects
success = pTransfer->Destroy();
success = pView->Destroy();
success = pBuffer->Destroy();
success = pAcq->Destroy();
// Free all objects
delete pTransfer;
delete pView;
delete pBuffer;
delete pAcq;
return 0;
}
```
-----------------------------------
**However, I am still encountering errors when attempting to build the project. I have experimented with different types of Visual Studio projects, such as empty project, console app, and Windows app, but each attempt results in errors.**
----------------------------------
Build started at 15:59...
1>------ Build started: Project: Project1, Configuration: Debug
x64 ------
1>Source.cpp
1>C:\Program Files\Teledyne
DALSA\Sapera\Classes\Gui\SapClassGui.h(36,1): error C1189:
#error: The
project option "General | Microsoft Foundation
Classes" must be "Use MFC in a shared DLL"
1>(compiling source file 'Source.cpp')
1>Done building project "Project1.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0
skipped ==========
---------------------------------------
**After that, I changed the option from 'Standard Windows Library' to 'Use MFC in a Shared DLL' in the properties,and built the project again. Then, I encountered the following problems**
---------------------------------------
Error C2504 'CRectTracker': base class undefined Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 16
Error C2061 syntax error: identifier 'CRect' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 21
Error C3646 'm_LimitRect': unknown override specifier Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 24
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 24
Error C2061 syntax error: identifier 'CWnd' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 35
Error C2061 syntax error: identifier 'CWnd' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 36
Error C2535 'CImageWnd::CImageWnd(SapView *)': member function already defined or declared Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 36
Error C2061 syntax error: identifier 'CPoint' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 40
Error C3646 'TranslateMousePos': unknown override specifier Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 41
Error C2059 syntax error: '(' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 41
Error C2238 unexpected token(s) preceding ';' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 41
Error C3646 'TranslatePos': unknown override specifier Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 42
Error C2059 syntax error: '(' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 42
Error C2238 unexpected token(s) preceding ';' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 42
Error C3646 'UntranslatePos': unknown override specifier Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 43
Error C2059 syntax error: '(' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 43
Error C2238 unexpected token(s) preceding ';' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 43
Error C2061 syntax error: identifier 'CPoint' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 54
Error C3646 'GetPixelString': unknown override specifier Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 58
Error C2065 'pBuffer': undeclared identifier Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 58
Error C2275 'SapBuffer': expected an expression instead of a type Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 58
Error C2065 'CPoint': undeclared identifier Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 58
Error C2146 syntax error: missing ')' before identifier 'point' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 58
Error C2238 unexpected token(s) preceding ';' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 58
Error C3646 'GetPixelString': unknown override specifier Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 59
Error C2059 syntax error: '(' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 59
Error C2238 unexpected token(s) preceding ';' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 59
Error C3646 'GetSelectedRoi': unknown override specifier Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 64
Error C2059 syntax error: '(' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 64
Error C2238 unexpected token(s) preceding ';' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 64
Error C2061 syntax error: identifier 'CRect' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 65
Error C3646 'ValidateRoi': unknown override specifier Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 77
Error C2059 syntax error: '(' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 77
Error C2238 unexpected token(s) preceding ';' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 77
Error C2143 syntax error: missing ';' before '*' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 82
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 82
Error C2238 unexpected token(s) preceding ';' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 82
Error C2143 syntax error: missing ';' before '*' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 83
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 83
Error C2238 unexpected token(s) preceding ';' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 83
Error C2143 syntax error: missing ';' before '*' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 84
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 84
Error C2238 unexpected token(s) preceding ';' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 84
Error C2143 syntax error: missing ';' before '*' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 85
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 85
Error C2238 unexpected token(s) preceding ';' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 85
Error C3646 'm_ViewRect': unknown override specifier Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 88
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 88
Error C3646 'm_roi': unknown override specifier Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 90
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 90
Error C2039 'm_nStyle': is not a member of 'CSapRectTracker' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageWnd.h 61
Error C3646 'm_rcInView': unknown override specifier Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 69
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 69
Error C3646 'm_rcAnchors': unknown override specifier Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 70
Error C2143 syntax error: missing ',' before '[' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 70
Error C2238 unexpected token(s) preceding ';' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 70
Error C3646 'm_penROI': unknown override specifier Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 72
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 72
Error C3646 'm_brushROI': unknown override specifier Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 73
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 73
Error C3646 'm_penAnchor': unknown override specifier Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 74
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 74
Error C3646 'm_brushAnchor': unknown override specifier Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 75
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 75
Error C2504 'CStatic': base class undefined Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 82
Error C2144 syntax error: 'CImageExWnd' should be preceded by ';' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 86
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 86
Error C2061 syntax error: identifier 'CPoint' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 116
Error C2061 syntax error: identifier 'CRect' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 117
Error C2535 'void CImageViewportWnd::SetROI(void)': member function already defined or declared Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 117
Error C2061 syntax error: identifier 'CPoint' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 125
Error C2061 syntax error: identifier 'CRect' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 126
Error C2535 'void CImageViewportWnd::GetROI(void) const': member function already defined or declared Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 126
Error C3646 'GetPixelString': unknown override specifier Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 131
Error C2059 syntax error: '(' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 131
Error C2238 unexpected token(s) preceding ';' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 131
Error C2061 syntax error: identifier 'CPoint' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 146
Error C2061 syntax error: identifier 'CPoint' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 150
Error C2061 syntax error: identifier 'CPoint' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 153
Error C2061 syntax error: identifier 'CPoint' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 154
Error C3646 'TranslatePointToNativeView': unknown override specifier Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 168
Error C2059 syntax error: '(' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 168
Error C2238 unexpected token(s) preceding ';' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 168
Error C3646 'TranslatePointToDestinationView': unknown override specifier Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 169
Error C2059 syntax error: '(' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 169
Error C2238 unexpected token(s) preceding ';' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 169
Error C3646 'GetDstRectFromCurrentScalingOptions': unknown override specifier Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 172
Error C2059 syntax error: '(' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 172
Error C2238 unexpected token(s) preceding ';' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 172
Error C3646 'afx_msg': unknown override specifier Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 180
Error C3646 'BOOL': unknown override specifier Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 180
Error C3646 'OnEraseBkgnd': unknown override specifier Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 180
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 180
Error C2059 syntax error: '(' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 180
Error C2144 syntax error: 'void' should be preceded by ',' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 181
Error C2143 syntax error: missing ')' before ';' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 181
Error C2238 unexpected token(s) preceding ';' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 181
Error C2144 syntax error: 'void' should be preceded by ';' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 182
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 182
Error C3646 'BOOL': unknown override specifier Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 183
Error C3646 'OnMouseWheel': unknown override specifier Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 183
Error C2059 syntax error: '(' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 183
Error C2238 unexpected token(s) preceding ';' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 183
Error C2144 syntax error: 'void' should be preceded by ';' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 184
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 184
Error C2061 syntax error: identifier 'CPoint' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 184
Error C2144 syntax error: 'void' should be preceded by ';' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 185
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 185
Error C2061 syntax error: identifier 'CPoint' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 185
Error C2144 syntax error: 'void' should be preceded by ';' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 186
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 186
Error C2061 syntax error: identifier 'CPoint' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 186
Error C2144 syntax error: 'void' should be preceded by ';' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 187
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 187
Error C2061 syntax error: identifier 'CPoint' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 187
Error C3646 'BOOL': unknown override specifier Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 188
Error C3646 'OnSetCursor': unknown override specifier Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 188
Error C2059 syntax error: '(' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 188
Error C2238 unexpected token(s) preceding ';' Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 188
Error C1003 error count exceeds 100; stopping compilation Project1 C:\Program Files\Teledyne DALSA\Sapera\Classes\Gui\ImageViewportWnd.h 188
-------------------------------------------------------------------
**If you know of a better way to build this project or can simplify the steps to build and run it without errors, or even suggest modifications to the code, I would greatly appreciate it.** |
in my work I use both STATA and R. Currently I want to perform a dose-response meta-analysis and use the "dosresmeta" package in R. The following syntax is used:
```
DRMeta \<- dosresmeta(
formula = logRR \~ dose,
type = type,
cases = n_cases,
n = n,
lb = RR_lo,
ub = RR_hi,
id = ID,
data = DRMetaAnalysis
)
```
When executing this syntax, however, I encounter a problem. The error message appears:
`Error in if (delta \< tol) break : missing value where TRUE/FALSE needed.`
The reason for this error message is that I am missing some values for the variables "n_cases" and "n", which the authors have not provided. Interestingly, STATA does not require this information for the calculation of the dose-response meta-analysis.
Is there a way to perform the analysis in R without requiring the values for "n_cases" and "n"? What can I do if I have not given these values?
I have already asked the authors for the missing values, unfortunately without success. However, I need these studies for the dose-response meta-analysis, so it is not an option to exclude them.
Best regards
David |
"dosresmeta" package: Dealing with missing values in n and cases |
|missing-data|meta-analysis| |
null |
I am trying (inside Jupyter notebook) to connect mysql database using a Python client.
inside a jupyter notebook, I type the following code:
import mysql.connector as connector
connection=connector.connect(user="your_username",
password="your_password")
I then receive a massive error message as shown in the attached pictures.
I have no idea what I am doing wrong here, and what is more strange is that 3 weeks ago, I wrote the exact same code, and it worked perfectly.
[![enter image description here][1]][1]
[![enter image description here][2]][2]
I've tried uninstalling and reinstalling Jupyter, and the mysql-connector API.
I've tried searching around the web to find someone else who had the same issue, but it seems like no one has had this issue in Jupyter notebook.
[1]: https://i.stack.imgur.com/VxWxg.png
[2]: https://i.stack.imgur.com/wDjh2.png |
|python|mysql|mysql-python|mysql-connector| |
I would like to get the full page https://icomarks.ai/icos/ when scrolling down while clicking `Show More` button. It should show around 8000 elements.
The `Show More` button activates a POST request `'https://icomarks.ai/icos/ajax_more'`.
I tried both
```
import requests
from bs4 import BeautifulSoup
with requests.Session() as session:
req = session.get('https://icomarks.ai/icos/')
req = session.post('https://icomarks.ai/icos/ajax_more')
req = session.post('https://icomarks.ai/icos/ajax_more') # just for a couple
soup = BeautifulSoup(req.content, "html.parser")
```
and
```
import requests
from bs4 import BeautifulSoup
s = requests.Session()
t=s.post('https://icomarks.ai/icos/')
r=s.get('https://icomarks.ai/icos/ajax_more')
r=s.get('https://icomarks.ai/icos/ajax_more') # just for a couple
soup = BeautifulSoup(r.content, "html.parser")
```
with no success.
I expect that `soup.find_all('a', class_="icoListItem__title")` should find the elements in the list that must be loaded:
```
[<a class="icoListItem__title" href="/ico/5th-scape">5th Scape <sup class="sup_is_premium">★ Promoted</sup> <sup class="sup_views">128 Views</sup>
</a>,
<a class="icoListItem__title" href="/ico/pood-inu">Pood INU <sup class="sup_is_premium">★ Promoted</sup> <sup class="sup_views">330 Views</sup>
</a>,
<a class="icoListItem__title" href="/ico/etuktuk">eTukTuk <sup class="sup_is_premium">★ Promoted</sup> <sup class="sup_views">794 Views</sup>
...
```
|
Don't use boolean indexing. Rather set "A" as index:
```
ddd = {
'A': ['a', 'b', 'c', 'd'],
'X': [100.0, 20.0, 5.0, 2.0],
'Y': [6.0, 2.0, 1.0, 1.0]
}
df = pd.DataFrame(ddd).set_index('A')
lst = [('a', 'b'), ('c', 'd')]
out = [df.loc[x]/df.loc[y] for x, y in lst]
```
Output:
```
[X 5.0
Y 3.0
dtype: float64,
X 2.5
Y 1.0
dtype: float64]
```
Or, index all combinations at once:
```
df = pd.DataFrame(ddd).set_index('A')
lst = [('a', 'b'), ('c', 'd')]
x, y = map(list, zip(*lst))
out = (df.loc[x].div(df.loc[y].values)
.set_axis(lst)
)
```
Output:
```
X Y
(a, b) 5.0 3.0
(c, d) 2.5 1.0
```
`df`:
```
X Y
A
a 100.0 6.0
b 20.0 2.0
c 5.0 1.0
d 2.0 1.0
```
*NB. I'm assuming letters in "A" are unique.*
If you have missing values,`reindex`:
```
ddd = {
'A': ['a', 'b', 'c'],
'X': [100.0, 20.0, 5.0],
'Y': [6.0, 2.0, 1.0]
}
df = pd.DataFrame(ddd).set_index('A')
lst = [('a', 'b'), ('c', 'd')]
x, y = map(list, zip(*lst))
out = (df.reindex(x).div(df.reindex(y).values)
.set_axis(lst)
)
X Y
(a, b) 5.0 3.0
(c, d) NaN NaN
``` |
|javascript|css|frontend|backend|z-index| |
I have this documents:
[ { id: 1 }, {id: 2}, {id: 3} ]
I want to transform that into:
{ ids: [1, 2, 3] }
or
[1, 2, 3]
Which is the most efficient pipeline for that?
Thanks!
|
MongoDB aggregation: transform list of documents into list |
|mongodb|aggregation-framework| |
this is a simple dashboard in tailwind, the preview can be seen https://play.tailwindcss.com/zagBiwZRbK
<div class="flex w-full bg-white">
<sidebar class="flex h-screen w-64 flex-col justify-between rounded-md transition duration-150 ease-in-out">
<div class="grow bg-white">
<div class="flex items-center justify-between px-2 py-5">
<div class="mr-5 flex items-center">
<div class="mr-5">
<div class="relative inline-block shrink-0 cursor-pointer rounded-[.95rem]"></div>
</div>
<div class="mr-2"><a href="javascript:void(0)" class="dark:hover:text-primary hover:text-primary text-secondary-inverse text-[1.075rem] font-medium transition-colors duration-200 ease-in-out dark:text-neutral-400/90" target="_blank">sidebar</a><span class="text-secondary-dark block text-[0.85rem] font-medium dark:text-stone-500"></span></div>
</div>
</div>
<div class="w-56 px-2">
<div class="my-2 rounded-lg bg-[#dce3ef40]"></div>
</div>
</div>
</sidebar>
<div class="flex h-full h-screen w-full flex-col border-l border-gray-200 bg-gray-100">
<nav class="fixed w-full border-b bg-white/30 px-16 py-4 backdrop-blur-sm">
<div class="flex items-center justify-between" style="">
<h2 class="font-semibold text-slate-900">dataset</h2>
<div class="flex space-x-4">
<div class="dark:highlight-white/10 group relative rounded-md dark:bg-slate-700 dark:focus-within:bg-transparent">
<input type="text" aria-label="Filter" placeholder="Filter..." class="w-full appearance-none rounded-md bg-transparent py-2 pl-10 text-sm leading-6 text-slate-900 shadow-sm ring-1 ring-slate-200 placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-blue-500 dark:focus:ring-2" />
</div>
<div class="flex space-x-5">
<a class="group flex items-center rounded-md bg-blue-500 py-2 pl-2 pr-3 text-sm font-medium text-white shadow-sm hover:bg-blue-400"
> Add</a
>
</div>
</div>
</div>
</nav>
</div>
</div>
the problem in this code is in the <nav> header of main container (a fixed menu), the filter input and add button is partially hidden as shown below. if the header is not fixed, then it will show normally again.
[![enter image description here][1]][1]
if I remove the <sidebar> tag, the filter input and button can display in the right way.
[![enter image description here][2]][2]
how would I fix it when sidebar and main are both in the container, the header in the main container has to be fixed position.
[1]: https://i.stack.imgur.com/iUGnU.png
[2]: https://i.stack.imgur.com/cZeop.png |
I wanted to control a Sony camera and I looked at the [Sony IRLib2 code][1] for how to generate those for [cpx-ir-shutter-remote.py][2]. There's [Samsung code][3] in IRLib2 too which should be useful as a basis for your code.
[1]: https://github.com/cyborg5/IRLib2/blob/master/IRLibProtocols/IRLib_P02_Sony.h
[2]: https://github.com/kevinjwalters/circuitpython-examples/blob/master/cpx/cpx-ir-shutter-remote.py
[3]: https://github.com/cyborg5/IRLib2/blob/master/IRLibProtocols/IRLib_P08_Samsung36.h |
- Delete modal -->
- - - - - - <div id="deleteModal" class="hidden fixed flex top-0 left-0 w-full h-full items-center justify-center bg-black bg-opacity-50">
- - - - - - <div class="bg-white p-5 rounded-lg text-center">
- - - - - - <h2 class="mb-4">Are you sure you want to delete?</h2>
- - - - - - <button id="confirmDelete" class="mr-2 px-4 py-2 bg-yellow-400 hover:bg-yellow-500 text-white rounded">Yes</button>
- - - - - - <button id="cancelDelete" class="px-4 py-2 bg-gray-300 text-black rounded">No</button>
- - - - - - </div>
- - - - - - </div>
-
- - - - - - <script>
- document.getElementById('deleteButton').addEventListener('click', function() {
- document.getElementById('deleteModal').classList.remove('hidden');
- - - - - - });
-
- document.getElementById('cancelDelete').addEventListener('click', function() {
- document.getElementById('deleteModal').classList.add('hidden');
- - - - - - });
-
- document.getElementById('confirmDelete').addEventListener('click', function() {
- Handle the deletion here
- console.log('Deleting...');
- - - - - - });
- - - - - - </script>
-
- DELETE employees
- Router::post('/hr/employees/delete', function () {
- - - - - - $db = Database::getInstance();
- - - - - - $conn = $db->connect();
-
- - - - - - $idToDelete = $_POST['id'];
-
- - - - - - $query = "DELETE FROM employees, employment_info, account_info, salary_info, tax_info, benefit_info WHERE id = :id";
- - - - - - $stmt = $conn->prepare($query);
- - - - - - $stmt->execute([':id' => $idToDelete]);
-
- Execute the statement
- - - - - - $stmt->execute();
-
- - - - - - $rootFolder = dirname($_SERVER['PHP_SELF']); header("Location: $rootFolder/hr/applicants");
- - - - - - });` |
How do I integrate an existing delete function that is located in my routes.php file to a delete button in a modal in my hr.employees.profile.php? |
|javascript|php|html|forms|tailwind-css| |
null |
I am creating a new file by the name of elastic_ip.tf with the below codes on it. I will be using a private IP for [associate_with_private_ip]
```
resource "aws_eip" "Test_elastic_ip" {
domain = "vpc"
network_interface = aws_network_interface.Test_eip.id
associate_with_private_ip = "0.0.0.0"
depends_on = ["aws_internet_gateway.Test_igw", "aws_instance.Test"]
tags = {
Name = "Test_elastic_ip"
}
}
```
However, when I run the plan command, I am getting an error.
Please check the below error, what I am getting.
```
Warning: Quoted references are deprecated
│
│ on elastic_ip.tf line 7, in resource "aws_eip" "Test_elastic_ip":
│ 7: depends_on = ["aws_internet_gateway.Test_igw", "aws_instance.Test"]
│
│ In this context, references are expected literally rather than in quotes. Terraform 0.11 and earlier required quotes, but quoted references are now deprecated and will be removed in a
│ future version of Terraform. Remove the quotes surrounding this reference to silence this warning.
│
│ (and one more similar warning elsewhere)
╵
╷
│ Error: Reference to undeclared resource
│
│ on elastic_ip.tf line 7, in resource "aws_eip" "Test_elastic_ip":
│ 7: depends_on = ["aws_internet_gateway.Test_igw", "aws_instance.Test"]
│
│ A managed resource "aws_instance" "Test" has not been declared in the root module.
╵
```
I checked few blogs and tried to add multiple resources for the depends_on, but still no luck.
Any suggestion would be a help. |
Tab Validation in Flutter |
|flutter|dart| |
null |
|vertica|fileloadexception| |
here is my code
**this code not work on safari.**
targetPosition i set the scroll value, for example , 11 , 22, 33 , where i scroll
```
function ScrollToActiveTab(item, id, useraction) {
if (item !== null && item !== undefined && useraction) {
dispatch(addCurrentMenu(item));
}
requestAnimationFrame(() => {
// Ensure this runs after any pending layout changes
var scrollableDiv = document.getElementById('scrollableDiv');
let tempId = 'targetId-' + id;
var targetElement = document.getElementById(tempId);
if (targetElement) {
var targetPosition = targetElement.offsetLeft + targetElement.clientWidth / 2 - window.innerWidth / 2;
// Perform the scroll
scrollableDiv.scrollLeft = targetPosition;
}
});
}
```
Please guide my why ° scrollableDiv.scrollLeft = targetPosition;° not work on safari. Thanks
i want work scrollableDiv.scrollLeft = targetPosition , in safari also
see attachment , i have a menu list once i click i update tragetPosition
[menu Tab ][1]
[1]: https://i.stack.imgur.com/qzkGa.png |
- Use `REDUCE` to iterate through the string
- Find the number of `-`s by (REGEX)REPLACing all characters that are not `-`( `[^-]`) with nothing and calculate the remaining `LEN`gth of the string. This is the number of times we need to iterate.
- In each iteration, we use `REGEXEXTRACT` using
- regex `"(.*?,)([^,]+)-([^,]+)(.*$)"` to get
- Capture group #1: `(.*?,)` - get `p`revious match ending with `,`, i.e., `1,2,`
- Capture group #2: `(\d+)` - get `s`tarting ``d``igit before the `-`, i.e., `4`
- Literal `-`
- Capture group #3: `(\d+)`- get `e`nding digit after the `-`, i.e., `10`
- Capture group #4: `(.*$)` - get remaining `s`u`f`ix until end of string `$`, i.e., `,12,15-19`
- Create the `SEQUENCE` of numbers between `s`tarting and `e`nding digit and `JOIN` the `p`refix and `s`u``f``fix.
- Repeat the above until all dashes are removed.
```
=REDUCE(
A1,
SEQUENCE(LEN(REGEXREPLACE(A1,"[^-]",))),
LAMBDA(
a,c,
LET(
res,REGEXEXTRACT(a,"(.*?,)(\d+)-(\d+)(.*$)"),
i, LAMBDA(i, INDEX(res,i)),
p,i(1),
s,i(2),
e,i(3),
sf,i(4),
p&JOIN(",",SEQUENCE(e-s+1,1,s))&sf
)
)
)
``` |
I want to create a delivery service bot. So, in one step I need to collect multiple data from user, like - user email, phone number, package weight, height etc. Now using slot-filling is cumbersome. Because , user may get frustrated answering the questions one by one when they can fillup a form instead.
Now, is it possible to integrate form in dialogflow cx? I have been looking for it for weeks.
I even tried to integrate using webhook .
Thank you.
I searched for google form integration with dialogflow cx but I did not find any. There is no custom payload to get user input by form as to my knowledge.
I even tried to integrate form using webhook. I wrote a simple form code and then deployed it using flask and ngrok, Then, I used that webhook.
But the custom payload is not showing in dialogflow messenger. However, I can see the response in json format. |
Multiple resources for the depends_on dependencies is throwing an Error |
|terraform|terraform-provider-aws| |
null |
In a dictionary in Python, if you have items with the same keys, they just get overwritten by further items, so in your dict finally you could only have 1 item with the key "A".
My suggestion to you is to try to get all that in a single expression, and simply parse that, so 1 item is key, next is data, next is key and so on.
You can do that simply by replacing ":" with ",", as I did in the following code
```
array = ("A", "Red", "A", "Blue", "A", "Green", "B", "Yellow", "C", "Black", "B", "smth")
def parse_dictionary(array):
dictionary = {}
for item_key, item in zip(array[::2], array[1::2]):
if item_key in dictionary:
if type(dictionary[item_key]) == list:
dictionary[item_key].append(item)
else:
a = dictionary[item_key]
dictionary[item_key] = [a, item]
else:
dictionary[item_key] = item
return dictionary
```
|
I was hoping str.count would have a `consecutive=False` keyword, but it doesn't. So I came up with this, very likely suboptimal and slow, method, whose major selling point is its use of only one loop:
```python
>>> s='111aaaaaaaabbbdccc5555555555s'
>>> while s:
... n = s.lstrip(s[0:1])
... print('%s: %d' % (s[0:1], len(s) - len(n)))
... s = n
...
1: 3
a: 8
b: 3
d: 1
c: 3
5: 10
s: 1
``` |
I am completely new to android studios and have found it to be quite bulky and tried to do it on vscode. I don't know how to proceed from this . [enter image description here](https://i.stack.imgur.com/4naSd.png)
I am also having a problem regarding the sdk path
[enter image description here](https://i.stack.imgur.com/iZaqS.png)
So far I am confused as to how to proceed |
Android studios in vscode |
|java|android| |
null |
#include <stdio.h>
#define N 10
int main() {
int a[N], i, pos;
printf("\n\nΕισαγωγή 10 ακεραίων\n");
for (i=0; i<N; i++) {
printf("%2d : ", i+1);
scanf("%d", &a[i]);
}
pos = 0;
for (i=1; i<N; i++) {
if (a[pos] < a[i]){
pos = i;
}
}
printf("\n\nΗ μέγιστη τιμή είναι %d και βρέθηκε στη θέση %d\n\n", a[pos],pos+1);
return 0;
}
This is the program/code that is found in my e-class' lectures.
The thing that literally makes no sense for me, first of all, is the `i++` as "change condition" in the two `for` loops. Normally/logically it is to be expected to add `pos` I twice until it reaches N, since we have two `for` loops and the `i+1` of printf in the first `for` loop which is also repeated and should be also repeated. Logically, doesn't that add the position-variable `i` thrice in the program every time? Logically this is the thing is must do but when I run it this actually doesn't happen and it operates as we want it/expect it to.
Furthermore, I have queries about `a[pos]`. At the start it is `a[0]` and with `pos+1`. Since there is no position 0 and we start from `i+1` with the printf function then what is the position 0 and what is its value? Is `i=1` the position 0? Furthermore since we got `pos=i` then why does the final printf to print one position after this with `pos+1`? Considering that every time `a[pos]` is smaller than `a[i]` the position becomes equal with `i`. |
fixed menu in tailwind not displaying well |
|css|tailwind-css| |
To get random records without duplication using Laravel's `inRandomOrder()` method, you can use `distinct()` method to get unique records
$questions = Question::inRandomOrder()
->limit(50)
->distinct()
->get(); |
{"OriginalQuestionIds":[53444574],"Voters":[{"Id":6752050,"DisplayName":"273K","BindingReason":{"GoldTagBadge":"c++"}}]} |
Here is the producer code:
```js
import * as amqp from "amqplib";
export default class Producer {
channel;
async createChannel() {
const connection = await amqp.connect("amqp://localhost");
this.channel = await connection.createChannel();
}
async publishMessage(routingKey, message) {
if (!this.channel) {
console.log("called");
await this.createChannel();
}
const exchangeName = "loggerEx";
await this.channel.assertExchange(exchangeName, "direct");
const logDetails = {
logType: routingKey,
message: message,
dateTime: new Date(),
};
await this.channel.publish(
exchangeName,
routingKey,
Buffer.from(JSON.stringify(logDetails))
);
console.log(`The new ${routingKey} log is sent to exchange ${exchangeName}`);
}
}
```
Here is how I am using `Producer` class:
**server.js**
```js
import Producer from "./producer.js";
const producer = new Producer();
producer.publishMessage("info", "somemessage");
producer.publishMessage("info", "somemessage");
```
In RabbitMQ management UI, I see two connections:
[![enter image description here][1]][1]
In `Producer` class I am checking for the existence of the channel.
```js
if (!this.channel) {
console.log("called");
await this.createChannel();
}
```
then why connection is being created multiple times.
Here is the output when I run the file:
```bash
$ node server.js
called
called
The new info log is sent to exchange loggerEx
The new info log is sent to exchange loggerEx
```
[1]: https://i.stack.imgur.com/GqYYh.png |
this is what you need to do. referring to ankushlokhande answer
keep in mind to change these parts to adapt to your code needs
` Navigator.pushNamed(context, LoginPage.routeName);
`
child: Row(
children: [
GestureDetector(
onTap: () {
Navigator.pushNamed(context, LoginPage.routeName);
},
child: const CircleAvatar(
radius: 20,
backgroundImage: NetworkImage(
'https://i1.sndcdn.com/artworks-79AS3zNyDuB420uC-pKTA2w-t500x500.jpg'),
),
),
const SizedBox(
width: 10,
),
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
'Welcome Back!',
style: TextStyle(
fontSize: 13,
fontWeight: FontWeight.w400,
color: Colors.black87),
),
GestureDetector(
onTap: () {
Navigator.pushNamed(context, LoginPage.routeName);
},
child: Text('Guest',
style: TextStyle(
fontSize: 19,
fontWeight: FontWeight.w600,
color: Colors.black87)),
),
],
),
],
),
),
forceMaterialTransparency: true,
), |
The accepted answer reinterpreted the question [XY Problem](https://xyproblem.info/) style, which turned out to be the right thing for the OP. Good for them. However, I suspect most people finding this question are looking for approaches to parsing an URL within an actual shell script (unspecified which shell, but I'll be assuming something like `bash`).
Most other answers focus on doing this parsing entirely using built-in shell mechanisms, or POSIX standard tools such as sed. In many situations I think the best approach would be to depend on an external tool which handles the nitty-gritty of URL parsing, while integrating well with a shell script workflow.
The choice of tool would probably depend on use case and intended audience. Here are some alternatives. Expecting the URL to live in `$URL` here.
## Using Perl
Perl is a nice option as it is pretty ubiquitous.
```perl
perl -mURI -E 'say URI->new(@ARGV[0])->path()' -- "$URL"
```
* Change `path()` to `username()`, `host()` or other methods available [here](https://metacpan.org/pod/URI#SERVER-METHODS).
* Use `print` instead of `say` to omit the final newline.
## Using Python
```python
python3 -c 'import sys, urllib.parse; print(urllib.parse.urlparse(sys.argv[1]).path)' "$URL"
```
* See [here](https://docs.python.org/3/library/urllib.parse.html) for other methods available on the parsed URL
* Use `sys.stdout.write` instead of `print` to omit the final newline
## Using Node.js
```js
node -e "console.log(new URL(process.argv[1]).pathname)" "$URL"
```
* See [here](https://nodejs.org/api/url.html#the-whatwg-url-api) for other methods available on the parsed URL
* Use `process.stdout.write` instead of `console.log` to omit the final newline
## Using trurl
[trurl](https://github.com/curl/trurl), sharing code with the `curl` URL fetching utility, is a nice option if requiring a custom tool is acceptable.
```
trurl "$URL" -g '[host]'
```
|
I'm coding a program to find perfect numbers. I have found some interesting properties and worked on my code to generate perfect numbers. This is my idea:
```
static List<int> TesterPerfectNumber(int upperbound)
{
List<int> nums = new List<int>();
for (int i = 2; i < upperbound; i++)
{
if (IsPrime(i))
{
int mersenneNumber = (int)Math.Pow(2, i) - 1;
if (IsPrime(mersenneNumber))
{
int perfectNumber = (int)Math.Pow(2, i - 1) * mersenneNumber;
nums.Add(perfectNumber);
}
}
}
return nums;
}
```
The output is correct for the first 4 perfect numbers, however I don't know why it failed on the 5th and outputted negative numbers (with `foreach (int j in TesterPerfectNumber(20)){Console.WriteLine(j);}`):
[](https://i.stack.imgur.com/WWL4d.png)
I suspect the bug is in my algorithm, but the alternative form of finding perfect numbers is (2^(p-1))*(2^p - 1) with p and 2^p-1 being primes. Also, I have already found another way to find perfect numbers but consumes more storage and time, basically looping and finding factors of all positive numbers and adding up until it reaches the upperbound limit.
Can you help me debug the code or come up with another reasonable solution to my code? Or are there any limits to the `List<T>` or `int` that I haven't taken into consideration? Please help me and thanks. |
In accountsList.vue i call the following script where i commented a lot out because im doing a serious refactor and i wanted to isolate the problem. "balance" has a proper value and is set, i checked.
<script setup>
import Account from "@/Pages/Partials/AccountItem.vue";
import {UseAccountsStore} from "@/Stores/UseAccountsStore.js"
const props = defineProps({
editMode: Boolean,
balance: Object
})
const accountsStore = UseAccountsStore();
// console.log(props.balance)
accountsStore.balance = props.balance;
accountsStore.getAccounts()
// const balanceStore = UseBalanceStore()
// const balanceItemsStore = UseCategoryItemsStore()
function update() {
// accountsStore.getTotal()
// balanceStore.getGrandTotal()
}
This is my UseAccountsStore
import {defineStore} from "pinia";
import {ref} from "vue";
export const UseAccountsStore = defineStore('AccountStore', () => {
const balance = ref(null)
const accounts = ref([])
const total = ref(0)
function getAccounts() {
console.log(balance);
axios.get(route('accounts.index', {'id': balance.value.id}))
.then((response) => accounts.value = response.data)
}
function getTotal() {
axios.get(route('accounts.total'))
.then((response) => total.value = response.data)
}
function addAccount(account) {
accounts.value.push(account)
}
return {accounts, total, getAccounts, getTotal, addAccount}
})
What i don't get is that my "console.log(balance);" returns an empty object. I tried to use a setter but that also results in a null value. Does anyone know why? What am i doing wrong?
Also:
axios.get(route('accounts.index', {'id': balance.value.id}))
.then((response) => accounts.value = response.data)
Gives the error
error:Uncaught (in promise) Error: Ziggy error: 'id' parameter is required for route 'accounts.index'
If i just hardcode "balance.value.id" everything works just fine |
I created database tables using EF and wanted to create foreign keys between FriendInvites.SenderUserId
FriendInvites.cs:
```
public class FriendInvites
{
[Key]
public int Id { get; set; }
//Foreign key to UserInfo userId
public string SenderUserId { get; set; } = string.Empty;
//Navigation property
public UserInfo SenderId { get; set; }
public string TargetUserId { get; set; } = string.Empty;
public UserInfo TargetId { get; set; }
}
```
and UserInfo.UserId
UserInfo.cs:
```
public class UserInfo
{
[Key]
public string UserId { get; set; } = string.Empty;
[Required]
public string UserName { get; set; } = string.Empty;
//Navigation property to GroupInvites
public ICollection<GroupInvites> GroupInvites;
//Navigation property to GroupsCreatorsList
public ICollection<GroupsCreatorsList> CreatorOfGroups;
//Navigation property to GroupMemberList
public ICollection<GroupMemberList> GroupMembers;
public ICollection<FriendInvites> SenderUsers;
public ICollection<FriendInvites> TargetUsers;
}
```
However, it didn't work as expected. I tried to create this foreign key in SQL Server Management Studio, but it also failed. Then I discovered that this was due to the data type mismatch; UserInfo.UserId was defined as nvarchar(450), while FriendInvites.SenderUserId was nvarchar(max). I changed the data type in SQL Server, which allowed me to create the foreign key successfully.
Subsequently, I attempted to explicitly specify the data type in the OnModelCreating() method:
```
modelBuilder.Entity<FriendInvites>()
.Property(e => e.SenderUserId).HasColumnType("nvarchar(450)");
modelBuilder.Entity<FriendInvites>()
.Property(e => e.TargetUserId).HasColumnType("nvarchar(450)");
```
But the column continued to be created as nvarchar(max). I'm unsure why this is happening, especially since everything worked perfectly before (I had created foreign keys in different tables that referenced the UserInfo.UserId primary key)."
Here is example of other class that have foreign key to UserInfo.UserId column:
```
public class GroupsCreatorsList
{
[Key]
public Guid GroupId { get; set; }
[Required]
public string GroupName { get; set; } = string.Empty;
//Foreighn key to UserInfo.UserId
public string CreatorId { get; set; } = string.Empty;
//Navigation property to UserInfo
public UserInfo Creator { get; set; }
//Navigation property to GroupInvites
public ICollection<GroupInvites> GroupInvites { get; set; }
//Navigation property to GroupMemberList
public ICollection<GroupMemberList> GroupMembers { get; set; }
}
```
and here is setup of foreign key:
```
modelBuilder.Entity<UserInfo>()
.HasMany(e => e.CreatorOfGroups)
.WithOne(e => e.Creator)
.HasForeignKey(e => e.CreatorId)
.IsRequired();
```
What you recommend me to do? |
The specified data type in the EF modelBuilder doesn't correspond to the one that is created |
|c#|sql-server|entity-framework-core|foreign-keys| |
null |
I want to create a 1.19 forge Minecraft Mod that shows a button with custom text that server-side dupes when the Furnace GUI is open, but the problem is that i can't get it to work! I also tried asking ChatGPT and Copilot, but still doesn't work. I haven't found tutorials on youtube, so can please someone post a code and clear instructions on how to use the code? (i'm using forge 39.0.5 for mc 1.19,java 17.0.1 and Intellij Idea as java IDE)
i tried asking AI's but didnt work, so can please someone hlep me create this mod that server-side dupes? i know no one's gonna answer because its too complicated, but atleast help me do that in single player |
I'm coding a program to find perfect numbers. I have found some interesting properties and worked on my code to generate perfect numbers. This is my idea:
```static List<int> TesterPerfectNumber(int upperbound)
{
List<int> nums = new List<int>();
for (int i = 2; i < upperbound; i++)
{
if (IsPrime(i))
{
int mersenneNumber = (int)Math.Pow(2, i) - 1;
if (IsPrime(mersenneNumber))
{
int perfectNumber = (int)Math.Pow(2, i - 1) * mersenneNumber;
nums.Add(perfectNumber);
}
}
}
return nums;
}
```
[](https://i.stack.imgur.com/WWL4d.png)
The output is correct for the first 4 perfect numbers, however I don't know why it failed on the 5th and outputted negative numbers (with `foreach (int j in TesterPerfectNumber(20)){Console.WriteLine(j);}`):
I suspect the bug is in my algorithm, but the alternative form of finding perfect numbers is (2^(p-1))*(2^p - 1) with p and 2^p-1 being primes. Also, I have already found another way to find perfect numbers but consumes more storage and time, basically looping and finding factors of all positive numbers and adding up until it reaches the upperbound limit.
Can you help me debug the code or come up with another reasonable solution to my code? Or are there any limits to the `List<T>` or `int` that I haven't taken into consideration? Please help me and thanks. |
This is possible with **static** fields. Because, interfaces cannot contains instance fields. Static fields are not instance fields.
public interface IMyDefault
{
private static string _name = "Yusif";
// Has default implementation
string Name
{
get
{
return _name;
}
set
{
_name = value;
}
}
// Hasn't default implementation
string Surname { get; set; }
}
public class MyDefault : IMyDefault
{
// We only implement Surname in MyDefault.cs
public string Surname { get; set; }
} |
I have made a register route with a docSchema registration using the register function of the class.
Now the problem is that upon registering on the frontend it does not throw any error but rather registers the data in my database but does not redirect to the login route. Rather, it throws the unauthorized 401 error and my login route shows the same upon logging in with the right details. What's strange is that the exact code was working before without any problem. Please help me with this issue.
```
const express = require("express");
const bodyParser = require("body-parser");
const ejs = require("ejs");
const mongoose = require("mongoose");
const session = require("express-session");
const passport = require("passport");
const passportLocalMongoose = require("passport-local-mongoose");
const app = express()
app.use(express.static("public"));
app.set("view engine","ejs");
app.use(bodyParser.urlencoded({
extended: true
}));
// ----- User Session ------
app.use(session({
secret: "anthonymnoasisaidp@$gdhdks.",
resave: false,
saveUninitialized: false
}))
// --------------------------
app.use(passport.initialize());
app.use(passport.session());
//------- Connecting MongoDB --------
mongoose.connect("mongodb://127.0.0.1/Doctors", {useNewUrlParser: true});
const docSchema = new mongoose.Schema({
name: String,
age: String,
qualifications: String,
exp: String,
email: String,
password: String
});
const patSchema = new mongoose.Schema({
name: String,
age: String,
sex: String,
bpm: Object,
medicines: Object,
past_rec: String,
ecg_analysis: Object
});
patSchema.plugin(passportLocalMongoose);
docSchema.plugin(passportLocalMongoose);
//--------doctor credentials collection---------------------
const doc = new mongoose.model("doctor_cred", docSchema);
passport.use(doc.createStrategy());
passport.serializeUser(doc.serializeUser());
passport.deserializeUser(doc.deserializeUser());
//------------------------------------------------------------
//------------patient collection details----------------------
const pat = new mongoose.model("patient_cred", patSchema);
passport.use(pat.createStrategy());
passport.serializeUser(pat.serializeUser());
passport.deserializeUser(pat.deserializeUser());
//------------------------------------------------------------
// ------Home Route---------
app.get("/",function(req,res){
res.render("index");
});
// ------ end ----------------
// ---------- Login Route -----
app.get('/login',function(req,res){
res.render("login");
})
app.post('/login',function(req,res){
const user = new doc({
username: req.body.username,
password: req.body.password
})
req.login(user, function(err){
if(err){
console.log(err);
}
else{
passport.authenticate("local")(req,res, function(){
res.redirect('/doctor-dashboard');
});
}
})
})
//--------end------------------
//------Register Route/ Doctors----------
app.get('/register',function(req,res){
res.render("register");
})
app.post('/register',function(req,res){
doc.register({username: req.body.username,name: req.body.name ,age: req.body.age ,qualifications: req.body.qualifications ,exp: req.body.exp}, req.body.password, function(err){
if (err){
console.log(err);
res.redirect("/register");
}
else{
passport.authenticate("local")(req,res, function(){
res.redirect("/login");
});
}
})
})
//---------end-------------------------
//------------doctor dashboard---------
app.get('/doctor-dashboard',function(req,res){
doc.findById(req.user.id)
.then(function(userfound){
if(userfound){
const name =userfound.name;
const age = userfound.age;
const qualifications = userfound.qualifications;
const exp = userfound.exp;
res.render('docdash', {name: name, age: age, qualifications: qualifications, exp: exp});
}
});
})
//--------------------------------------
//--------------doctor dashboard My Patients Route-----------
// app.get('/doctor-dashboard/My-Patients',function(req,res){
// });
app.get("/services",function(req,res){
res.render("services");
});
app.listen("5000",function(){
console.log("listening on port 5000");
});
```
|
Passport authentication showing unauthorized in node.js after registering the data successfully in my database? |
|node.js|mongodb|express|mongoose|passport.js| |
null |
I am using Auto focus mode and I want to get the current focal distance. I used `LENS_INFO_MINIMUM_FOCUS_DISTANCE`, and it was always showing 0.22 as I was moving the camera and changing the focal plane. Is there a way to check the current focal distance of the camera?
in my code I have:
float yourMinFocus = mCameraCharacteristics.get(CameraCharacteristics.LENS_INFO_MINIMUM_FOCUS_DISTANCE);
float yourMaxFocus = mCameraCharacteristics.get(CameraCharacteristics.LENS_INFO_HYPERFOCAL_DISTANCE);
Log.e("hello",String.valueOf(yourMinFocus3));
and it is continuously losing out 0.22 no matter how I changed the focal plane. |
Am I doing something wrong or is this a server problem? This hangs up the browser (Safari and Firefox under MACOS):
```
<!DOCTYPE html>
<HTML>
<BODY>
<?php
$qq = str_repeat("X",409998);
echo $qq;
?>
</BODY>
</HTML>
```
Running on Google's AppEngine, standard environment, PHP 8.2. If I shorten the string, it works fine. While the problem is consistent, if I play with the length of the string, I can get it to work with some longer strings. |
how to add the button onto the furnace GUI in minecraft |
|java|jar|minecraft|openai-api|mc| |
null |
|python|scipy|simulation|numerical-methods| |
Maximum value of an array questions |
Docusaurus maintainer here!
## Docusaurus >=2 (update 2021 Nov)
Add the CNAME file directly into the static folder. Refer to the docs - https://docusaurus.io/docs/deployment#docusaurusconfigjs-settings
## Docusaurus 1
You're right in saying that everything in `build` will be generated and you can't add custom files to it. What you can do is to add the `cname` field to `siteConfig.js` file as mentioned in the docs [here](https://docusaurus.io/docs/en/site-config#cname-string).
For Docusaurus docs: https://github.com/facebook/Docusaurus/blob/master/v1/website/siteConfig.js#L18
So for your case, you could add `cname: 'harrystylesheet.com'` to your `siteConfig.js`. |
I had a slightly different take on this
=IF(B1="","skipped",IF(B1=INDEX(A:A,COUNT(B$1:B1)),"match","difference"))
but I realise this will break after the blanks in column A and something more would be required like an mmult.
[![enter image description here][1]][1]
___
This was my thinking if the pattern continues like this, to use Mmult to find the next value in column A to compare:
=IF(B1="","skipped",IF(B1=INDEX(A:A,MATCH(COUNT(B$1:B1),
MMULT(IF(COLUMN($A$1:$J$1)<=ROW($A$1:$A$10),1,0),SIGN(A$1:A$10)),0)),
"match","difference"))
[![enter image description here][2]][2]
[1]: https://i.stack.imgur.com/ziRLL.png
[2]: https://i.stack.imgur.com/bgW0g.png |
I am working on search problem in prolog where agent whose goal is to get to some treasure. At each time step, the agent can move between rooms using doors arranged according to an undirected graph. However, some of the doors are locked, and the agent must acquire the appropriate key in order to pass through a locked door.
I worked on code, and code produces following actions "Actions = [move(0, 1), move(1, 3), move(3, 4), move(4, 2), move(2, 5), move(5, 6)]" but the supposed actions are: "Actions = [move(0, 1), move(1, 3), move(3, 4), move(4, 2), move(2, 5), move(5, 6)]."
code is:
initial(0).
door(0,1).
door(0,2).
door(1,2).
door(1,3).
door(2,4).
locked_door(2,5,red).
locked_door(5,6,blue).
key(3,red).
key(4,blue).
treasure(6).
initial_state(state(Pos, noKey, noKey)) :- % Initial position with no keys
initial(Pos).
% Moving without picking up a key or using a key
take_action(state(A, RedKey, BlueKey), move(A,B), state(B, RedKey, BlueKey)) :-
door(A,B).
take_action(state(A, RedKey, BlueKey), move(A,B), state(B, RedKey, BlueKey)) :-
door(B,A).
% Picking up a red key
take_action(state(A, noKey, noKey), move(A,B), state(B, hasKey(red), noKey)) :-
door(A,B),
key(B, red).
% Picking up a blue key
take_action(state(A, hasKey(red), noKey), move(A,B), state(B, hasKey(red), hasKey(blue))) :-
door(A,B),
key(B, blue).
% open locked doors
take_action(state(A, hasKey(red), hasKey(blue)), move(A,B), state(B, hasKey(red), hasKey(blue))) :-
locked_door(A,B,blue).
take_action(state(A, hasKey(red), hasKey(blue)), move(A,B), state(B, hasKey(red), hasKey(blue))) :-
locked_door(B,A,blue).
take_action(state(A, hasKey(red), hasKey(blue)), move(A,B), state(B, hasKey(red), hasKey(blue))) :-
locked_door(A,B,red).
take_action(state(A, hasKey(red), hasKey(blue)), move(A,B), state(B, hasKey(red), hasKey(blue))) :-
locked_door(B,A,red).
final_state(state(Pos, _, _)) :- treasure(Pos).
take_steps(S0, [Action], S1) :- take_action(S0, Action, S1).
take_steps(S0, [Action | Rest], SFinal) :-
take_action(S0, Action, SNew),
take_steps(SNew, Rest, SFinal).
search(Actions) :-
initial_state(S0),
length(Actions, _),
take_steps(S0, Actions, SFinal),
final_state(SFinal), !.
|
{"Voters":[{"Id":23239746,"DisplayName":"Lew Xin Yan"}],"DeleteType":1} |
An iteration represents a sequential user flow that you create with steps. Let's say you have three steps in the iteration. The second step starts running once the first step's response is received, a timeout occurs, or an error is encountered. You can configure the Ddosify Engine to run iterations in parallel, but the steps within an iteration will always run sequentially. The engine modes are designed to change the iteration creation strategy, which is unrelated to the execution of steps.
Unless an [assertion][1] is created, if all the requests in a single iteration receive responses, Ddosify marks the iteration as a successful run. Otherwise, it is marked as a failed run. You can alter this default behavior by creating custom logic based on the response time, headers, etc., by leveraging the assertion logic.
[1]: https://github.com/ddosify/ddosify/tree/master/engine_docs#assertion |
> To retrieve viewing statistics, popularity metrics, and demographic information for YouTube videos and channels, you use the YouTube Analytics API. The Sample API Requests page shows how to retrieve common reports from YouTube Analytics.
Got this from the Youtube Data API Documentation, you can try this
GET {base_URL}/activities?part=snippet,contentDetails&home=true
|
For me, it works by removing these folders and restarting the simulator.
Run this command on your terminal:
>run `rm -R ~/Library/Developer/CoreSimulator/Caches`
> run `rm -R ~/Library/Developer/Xcode/iOS\ DeviceSupport/`
> run `rm -R ~/Library/Developer/Xcode/DerivedData/`
|
You already got some working versions of your query in the other answers, but noone told you why your query is wrong.
**YOUR QUERY IS NOT WRONG!**
It is a bug in MySQL, appearing in MySQL 8.0.22, which could point to the condition pushdown optimization for derived tables which was added there and had [a lot of bugs similar to yours][1], see e.g. the [changelog for MySQL 8.0.30][2]:
> A number of issues with pushdown of conditions making use of outer references, relating to work done in MySQL 8.0.22 to implement condition pushdown for materialized derived tables, have been identified and resolved. (Bug #33725403, Bug #33725500, Bug #33725508, Bug #33725534, Bug #33725545)
Disabling that feature doesn't fix it, so it may be unrelated.
It is not yet fixed in MySQL 8.0.35, so you might want to file a bug report.
Nevertheless, running your query on MySQL 8.0.21 gives you the expected result.
[1]: https://bugs.mysql.com/bug.php?id=102251
[2]: https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-30.html |
The solution did not work for me. I got it working like this:
> @code {
> private DateOnly? _geboortedatum;
>
> private string GeboortedatumFormatted
> {
> get => _geboortedatum?.ToString("dd-MM-yyyy") ?? "";
> set
> {
> if (DateOnly.TryParse(value, out var newDate))
> {
> _geboortedatum = newDate;
> }
> }
> } }
>
> <div class="col-3">
> <div class="form-floating mb-3">
> <InputDate @bind-Value="_geboortedatum" class="form-control d-none" />
> <InputText @bind-Value="GeboortedatumFormatted" class="form-control" id="geboorte-datum" placeholder="Geef
> geboortedatum." />
> <label for="geboorte-datum" class="form-label">Geboortedatum</label>
> <ValidationMessage For="() => _geboortedatum" class="text-danger" />
> </div> </div> |
How to implement locked doors game in Prolog? |
|prolog|swi-prolog| |
null |
{"Voters":[{"Id":446594,"DisplayName":"DarkBee"},{"Id":9214357,"DisplayName":"Zephyr"},{"Id":839601,"DisplayName":"gnat"}]} |
```
class BiLSTMNERTagger(nn.Module):
def __init__(self, emb_dim, hid_dim, n_layers, token_vocab_size, tag_vocab_size):
super().__init__()
self.embedding = nn.Embedding(token_vocab_size, emb_dim, padding_idx=0)
self.rnn = nn.LSTM(emb_dim, hid_dim, num_layers=n_layers, batch_first=True, bidirectional=True)
self.fc = nn.Linear(2*hid_dim, tag_vocab_size)
self.softmax = nn.Softmax()
self.dropout = nn.Dropout(0.1)
self.hidden = None
def forward(self, words, words_len):
#YOUR CODE HERE
out = self.dropout(self.embedding(words))
out = nn.utils.rnn.pack_padded_sequence(out, words_len.cpu().numpy(), enforce_sorted=False, batch_first=True)
out, (hidden, cell) = self.rnn(out)
out = hidden[-1, :, :]
self.hidden = hidden
out = self.fc(out)
prediction = self.softmax(out)
return prediction
torch.manual_seed(42)
model = BiLSTMNERTagger(
emb_dim=20,
hid_dim=64,
n_layers=2,
token_vocab_size=len(tokens_vocab),
tag_vocab_size=len(ner_vocab),)
model = model.to(device)
```
This is my error.
```
115 def forward(self, input: Tensor) -> Tensor:
--> 116 return F.linear(input, self.weight, self.bias)
117
118 def extra_repr(self) -> str:
RuntimeError: mat1 and mat2 shapes cannot be multiplied (32x64 and 128x10)
```
So the issue is that I though that in a bidirectional model the vector will double after I pass each word through my LSTM erro, but that doesn't seem the case. And because of that I cannot feed it to my linear layer. Could you please tell me what is the issue? |
Mattrix multiplication issue in a Bidirectional LSTM Model |
|neural-network|lstm|recurrent-neural-network|bilstm| |
null |
Works well for me !
typealias Inflate<T> = (LayoutInflater, ViewGroup?, Boolean) -> T
abstract class BaseFragment<VB : ViewBinding>(private val inflate: Inflate<VB>) : Fragment() {
private var _binding: VB? = null
val binding get() = _binding!!
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?
): View? {
_binding = inflate.invoke(inflater, container, false)
return binding.root
}
override fun onDestroyView() {
super.onDestroyView()
_binding = null
}
}
class ChildFragment : BaseFragment<FragmentChildBinding>(FragmentChildBinding::inflate){
}
|
In the following code:
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-js -->
class Foo {
#a;
#b = 123;
c = 3.14;
tellYourself() {
console.log("OK the values are", JSON.stringify(this));
}
}
const foo = new Foo();
foo.tellYourself();
<!-- end snippet -->
Only this is printed:
```
OK the values are {"c":3.14}
```
Is there a way to print out all properties automatically, including the private ones?
(meaning if there are 25 private variables, print all of them out automatically, instead of specifying them one by one?).
|
In JavaScript, how to print out all private variables of an object? |
|javascript| |
Try using [`ModalBottomSheet`](https://www.composables.com/material3/modalbottomsheet) instead of `ModalBottomSheetLayout`. |
I want to create a 1.19 forge Minecraft Mod that shows a button with custom text that server-side dupes when the Furnace GUI is open, but the problem is that i can't get it to work! I also tried asking ChatGPT and Copilot, but still doesn't work. I haven't found tutorials on youtube, so can please someone post a code and clear instructions on how to use the code? (i'm using fabric for mc 1.19,java 17.0.1 and Intellij Idea as java IDE)
i tried asking AI's but didnt work, so can please someone hlep me create this mod that server-side dupes? i know no one's gonna answer because its too complicated, but atleast help me do that in single player |
I want to generate html table from a complex nested json,in PHP code here are details..
here is my json and php code
```
$data = json_decode($jsonData, true);
function generateTable($data) {
$html = '<table border="1">';
foreach ($data as $item) {
if(is_array($item['node']['value']))
{
$rowspan = count($item['node']['value']);
}
$html .= '<tr rowspan='.$rowspan.'>';
$html .= '<tr>';
$html .= '<th>' . $item['node']['key'] . '</th>';
$html .= '<td>';
if (isset($item['node']['value']) && is_array($item['node']['value'])) {
$html .= generateTable($item['node']['value']);
} else {
$html .= $item['node']['value'];
}
$html .= '</td>';
$html .= '</tr>';
}
$html .= '</table>';
return $html;
}
echo generateTable($data);
```
```
[
{
"node":{
"key":"header",
"value":[
{
"node":{
"key":"msg_id",
"value":"236001"
},
"type":"string",
"minLength":1,
"maxLength":12,
"desc":"Message ID, this field should be unique id for each Api call. This will be generated from client side. \n\n If the same message ID is used the system will decline the API call with Error Description “Duplicate Message ID” ",
"req":"required"
},
{
"node":{
"key":"msg_type",
"value":"TRANSACTION"
},
"type":"string",
"minLength":1,
"maxLength":12,
"desc":"Message Type – This can have either “TRANSACTION” or “ENQUIRY” \n\n As for this API the value expected is “TRANSACTION” ",
"req":"required"
},
{
"node":{
"key":"msg_function",
"value":"REQ_ACCOUNT_CREATE"
},
"type":"string",
"minLength":1,
"maxLength":50,
"desc":"Message functions: Should be “REQ_ACCOUNT_CREATE” ",
"req":"required"
},
{
"node":{
"key":"src_application",
"value":"IVR"
},
"type":"string",
"minLength":1,
"maxLength":10,
"desc":"Source Application: This is a free Text and the client can populate the source system from where the API is Initiated \n\n Example: IVR, IB, MB \n\n No Validations of these are kept at Network Systems",
"req":"required"
},
{
"node":{
"key":"target_application",
"value":"WAY4"
},
"type":"string",
"minLength":1,
"maxLength":10,
"desc":"The target_application can hold any value from FI side, this can be used by FI to check the target system of the API call",
"req":"required"
},
{
"node":{
"key":"timestamp",
"value":"2020-07-20T10:49:02.366+04:00"
},
"type":"string",
"minLength":1,
"maxLength":30,
"desc":"Timestamp of the request - Format YYYY-MM-DDtHH:MM:SS.SSS+04:00",
"req":"required"
},
{
"node":{
"key":"bank_id",
"value":"NIC"
},
"type":"string",
"minLength":1,
"maxLength":4,
"desc":"Bank Id is Unique Id 4 digit code for each client and the same will be provided once the client setup is completed in our core system. \n\n For sandbox testing – Please use “NIC” ",
"req":"required"
}
]
},
"type":"object",
"minLength":null,
"maxLength":null,
"desc":"",
"req":"false"
},
{
"node":{
"key":"body",
"value":[
{
"node":{
"key":"customer_id",
"value":"100000027"
},
"type":"string",
"minLength":1,
"maxLength":20,
"desc":"Customer ID: Customer Identification number \n\n This should be a unique number",
"req":"required"
},
{
"node":{
"key":"card_type",
"value":"CREDIT"
},
"type":"string",
"minLength":1,
"maxLength":7,
"desc":"Informative value to the request, does not have any functional impact, the value can be PREPAID/CREDIT/DEBIT",
"req":"required"
},
{
"node":{
"key":"account",
"value":[
{
"node":{
"key":"customer_id",
"value":"100000027"
},
"type":"string",
"minLength":1,
"maxLength":20,
"desc":"Customer ID: Customer Identification number \n\n This should be a unique number",
"req":"required"
},
{
"node":{
"key":"account_number",
"value":"0009821110000000008"
},
"type":"string",
"minLength":1,
"maxLength":64,
"desc":"Account number, if not provided CMS will generate it",
"req":"false"
},
{
"node":{
"key":"parent_account_number",
"value":"0009821110000000008"
},
"type":"string",
"minLength":1,
"maxLength":64,
"desc":"Parent account number - Applicable only for Corporate products",
"req":"false"
},
{
"node":{
"key":"branch_code",
"value":"982"
},
"type":"string",
"minLength":1,
"maxLength":10,
"desc":"Branch Code, if no branches are used, the code must be same as bank_code",
"req":"required"
},
{
"node":{
"key":"product_code",
"value":"982_AED_002_A"
},
"type":"string",
"minLength":1,
"maxLength":32,
"desc":"Product code, this code is generated by CMS after creating the product, this code is FI spesific code 982_AED_002_A is just used as an example in Sandbox",
"req":"required"
},
{
"node":{
"key":"billing_day",
"value":""
},
"type":"string",
"minLength":1,
"maxLength":10,
"desc":"Billing date, applicable only for credit card products",
"req":"false"
},
{
"node":{
"key":"currency",
"value":"AED"
},
"type":"string",
"minLength":1,
"maxLength":3,
"desc":"Informative value to the request, does not have any functional impact, the currency will be taken from the product",
"req":"required"
},
{
"node":{
"key":"limit",
"value":[
{
"node":{
"key":"type",
"value":"FIN_LIMIT"
},
"type":"string",
"minLength":1,
"maxLength":32,
"desc":"Credit limit type - applicable only for credit card products",
"req":"false"
},
{
"node":{
"key":"currency",
"value":"SAR"
},
"type":"string",
"minLength":1,
"maxLength":3,
"desc":"Credit limit currency - applicable only for credit card products",
"req":"false"
},
{
"node":{
"key":"value",
"value":"55000"
},
"type":"string",
"minLength":1,
"maxLength":20,
"desc":"Credit limit value - applicable only for credit card products",
"req":"false"
}
]
},
"type":"object",
"minLength":null,
"maxLength":null,
"desc":"",
"req":"false"
},
{
"node":{
"key":"custom_fields",
"value":[
{
"node":{
"key":"key",
"value":"contract_idt_scheme"
},
"type":"string",
"minLength":1,
"maxLength":20,
"desc":"Custom Tag. Example: contract_idt_scheme",
"req":"false"
},
{
"node":{
"key":"value",
"value":"CONTRACT_NUMBER"
},
"type":"string",
"minLength":1,
"maxLength":128,
"desc":"Tag value. Example: CONTRACT_NUMBER",
"req":"false"
}
]
},
"type":"array",
"minLength":null,
"maxLength":null,
"desc":"",
"req":"false"
}
]
},
"type":"object",
"minLength":null,
"maxLength":null,
"desc":"",
"req":"required"
}
]
},
"type":"object",
"minLength":null,
"maxLength":null,
"desc":"",
"req":"false"
}
]
```
and i want this type of out put, like in image.
main issue is rowspan and colspan, i can calculate rowspan but having problem in colspan, i need some recursive php function, this one is creating table in each <td> i want <tr> like in image.... JSON can go any unlimited level....
i want to calculate colspan in that way , at the end "Type", "Length" and "Description" should come in level.
[enter image description here](https://i.stack.imgur.com/P8gbu.png)
i am expecting this result |
{"OriginalQuestionIds":[47040825],"Voters":[{"Id":269970,"DisplayName":"esqew"},{"Id":5389997,"DisplayName":"Shadow","BindingReason":{"GoldTagBadge":"mysql"}}]} |
Please use the below code. It works for bringing the image up.
.container1:hover {
transform: scale(1.2); /* Scale up by 20% on hover */
} |
I need to send requests continuously, at specific intervals. I have a script that uses threads, but it heavily loads the server. Additionally, I prefer to have this not in a single session and would like to avoid cached responses
I wanted to rewrite everything using asyncio, but I encountered an issue where I need to predefine a task list, and there's a significant delay between 'gather' calls. |
Sending asynchronous requests without a pre-defined task list |
|python|asynchronous|optimization| |
null |
For CEST, change your code as follows:
```
pwsh: |
$utcTimestamp = Get-Date -Format "yyyyMMdd-HHmm"
$utcDateTimeObj = [DateTime]::ParseExact($utcTimestamp, "yyyyMMdd-HHmm", $null)
$cetTimeZone = [System.TimeZoneInfo]::FindSystemTimeZoneById("Central European Standard Time")
$cetDateTimeObj = [System.TimeZoneInfo]::ConvertTimeFromUtc($utcDateTimeObj, $cetTimeZone)
$formattedCETTimestamp = $cetDateTimeObj.ToString("yyyyMMdd-HHmm")
Write-Host "##vso[task.setvariable variable=currentCETTimestamp]$formattedCETTimestamp"
displayName: 'Getting timestamp'
```
For CET, change your code as follows:
```
$utcTimestamp = Get-Date -Format "yyyyMMdd-HHmm"
$utcDateTimeObj = [DateTime]::ParseExact($utcTimestamp, "yyyyMMdd-HHmm", $null)
$cetTimeZone = [System.TimeZoneInfo]::FindSystemTimeZoneById("Central European Standard Time")
$cetDateTimeObj = [System.TimeZoneInfo]::ConvertTimeFromUtc($utcDateTimeObj, $cetTimeZone)
$cetDateTimeObj = $cetDateTimeObj.AddHours(-1)
$formattedCETTimestamp = $cetDateTimeObj.ToString("yyyyMMdd-HHmm")
Write-Host "##vso[task.setvariable variable=currentCETTimestamp]$formattedCETTimestamp"
``` |