row_id int64 0 48.4k | init_message stringlengths 1 342k | conversation_hash stringlengths 32 32 | scores dict |
|---|---|---|---|
18,184 | Translate the js code in the file to swift code | 2c3154dcb4eaece3b98348a82f6a9912 | {
"intermediate": 0.35830894112586975,
"beginner": 0.40684449672698975,
"expert": 0.23484651744365692
} |
18,185 | I'd like to round off the closing price from the 3rd digit with PineScript. If the closing price is 29557, please make the script look like 29600. | e7624a96c1c2a7dc28114046b274e1a7 | {
"intermediate": 0.3939926326274872,
"beginner": 0.2806287109851837,
"expert": 0.3253786563873291
} |
18,186 | Error in curl::curl_fetch_memory(url, handle = handle) :
Timeout was reached: [api.census.gov] Connection timeout after 10002 ms | 12a180638554ee6595b0a2646f06512c | {
"intermediate": 0.5906711220741272,
"beginner": 0.21531519293785095,
"expert": 0.19401371479034424
} |
18,187 | 将我粘贴的js代码翻译为swift代码 | 6585becf15c2cf6a55695fa785113edc | {
"intermediate": 0.4443807899951935,
"beginner": 0.20984691381454468,
"expert": 0.34577232599258423
} |
18,188 | <class 'collections.defaultdict'> whats that? | 31d4e39dca9966425d29d6b9cb661397 | {
"intermediate": 0.3669925630092621,
"beginner": 0.4043516218662262,
"expert": 0.2286558300256729
} |
18,189 | Power BI: Have 3 Matrix Table visuals of same format: Table Names are (Planned Progress Status %), (Actual Progress Status %), (Variance Progress Status %). Columns are Previous, Current and Cumulative for which values from three actual tables. Now I need these 3 Matrix Table as single table with first column as "Item" value as (Planned/Actual/Variance) based on data for 3 tables. | bb393a069ae9cfd2b665f11e3e5e410f | {
"intermediate": 0.3392901122570038,
"beginner": 0.20400799810886383,
"expert": 0.4567019045352936
} |
18,190 | I have a JSON file that is an export from telegram chat, it is messages, what I want you to do is create a Python script that creates all possible dialogues threats based on ID and ID of the message that the post replying to
heres an example:
[{text:”hi, im bob”, id:1, replying_to:None},
{text:”hi bob, im nick!”, id:2, replying_to:1},
{text:”sup bob, im sara”, id:3, replying_to:1},
{text:”hi, nick”, id:4, replying_to:2},
{text:”hi, sara!”, id:5, replying_to:3},
{text:”hi guys, im bruce!”, id:6, replying_to:None},
{text:”hey bruce”, id:7, replying_to:6},
this is what i want:
[['hi, im bob', 'hi bob, im nick!', 'hi, nick'],
['hi, im bob, sup bob, im sara, 'hi sara!'],
[”hi guys, im bruce!”, 'hey bruce'] | 3d34b52e584a331b38a702dfd893e2ef | {
"intermediate": 0.5317304134368896,
"beginner": 0.1771048754453659,
"expert": 0.29116469621658325
} |
18,191 | give code of media queries boxes | d38cab8763e4112d0e8ea90408a77f9a | {
"intermediate": 0.3483421504497528,
"beginner": 0.3979337811470032,
"expert": 0.2537240982055664
} |
18,192 | PResponse.getheader() is deprecated and will be removed in urllib3 v2.1.0. Instead use HTTPResponse.headers.get(name, default). if resp.getheader('Content-Type') is not None. как скрыть предупреждение | ffd443e6f670399a9e0f0d4e61fbe553 | {
"intermediate": 0.5263707637786865,
"beginner": 0.27749890089035034,
"expert": 0.19613029062747955
} |
18,193 | /version | ff2646a8bf8dd269de04589a54442ee9 | {
"intermediate": 0.3003480136394501,
"beginner": 0.28167834877967834,
"expert": 0.41797372698783875
} |
18,194 | <view class="comment">
<view class="box u-row-between">
<view>
<input v-model="comment" placeholder="说点什么吧......" class="input"></input>
</view>
<view @click="show = !show">
<u-icon name="chat" labelPos="bottom" label="10" size="40" labelSize="22"></u-icon>
</view>
</view>
</view>
<!-- 评论弹窗 -->
<u-popup v-model="show" mode="bottom" length="70%" border-radius="24">
<view class="u-p-30" v-for="(item,index) in 10" :key="index">
<view class="u-flex u-col-top">
<view class="u-p-r-20">
<u-avatar text="MK" bg-color="#2BC3C8"></u-avatar>
</view>
<view class="u-flex-1">
<view class="u-tips-color u-font-sm">MK</view>
<view>满堂花醉三千客,一剑霜寒十四州。满堂花醉三千客,一剑霜寒十四州</view>
<view class="u-tips-color u-font-sm u-m-t-10">18小时前 广东 回复</view>
</view>
<view>
<u-icon name="thumb-up" size="36"></u-icon>
</view>
</view>
</view>
</u-popup>
这是评论代码如何实现 评论回复功能 | 165c3f6f5f63c4346ba9fe6076a10fff | {
"intermediate": 0.2689112722873688,
"beginner": 0.5217066407203674,
"expert": 0.20938217639923096
} |
18,195 | hash[timestamp].quantity += trade.quantity; | 5770a811e723a1393850255b0ad77db0 | {
"intermediate": 0.40475162863731384,
"beginner": 0.31178945302963257,
"expert": 0.2834588587284088
} |
18,196 | Warning: `value` should be array when `mode` is `multiple` or `tags` vue页面报错 | 1db95ffec228d185799243bb5401dcaf | {
"intermediate": 0.3702782690525055,
"beginner": 0.41308706998825073,
"expert": 0.21663470566272736
} |
18,197 | from openpyxl import load_workbook
wb = load_workbook(filename=r'C:\Users\LIQI\Documents\pythonfiles\xlwingsfiles\brinson.xlsm', read_only=True)
sht = wb['Sheet1']
portfolioID = sht.range('b1').value#300Active,300Standard……
beginDate = sht.range('j1').value
endDate = sht.range('l1').value
analyst = sht.range('h1').value
industry = sht.range('e1').value#一级行业
帮我看看错误怎么改
AttributeError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_13508/579884863.py in <module>
----> 1 portfolioID = sht.range('b1').value#300Active,300Standard……
2 beginDate = sht.range('j1').value
3 endDate = sht.range('l1').value
4 analyst = sht.range('h1').value
5 industry = sht.range('e1').value#一级行业
AttributeError: 'ReadOnlyWorksheet' object has no attribute 'range' | 1a0bd2e8aa210293b3d19609a366fa62 | {
"intermediate": 0.5317507386207581,
"beginner": 0.27179402112960815,
"expert": 0.19645525515079498
} |
18,198 | In Nginx, what's the difference between proxy_connect_timeout and proxy_read_timeout? | f7902301251db0e989685ab03409bf5b | {
"intermediate": 0.444169282913208,
"beginner": 0.3095213770866394,
"expert": 0.24630935490131378
} |
18,199 | I have the following VBA code that searches all the VBA in my workbook 'Service Providers' for file paths that start "G:\Shared drives".
The code is effective and accurate.
Can you please wirte me a similar code that seraches the workbook for file paths outside the workbook.
Sub SearchVBALinkedDocs()
'SEARCHES VBA OF ALL SHEETS FOR LINK PATH TO G
Dim wb As Workbook
Dim linkedDocsWs As Worksheet
Dim lastRow As Long
Dim ws As Worksheet
Dim moduleCode As String
Dim addressPath As String
Dim lineIndex As Long
Dim startPos As Long
Dim endPos As Long
Set wb = ThisWorkbook
Set linkedDocsWs = wb.Sheets("Linked Docs")
For Each ws In wb.Sheets
On Error Resume Next
lineIndex = 1
' Check if the sheet has a code module
If ws.Type = xlWorksheet Then
' Get the module code of the sheet
moduleCode = wb.VBProject.VBComponents(ws.CodeName).codeModule.Lines(1, wb.VBProject.VBComponents(ws.CodeName).codeModule.CountOfLines)
startPos = InStr(1, moduleCode, "G:\Shared drives")
Do Until startPos = 0
endPos = InStr(startPos, moduleCode, """")
If endPos > startPos Then
addressPath = Mid(moduleCode, startPos, endPos - startPos)
lastRow = linkedDocsWs.Cells(linkedDocsWs.Rows.Count, "D").End(xlUp).Row + 1
linkedDocsWs.Cells(lastRow, "D").Value = addressPath
linkedDocsWs.Cells(lastRow, "E").Value = "'" & ws.Name
End If
startPos = InStr(startPos + 1, moduleCode, "G:\Shared drives")
Loop
End If
On Error GoTo 0
Next ws
Call Module32.SearchMODLinkedDocs
End Sub | eba27d069b54e7c5fd7941f00026fc65 | {
"intermediate": 0.4474303126335144,
"beginner": 0.3175877034664154,
"expert": 0.234981968998909
} |
18,200 | =IF([@[Type of Request]]="Extension of Existing SAP Material - Plant Only","Plant Extension Only",
IF([@[Type of Request]]="Extension of Existing SAP Material - Sales Org Only","Sales Org Extension Only",
IF(OR([@[Type of Request]]="Extension of Existing SAP Material", [@[Type of Request]]="Extension of Existing SAP Material - Sales Org Only"),"Extension Only",
"Full End to End SAP Set Up"))) please explain this in pseudocode | c23644b79897c447b812d86263d402a1 | {
"intermediate": 0.31592538952827454,
"beginner": 0.5064770579338074,
"expert": 0.17759756743907928
} |
18,201 | write slam factor graph optimization in python using g2o | 34f84cd178e4ab757237092754a3a007 | {
"intermediate": 0.1549929678440094,
"beginner": 0.09595663100481033,
"expert": 0.7490504384040833
} |
18,202 | const formatedActions = computed(() => {
const { status } = props.group
if (status === 'MIGRATING') {
return [...actions, ...flowActions].filter((a) => a.text !== ('btns.delete'))
} else if (status === 'CREATED' || status === 'PART CONFIGURED' || status === 'NOT VALID' || status === 'VALIDATED') {
return [{
text: ('group.configSets'),
func: configSets
}, ...actions]
} else if (status === 'CONFIGURED') {
return [{
text: ('btns.migrate'),
func: confirmMigrate
}, ...actions]
} else {
return actions
}
})
поправить переводы vue composition api | c4bc3b2c3c94d7b6c732a9a25d224938 | {
"intermediate": 0.3933705985546112,
"beginner": 0.32358771562576294,
"expert": 0.28304168581962585
} |
18,203 | The following VBA code below searches all the sheet VBA in my workbook 'Service Providers' for file paths that start "G:\Shared drives".
The code is effective and accurate.
Can you please write me a similar code that searches the workbook Cells and not the VBA for file paths outside the workbook.
Sub SearchVBALinkedDocs()
'SEARCHES VBA OF ALL SHEETS FOR LINK PATH TO G
Dim wb As Workbook
Dim linkedDocsWs As Worksheet
Dim lastRow As Long
Dim ws As Worksheet
Dim moduleCode As String
Dim addressPath As String
Dim lineIndex As Long
Dim startPos As Long
Dim endPos As Long
Set wb = ThisWorkbook
Set linkedDocsWs = wb.Sheets("Test Sheet")
For Each ws In wb.Sheets
On Error Resume Next
lineIndex = 1
' Check if the sheet has a code module
If ws.Type = xlWorksheet Then
' Get the module code of the sheet
moduleCode = wb.VBProject.VBComponents(ws.CodeName).codeModule.Lines(1, wb.VBProject.VBComponents(ws.CodeName).codeModule.CountOfLines)
startPos = InStr(1, moduleCode, "G:\Shared drives")
Do Until startPos = 0
endPos = InStr(startPos, moduleCode, """")
If endPos > startPos Then
addressPath = Mid(moduleCode, startPos, endPos - startPos)
lastRow = linkedDocsWs.Cells(linkedDocsWs.Rows.Count, "D").End(xlUp).Row + 1
linkedDocsWs.Cells(lastRow, "D").Value = addressPath
linkedDocsWs.Cells(lastRow, "E").Value = "'" & ws.Name
End If
startPos = InStr(startPos + 1, moduleCode, "G:\Shared drives")
Loop
End If
On Error GoTo 0
Next ws
Call Module32.SearchMODLinkedDocs
End Sub | af6a0fa276c01c411132c3d7a0ace3a3 | {
"intermediate": 0.4207073152065277,
"beginner": 0.3542083203792572,
"expert": 0.2250843048095703
} |
18,204 | const [settings, setSettings] = useState({
timeout: “40”,
aggregation: true,
maxVolume: window.localStorage.getItem(cup-volume-${symbol}) || “1000”,
isFixedVolume: null !== window.localStorage.getItem(cup-volume-${symbol}),
minQuantity: window.localStorage.getItem(order-feed-min-qty-${symbol}) || “0”,
volumeAsDollars: null !== window.localStorage.getItem(cup-dollars-volume-${symbol}),
});
const [showSettings, setShowSettings] = useState(false);
console.log(window.localStorage.getItem(cup-dollars-volume-${symbol}));
console.log(settings.volumeAsDollars);
useEffect(() => {
const channel = new MessageChannel();
cupWorkerRef.current?.postMessage({type: “set_port”, port: channel.port1}, [channel.port1]);
orderFeedWorkerRef.current?.postMessage({type: “set_port”, port: channel.port2}, [channel.port2]);
}, []);
useEffect(() => {
setSettings({
…settings,
maxVolume: window.localStorage.getItem(cup-volume-${symbol}) || “1000”,
isFixedVolume: null !== window.localStorage.getItem(cup-volume-${symbol}),
minQuantity: window.localStorage.getItem(order-feed-min-qty-${symbol}) || “0”,
volumeAsDollars: null !== window.localStorage.getItem(cup-dollars-volume-${symbol}),
});
}, [symbol]);
useEffect(() => {
if (settings.isFixedVolume) {
window.localStorage.setItem(cup-volume-${symbol}, settings.maxVolume);
} else {
window.localStorage.removeItem(cup-volume-${symbol});
}
window.localStorage.setItem(cup-dollars-volume-${symbol}, ${settings.volumeAsDollars});
sendSettings();
}, [settings]);
как сделать правильное сохранение в localStorage, у меня при перезагрузке всегда true
вот код!!!!!!!!! убедись найди ошибку
console.log(window.localStorage.getItem(`cup-dollars-volume-${symbol}`)); всегда true | 0e4b11b10b4093ea0a0964666b3f75db | {
"intermediate": 0.3205973505973816,
"beginner": 0.3771955370903015,
"expert": 0.30220720171928406
} |
18,205 | I am getting a type Mismatch when I run this code: Sub SearchCellValueLinkedDocs()
'SEARCHES CELLS IN ALL WORKSHEETS FOR LINK PATH TO G
Dim wb As Workbook
Dim linkedDocsWs As Worksheet
Dim lastRow As Long
Dim ws As Worksheet
Dim cell As Range
Dim addressPath As String
Set wb = ThisWorkbook
Set linkedDocsWs = wb.Sheets("Test Sheet")
For Each ws In wb.Sheets
If ws.Name <> "Test Sheet" And ws.Name <> "Linked Docs" Then
For Each cell In ws.UsedRange
If InStr(1, cell.Value, "G:\Shared drives") > 0 Then
lastRow = linkedDocsWs.Cells(linkedDocsWs.Rows.Count, "D").End(xlUp).Row + 1
linkedDocsWs.Cells(lastRow, "D").Value = cell.Value
linkedDocsWs.Cells(lastRow, "E").Value = "'" & ws.Name
lastRow = lastRow + 1 ' Move to the next row in the new worksheet
End If
Next cell
End If
Next ws
'Call Module32.SearchMODLinkedDocs
End Sub | 54be39cb68e7072c6704112fdb23a73c | {
"intermediate": 0.48749905824661255,
"beginner": 0.30146390199661255,
"expert": 0.2110370546579361
} |
18,206 | how to use UMDH to detect memory leak? | 2beecc4bb7657b003c16332cd2dd6ccf | {
"intermediate": 0.2195674479007721,
"beginner": 0.10065855085849762,
"expert": 0.6797739863395691
} |
18,207 | The code below searches alll the VBA code in my workbook for refrence to "G:\Shared drives".
The code is accurate and works very well.
Can you write a similar code that doe the following:
Omitting the sheet VBA, search all formulas in the sheet cells for links to all external files outside of the Workbook.
Sub SearchVBALinkedDocs()
'SEARCHES VBA OF ALL SHEETS FOR LINK PATH TO G
Dim wb As Workbook
Dim linkedDocsWs As Worksheet
Dim lastRow As Long
Dim ws As Worksheet
Dim moduleCode As String
Dim addressPath As String
Dim lineIndex As Long
Dim startPos As Long
Dim endPos As Long
Set wb = ThisWorkbook
Set linkedDocsWs = wb.Sheets("Linked Docs")
For Each ws In wb.Sheets
On Error Resume Next
lineIndex = 1
' Check if the sheet has a code module
If ws.Type = xlWorksheet Then
' Get the module code of the sheet
moduleCode = wb.VBProject.VBComponents(ws.CodeName).codeModule.Lines(1, wb.VBProject.VBComponents(ws.CodeName).codeModule.CountOfLines)
startPos = InStr(1, moduleCode, "G:\Shared drives")
Do Until startPos = 0
endPos = InStr(startPos, moduleCode, """")
If endPos > startPos Then
addressPath = Mid(moduleCode, startPos, endPos - startPos)
lastRow = linkedDocsWs.Cells(linkedDocsWs.Rows.Count, "D").End(xlUp).Row + 1
linkedDocsWs.Cells(lastRow, "D").Value = addressPath
linkedDocsWs.Cells(lastRow, "E").Value = "'" & ws.Name
End If
startPos = InStr(startPos + 1, moduleCode, "G:\Shared drives")
Loop
End If
On Error GoTo 0
Next ws
Call Module32.SearchMODLinkedDocs
End Sub | 6491264769633a6afcbe96c68a28afe2 | {
"intermediate": 0.38609808683395386,
"beginner": 0.38335421681404114,
"expert": 0.23054766654968262
} |
18,208 | в чем проблема?
ошибка: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'getPixelRatio')
в коде:
import * as THREE from 'three';
import Stats from 'three/addons/libs/stats.module.js';
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js';
import { RectAreaLightHelper } from 'three/addons/helpers/RectAreaLightHelper.js';
import { RectAreaLightUniformsLib } from 'three/addons/lights/RectAreaLightUniformsLib.js';
import { gsap } from "gsap";
// import { FontLoader } from 'three/addons/loaders/FontLoader.js';
import {EffectComposer} from 'three/addons/postprocessing/EffectComposer.js';
import {RenderPass} from 'three/addons/postprocessing/RenderPass.js';
import { UnrealBloomPass } from 'three/examples/jsm/postprocessing/UnrealBloomPass.js'
async function loadShaderFile(url) {
const response = await fetch(url);
const shaderCode = await response.text();
return shaderCode;
}
async function main() {
const loader = new GLTFLoader();
loader.load(
'CUBE R1 a.glb',
async (gltf) => {
const cube = gltf.scene;
let anim = gltf.animations;
console.log(anim)
let container, stats, clock;
let camera, scene, renderer;
let rectLight1,rectLight2;
const segments = 3000;
const r = 3;
let t = 0;
init();
RectAreaLightUniformsLib.init();
scene.add(cube);
cube.castShadow = true;
cube.receiveShadow = true;
// cube.scale.set(1.0,1.0,1.0);
// cube.position.set(0,-0.3,0);
const light = new THREE.AmbientLight( 0x404040 );
scene.add( light );
async function init() {
container = document.getElementById( 'container' );
camera = new THREE.PerspectiveCamera( 20, window.innerWidth / window.innerHeight, 0.01, 4000 );
camera.position.z = 9;
const renderScene = new RenderPass(scene,camera);
const composer = new EffectComposer(renderer);
composer.addPass(renderScene);
const bloomPass = new UnrealBloomPass(
new THREE.Vector2(window.innerWidth,window.innerHeight),
1.6,
0.1,
0.1
)
composer.addPass(bloomPass);
scene = new THREE.Scene();
const shaderCode = await loadShaderFile('frag.glsl');
const texture2 = new THREE.TextureLoader().load('logoGradient4.png');
let uTime = 0;
rectLight1 = new THREE.RectAreaLight( 0xffffff, 20, 4, 4 );
scene.add( rectLight1 );
rectLight1.castShadow = true;
rectLight1.position.set( 2, -1, -2 );
rectLight1.rotation.set(0,Math.PI/2,0);
// scene.add( new RectAreaLightHelper( rectLight1 ) );
rectLight2 = new THREE.RectAreaLight( 0xffffff, 20, 1, 1 );
scene.add( rectLight2 );
rectLight2.castShadow = true;
rectLight2.position.set( -2, 0, -2 );
rectLight2.rotation.set(Math.PI/5,-Math.PI/1.5,Math.PI/1.5);
renderer = new THREE.WebGLRenderer( { antialias: true } );
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.useLegacyLights = false;
container.appendChild( renderer.domElement );
stats = new Stats();
container.appendChild( stats.dom );
cube.scale.set(0.16,0.16,0.16);
window.addEventListener( 'resize', onWindowResize );
const controls = new OrbitControls(camera, renderer.domElement);
controls.enableDamping = true;
controls.dampingFactor = 0.05;
scene.add(controls.target);
const mixer = new THREE.AnimationMixer( cube );
const clips = cube.animations;
// Play all animations
clips.forEach( function ( clip ) {
mixer.clipAction( clip ).play();
} );
const cubeUp = cube.clone();
const cubeDown = cube.clone();
scene.add(cubeUp);
cubeUp.castShadow = true;
cubeUp.receiveShadow = true;
cubeUp.position.y = 0.32;
scene.add(cubeDown);
cubeDown.castShadow = true;
cubeDown.receiveShadow = true;
cubeDown.position.y = -0.32;
gsap.to(cube.rotation,{
y: Math.PI,
duration: 2.4,
repeat: -1,
delay: 0.5,
repeatDelay: 3,
ease: "power1.inOut"
})
gsap.to(cubeUp.rotation,{
y: Math.PI,
duration: 2.4,
repeat: -1,
delay: 1.2,
repeatDelay: 2,
ease: "power1.inOut"
})
gsap.to(cubeDown.rotation,{
y: Math.PI,
duration: 2.4,
repeat: -1,
delay: 3.5,
repeatDelay: 4,
ease: "power1.inOut"
})
const groupCube = new THREE.Group();
groupCube.add( cube );
groupCube.add( cubeUp );
groupCube.add( cubeDown );
scene.add(groupCube);
function animate(animations) {
requestAnimationFrame( animate );
for (let i = 0; i < animations.length; i++) {
// animations[i].play();
}
mixer.update( uTime );
controls.update();
uTime += 0.01;
groupCube.rotation.set(uTime,uTime,uTime);
render();
stats.update();
}
animate(gltf.animations);
}
function onWindowResize() {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize( window.innerWidth, window.innerHeight );
}
function render() {
composer.render();
// renderer.render( scene, camera );
}
}
);
};
main() | c423f22dd975d7f8eafef05ccbaa2aac | {
"intermediate": 0.4005953371524811,
"beginner": 0.4808429181575775,
"expert": 0.1185617744922638
} |
18,209 | в чем проблема?
ошибка: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading ‘getPixelRatio’)
в коде:
import * as THREE from 'three';
import Stats from 'three/addons/libs/stats.module.js';
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js';
import { RectAreaLightHelper } from 'three/addons/helpers/RectAreaLightHelper.js';
import { RectAreaLightUniformsLib } from 'three/addons/lights/RectAreaLightUniformsLib.js';
import { gsap } from "gsap";
// import { FontLoader } from 'three/addons/loaders/FontLoader.js';
import {EffectComposer} from 'three/addons/postprocessing/EffectComposer.js';
import {RenderPass} from 'three/addons/postprocessing/RenderPass.js';
import { UnrealBloomPass } from 'three/examples/jsm/postprocessing/UnrealBloomPass.js'
async function loadShaderFile(url) {
const response = await fetch(url);
const shaderCode = await response.text();
return shaderCode;
}
async function main() {
const loader = new GLTFLoader();
loader.load(
'CUBE R1 a.glb',
async (gltf) => {
const cube = gltf.scene;
let anim = gltf.animations;
console.log(anim)
let container, stats, clock;
let camera, scene, renderer, composer, renderScene, bloomPass;
let rectLight1,rectLight2;
const segments = 3000;
const r = 3;
let t = 0;
init();
RectAreaLightUniformsLib.init();
scene.add(cube);
cube.castShadow = true;
cube.receiveShadow = true;
// cube.scale.set(1.0,1.0,1.0);
// cube.position.set(0,-0.3,0);
const light = new THREE.AmbientLight( 0x404040 );
scene.add( light );
async function init() {
container = document.getElementById( 'container' );
camera = new THREE.PerspectiveCamera( 20, window.innerWidth / window.innerHeight, 0.01, 4000 );
camera.position.z = 9;
renderScene = new RenderPass(scene,camera);
composer = new EffectComposer(renderer);
composer.addPass(renderScene);
bloomPass = new UnrealBloomPass(
new THREE.Vector2(window.innerWidth,window.innerHeight),
1.6,
0.1,
0.1
)
composer.addPass(bloomPass);
scene = new THREE.Scene();
const shaderCode = await loadShaderFile('frag.glsl');
const texture2 = new THREE.TextureLoader().load('logoGradient4.png');
let uTime = 0;
console.log('lol');
// const light = new THREE.PointLight( 0xffffff, 1, 100 );
// light.position.set( 1, 1, 1 );
// scene.add( light );
// const light2 = new THREE.PointLight( 0xffffff, 1, 100 );
// light2.position.set( -1, 1, 1 );
// scene.add( light2 );
// const light3 = new THREE.PointLight( 0xffffff, 1, 100 );
// light3.position.set( 0, 0, 1 );
// scene.add( light3 );
// light3.castShadow = true;
rectLight1 = new THREE.RectAreaLight( 0xffffff, 20, 4, 4 );
scene.add( rectLight1 );
rectLight1.castShadow = true;
rectLight1.position.set( 2, -1, -2 );
rectLight1.rotation.set(0,Math.PI/2,0);
// scene.add( new RectAreaLightHelper( rectLight1 ) );
rectLight2 = new THREE.RectAreaLight( 0xffffff, 20, 1, 1 );
scene.add( rectLight2 );
rectLight2.castShadow = true;
rectLight2.position.set( -2, 0, -2 );
rectLight2.rotation.set(Math.PI/5,-Math.PI/1.5,Math.PI/1.5);
// scene.add( new RectAreaLightHelper( rectLight2 ) );
renderer = new THREE.WebGLRenderer( { antialias: true } );
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.useLegacyLights = false;
container.appendChild( renderer.domElement );
stats = new Stats();
container.appendChild( stats.dom );
// window.addEventListener('mousemove', (e)=> {
// const rotX = 1.5*e.clientY/window.innerHeight - 0.25;
// const rotY = 1.5*e.clientX/window.innerWidth - 0.25;
// cube.rotation.set(-rotX/1,-rotY/1,0.0);
// })
cube.scale.set(0.16,0.16,0.16);
window.addEventListener( 'resize', onWindowResize );
const controls = new OrbitControls(camera, renderer.domElement);
controls.enableDamping = true;
controls.dampingFactor = 0.05;
scene.add(controls.target);
// Create an AnimationMixer, and get the list of AnimationClip instances
const mixer = new THREE.AnimationMixer( cube );
const clips = cube.animations;
// Play all animations
clips.forEach( function ( clip ) {
mixer.clipAction( clip ).play();
} );
const cubeUp = cube.clone();
const cubeDown = cube.clone();
scene.add(cubeUp);
cubeUp.castShadow = true;
cubeUp.receiveShadow = true;
cubeUp.position.y = 0.32;
scene.add(cubeDown);
cubeDown.castShadow = true;
cubeDown.receiveShadow = true;
cubeDown.position.y = -0.32;
gsap.to(cube.rotation,{
y: Math.PI,
duration: 2.4,
repeat: -1,
delay: 0.5,
repeatDelay: 3,
ease: "power1.inOut"
})
gsap.to(cubeUp.rotation,{
y: Math.PI,
duration: 2.4,
repeat: -1,
delay: 1.2,
repeatDelay: 2,
ease: "power1.inOut"
})
gsap.to(cubeDown.rotation,{
y: Math.PI,
duration: 2.4,
repeat: -1,
delay: 3.5,
repeatDelay: 4,
ease: "power1.inOut"
})
const groupCube = new THREE.Group();
groupCube.add( cube );
groupCube.add( cubeUp );
groupCube.add( cubeDown );
scene.add(groupCube);
function animate(animations) {
requestAnimationFrame( animate );
for (let i = 0; i < animations.length; i++) {
// animations[i].play();
}
mixer.update( uTime );
controls.update();
uTime += 0.01;
groupCube.rotation.set(uTime,uTime,uTime);
render();
stats.update();
}
animate(gltf.animations);
}
function onWindowResize() {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize( window.innerWidth, window.innerHeight );
}
function render() {
composer.render();
// renderer.render( scene, camera );
}
}
);
};
main() | cfbde230178c95aa6023b02ffe2980d6 | {
"intermediate": 0.38370615243911743,
"beginner": 0.42419394850730896,
"expert": 0.19209995865821838
} |
18,210 | I used this code: def signal_generator(df):
if df is None or len(df) < 2:
return ''
signal = []
# Retrieve depth data
threshold = 0.3
depth_data = client.depth(symbol=symbol)
bid_depth = depth_data['bids']
ask_depth = depth_data['asks']
buy_price = float(bid_depth[0][0]) if bid_depth else 0.0
sell_price = float(ask_depth[0][0]) if ask_depth else 0.0
mark_price_data = client.ticker_price(symbol=symbol)
mark_price = float(mark_price_data['price']) if 'price' in mark_price_data else 0.0
buy_qty = sum(float(bid[1]) for bid in bid_depth)
sell_qty = sum(float(ask[1]) for ask in ask_depth)
sell_qty_ratio = sell_qty / buy_qty
buy_qty_ratio = buy_qty / sell_qty
if sell_qty > (buy_qty * (1 + threshold)):
signal.append('sell')
elif buy_qty > (sell_qty * (1 + threshold)):
signal.append('buy')
else:
signal.append('') # Append an empty string when no signal conditions met
return signal
But it doesn't give me sell signal, give me code with same strategy , but code which will give me sell signal too | def59ac6d8706baee1e595b1cf01f3d3 | {
"intermediate": 0.4293828010559082,
"beginner": 0.26604020595550537,
"expert": 0.30457693338394165
} |
18,211 | <?xml version="1.0" encoding="UTF-8"?>
<project xmlns=http://maven.apache.org/POM/4.0.0
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance
xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.1.0</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>com.asda</groupId>
<artifactId>assetmanager</artifactId>
<version>0.0.3-SNAPSHOT</version>
<name>assetmanager</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>11</java.version>
<azure.version>4.0.0</azure.version>
<log4j2.version>2.17.1</log4j2.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- add spring boot starter dependency and exclude logging -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.17.1</version>
</dependency>
<!-- log4j2 dependency -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
<version>2.6.3</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>applicationinsights-spring-boot-starter</artifactId>
<version>2.6.0</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>applicationinsights-logging-log4j2</artifactId>
<version>[2.0,)</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.10.19</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>2.5.6</version>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>9.4.0.jre8</version>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-blob</artifactId>
<version>12.14.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.azure/azure-identity -->
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-identity</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>5.2.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>5.2.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/net.javacrumbs.shedlock/shedlock-spring -->
<dependency>
<groupId>net.javacrumbs.shedlock</groupId>
<artifactId>shedlock-spring</artifactId>
<version>4.33.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/net.javacrumbs.shedlock/shedlock-provider-jdbc-template -->
<dependency>
<groupId>net.javacrumbs.shedlock</groupId>
<artifactId>shedlock-provider-jdbc-template</artifactId>
<version>4.33.0</version>
</dependency>
<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>azure-spring-boot-starter-keyvault-secrets</artifactId>
<version>${azure.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
<version>2.7.14</version>
</dependency>
<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>azure-spring-boot-starter-active-directory</artifactId>
<version>${azure.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
<version>2.7.14</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.microsoft.azure/adal4j -->
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>adal4j</artifactId>
<version>1.6.7</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>azure-spring-boot-bom</artifactId>
<version>${azure.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-bom</artifactId>
<version>2.17.1</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
<image>
<name>asdapocdocker.azurecr.io/${project.artifactId}</name>
</image>
<layers>
<enabled>true</enabled>
<includeLayerTools>true</includeLayerTools>
</layers>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.7</version>
<configuration>
<!-- <excludes>
<exclude>*/domain/</exclude>
<exclude>*/dto/</exclude>
<exclude>*/config/</exclude>
</excludes> -->
</configuration>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>default-report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>default-check</id>
<goals>
<goal>check</goal>
</goals>
<configuration>
<rules>
<rule>
<element>BUNDLE</element>
<limits>
<limit>
<counter>INSTRUCTION</counter>
<value>COVEREDRATIO</value>
<minimum>0.60</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
This is my pom.xml i wanted to upgrade my springboot version to the latest stable version can you please upgrade sprintboot stable version and according to that version check other dependencies compatibility and provide updated vesrion if required . | d379176f3bdef41cee08914b41812023 | {
"intermediate": 0.4077797830104828,
"beginner": 0.511823296546936,
"expert": 0.08039694279432297
} |
18,212 | give me a simple flask python program | 58e970fd9fdfc9922661a663ec85e6e4 | {
"intermediate": 0.6179194450378418,
"beginner": 0.2237892895936966,
"expert": 0.158291295170784
} |
18,213 | <?xml version="1.0" encoding="UTF-8"?>
<project xmlns=http://maven.apache.org/POM/4.0.0
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance
xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.1.0</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>com.asda</groupId>
<artifactId>assetmanager</artifactId>
<version>0.0.3-SNAPSHOT</version>
<name>assetmanager</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>11</java.version>
<azure.version>4.0.0</azure.version>
<log4j2.version>2.17.1</log4j2.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- add spring boot starter dependency and exclude logging -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.17.1</version>
</dependency>
<!-- log4j2 dependency -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
<version>2.6.3</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>applicationinsights-spring-boot-starter</artifactId>
<version>2.6.0</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>applicationinsights-logging-log4j2</artifactId>
<version>[2.0,)</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.10.19</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>2.5.6</version>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>9.4.0.jre8</version>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-blob</artifactId>
<version>12.14.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.azure/azure-identity -->
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-identity</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>5.2.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>5.2.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/net.javacrumbs.shedlock/shedlock-spring -->
<dependency>
<groupId>net.javacrumbs.shedlock</groupId>
<artifactId>shedlock-spring</artifactId>
<version>4.33.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/net.javacrumbs.shedlock/shedlock-provider-jdbc-template -->
<dependency>
<groupId>net.javacrumbs.shedlock</groupId>
<artifactId>shedlock-provider-jdbc-template</artifactId>
<version>4.33.0</version>
</dependency>
<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>azure-spring-boot-starter-keyvault-secrets</artifactId>
<version>${azure.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
<version>2.7.14</version>
</dependency>
<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>azure-spring-boot-starter-active-directory</artifactId>
<version>${azure.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
<version>2.7.14</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.microsoft.azure/adal4j -->
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>adal4j</artifactId>
<version>1.6.7</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>azure-spring-boot-bom</artifactId>
<version>${azure.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-bom</artifactId>
<version>2.17.1</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
<image>
<name>asdapocdocker.azurecr.io/${project.artifactId}</name>
</image>
<layers>
<enabled>true</enabled>
<includeLayerTools>true</includeLayerTools>
</layers>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.7</version>
<configuration>
<!-- <excludes>
<exclude>*/domain/</exclude>
<exclude>*/dto/</exclude>
<exclude>*/config/</exclude>
</excludes> -->
</configuration>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>default-report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>default-check</id>
<goals>
<goal>check</goal>
</goals>
<configuration>
<rules>
<rule>
<element>BUNDLE</element>
<limits>
<limit>
<counter>INSTRUCTION</counter>
<value>COVEREDRATIO</value>
<minimum>0.60</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
This is my pom.xml if i am going to upgrade spring boot parent starter vrsion to 3.0.0 then check other dependies compatibility and share me updated version based on springbotot 3.0.0 | 99393a90b2601e814375ac36ca2cb1f2 | {
"intermediate": 0.4077797830104828,
"beginner": 0.511823296546936,
"expert": 0.08039694279432297
} |
18,214 | I used your code: def signal_generator(df):
if df is None or len(df) < 2:
return ''
signal = []
# Retrieve depth data
threshold = 0.33
depth_data = client.depth(symbol=symbol)
bid_depth = depth_data['bids']
ask_depth = depth_data['asks']
buy_price = float(bid_depth[0][0]) if bid_depth else 0.0
sell_price = float(ask_depth[0][0]) if ask_depth else 0.0
mark_price_data = client.ticker_price(symbol=symbol)
mark_price = float(mark_price_data['price']) if 'price' in mark_price_data else 0.0
buy_qty = sum(float(bid[1]) for bid in bid_depth)
sell_qty = sum(float(ask[1]) for ask in ask_depth)
sell_qty_ratio = sell_qty / buy_qty
buy_qty_ratio = buy_qty / sell_qty
if sell_qty_ratio > (1 + threshold):
signal.append('sell')
elif buy_qty_ratio > (1 + threshold):
signal.append('buy')
else:
signal.append('')
return signal
But it doesn't give me sell signal | 8cb4bcf9d2274664e5a48b1fe2360e1b | {
"intermediate": 0.4482215344905853,
"beginner": 0.32957279682159424,
"expert": 0.22220566868782043
} |
18,215 | I used your code: def signal_generator(df):
if df is None or len(df) < 2:
return ''
signal = []
# Retrieve depth data
threshold = 0.2
depth_data = client.depth(symbol=symbol)
bid_depth = depth_data['bids']
ask_depth = depth_data['asks']
buy_price = float(bid_depth[0][0]) if bid_depth else 0.0
sell_price = float(ask_depth[0][0]) if ask_depth else 0.0
mark_price_data = client.ticker_price(symbol=symbol)
mark_price = float(mark_price_data['price']) if 'price' in mark_price_data else 0.0
buy_qty = sum(float(bid[1]) for bid in bid_depth)
sell_qty = sum(float(ask[1]) for ask in ask_depth)
sell_qty_ratio = sell_qty / buy_qty
buy_qty_ratio = buy_qty / sell_qty
if sell_qty > buy_qty and sell_qty > (buy_qty * (1 + threshold)):
signal.append('sell')
elif buy_qty > sell_qty and buy_qty > (sell_qty * (1 + threshold)):
signal.append('buy')
else:
signal.append('')
return signal
But it doesn't give me sell signals | 606df57539622667d4738ce49a624a10 | {
"intermediate": 0.40036246180534363,
"beginner": 0.31689736247062683,
"expert": 0.28274014592170715
} |
18,216 | Максимально подробна опиши как это работает: override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
arguments?.getInt("imageResId")?.let { imageResId ->
changeImage(imageResId)
}
}
fun changeImage(imageResId: Int) {
imageView.setImageResource(imageResId)
}
companion object {
@JvmStatic
fun newInstance(imageResId: Int) = BlankHomeFragment().apply {
arguments = Bundle().apply {
putInt("imageResId", imageResId)
}
}
} | 7276872e591cf146eb8d96c9129bcbe7 | {
"intermediate": 0.4616805613040924,
"beginner": 0.3220345079898834,
"expert": 0.21628496050834656
} |
18,217 | Formula for excel to replace '%20' with spaces | 90566c0b385b264d107cfaf8abc6e6d9 | {
"intermediate": 0.24527806043624878,
"beginner": 0.36371344327926636,
"expert": 0.39100849628448486
} |
18,218 | При вызове NewInstance я хочу чтобы картинка менялась но поялвяются ошибьки package com.example.cinema_provider_app.main_Fragments
import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import com.example.cinema_provider_app.R
class BlankHomeFragment : Fragment() {
private var imageResId: Int = 0
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val view = inflater.inflate(R.layout.fragment_blank_home, container, false)
return view
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
}
fun changeImage(imageResId: Int) {
//imageView.setImageResource(imageResId)
}
companion object {
@JvmStatic
fun newInstance(imageResId: Int) = BlankHomeFragment().apply {
val imageView: ImageView = requireView().findViewById(R.id.blankImage)
imageView.setImageResource(imageResId)
//changeImage(imageResId)
}
}
}ATAL EXCEPTION: main
Process: com.example.cinema_provider_app, PID: 8573
java.lang.IllegalStateException: Fragment BlankHomeFragment{e7c168a} (02fe8ed8-3aec-4fdb-b381-7bf799adc0f7) did not return a View from onCreateView() or this was called before onCreateView().
at androidx.fragment.app.Fragment.requireView(Fragment.java:1964)
at com.example.cinema_provider_app.main_Fragments.BlankHomeFragment$Companion.newInstance(BlankHomeFragment.kt:37) | a8bd1af3a492e8e55fa6b5319a4491a6 | {
"intermediate": 0.354390025138855,
"beginner": 0.5550763010978699,
"expert": 0.09053365141153336
} |
18,219 | import com.azure.spring.aad.webapi.AADResourceServerWebSecurityConfigurerAdapter;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
@Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true)
public class WebSecurityConfig extends AADResourceServerWebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
super.configure(http);
http.cors().and()
.authorizeRequests((requests) -> requests.anyRequest().authenticated());
}
}
Update this class based on spring boot 3.0.0 compatibility as for now not working | a96481e6c4e4f9fa500a341d8e4ce038 | {
"intermediate": 0.4704907238483429,
"beginner": 0.2991503179073334,
"expert": 0.23035898804664612
} |
18,220 | how do i load a json into pyhton | c36103f376ee62187df9c14d8c33a2e7 | {
"intermediate": 0.6361256241798401,
"beginner": 0.13038195669651031,
"expert": 0.23349244892597198
} |
18,221 | I used your code: def signal_generator(df):
if df is None or len(df) < 2:
return ''
signal = []
# Retrieve depth data
threshold = 0.16
depth_data = client.depth(symbol=symbol)
bid_depth = depth_data['bids']
ask_depth = depth_data['asks']
buy_price = float(bid_depth[0][0]) if bid_depth else 0.0
sell_price = float(ask_depth[0][0]) if ask_depth else 0.0
mark_price_data = client.ticker_price(symbol=symbol)
mark_price = float(mark_price_data['price']) if 'price' in mark_price_data else 0.0
buy_qty = sum(float(bid[1]) for bid in bid_depth)
sell_qty = sum(float(ask[1]) for ask in ask_depth)
sell_qty_ratio = sell_qty / buy_qty
buy_qty_ratio = buy_qty / sell_qty
if sell_qty > buy_qty and sell_qty > (buy_qty * (1 + threshold)):
signal.append('sell')
elif buy_qty > sell_qty and buy_qty > (sell_qty * (1 + threshold)):
signal.append('buy')
else:
signal.append('') # Append an empty string when no signal conditions met
return signal
But it giving me only buy signal , please give me code which will give me signals to buy sell or empty, and don't copy my code and use my strategy | a62f257bc80624c20baecf1404ecccb6 | {
"intermediate": 0.46037694811820984,
"beginner": 0.253648966550827,
"expert": 0.2859741151332855
} |
18,222 | convert json_data = json.loads(json_string_sanitized) results to df | dff4abb68d30869e5bf8a3665996e41e | {
"intermediate": 0.4541890025138855,
"beginner": 0.22904451191425323,
"expert": 0.31676650047302246
} |
18,223 | unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdBaseComponent, IdComponent, IdUDPBase, IdUDPServer, StdCtrls;
type
TForm1 = class(TForm)
IdUDPServer1: TIdUDPServer;
Memo1: TMemo;
procedure FormShow(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure IdUDPServer1UDPRead(AThread: TIdUDPListenerThread; AData: TBytes;
ABinding: TIdSocketHandle);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
IdUDPServer1.Active := False;
end;
procedure TForm1.FormShow(Sender: TObject);
begin
IdUDPServer1.DefaultPort := 12000; // Устанавливаем порт для сервера
IdUDPServer1.Active := True; // Включаем сервер
end;
procedure TForm1.IdUDPServer1UDPRead(AThread: TIdUDPListenerThread;
AData: TBytes; ABinding: TIdSocketHandle);
var
DataStr: string;
begin
DataStr := BytesToString(AData); // Преобразуем принятые байты в строку
Memo1.Lines.Add(DataStr); // Добавляем строку в Memo1
end;
end.
Ошибка Undeclared identifier: 'TIdSocketHandle' | bb5b717a2576a3494e6a484b6b045016 | {
"intermediate": 0.40933680534362793,
"beginner": 0.3888891041278839,
"expert": 0.20177407562732697
} |
18,224 | JasperReport dataSource 是 List | 17e5a5181a33c2a49af823685cffa929 | {
"intermediate": 0.3542492091655731,
"beginner": 0.2894243896007538,
"expert": 0.3563263714313507
} |
18,225 | RANK = int(os.getenv('RANK', -1)) | 54a0bcd561340a9a9663d53ef999105b | {
"intermediate": 0.3772737383842468,
"beginner": 0.2115970253944397,
"expert": 0.4111292064189911
} |
18,226 | fix this code: df.iloc[I[0]][['id']].rename(columns={'id','suggested_id'}) | ad0e18207356e4da990a743e6ab44192 | {
"intermediate": 0.4240611791610718,
"beginner": 0.24222558736801147,
"expert": 0.333713173866272
} |
18,227 | fix this: df.iloc[I[0]][['id']].to_list() | 2fbf1e1501e2853e4f37db31a92cfdbd | {
"intermediate": 0.38263437151908875,
"beginner": 0.34047698974609375,
"expert": 0.2768886685371399
} |
18,228 | add a nested list into a df | a5f01f1d8662e87f3204a65603718d77 | {
"intermediate": 0.3643278181552887,
"beginner": 0.2634340822696686,
"expert": 0.3722380995750427
} |
18,229 | Powershell script for png to 24bit bmp file in the folder | f43410ec18d4b5084c8db3b3176f444d | {
"intermediate": 0.3586554527282715,
"beginner": 0.24510563910007477,
"expert": 0.39623892307281494
} |
18,230 | I used your code : def signal_generator(df):
if df is None or len(df) < 2:
return ''
signal = []
# Retrieve depth data
threshold = 0.16
depth_data = client.depth(symbol=symbol)
bid_depth = depth_data['bids']
ask_depth = depth_data['asks']
buy_price = float(bid_depth[0][0]) if bid_depth else 0.0
sell_price = float(ask_depth[0][0]) if ask_depth else 0.0
mark_price_data = client.ticker_price(symbol=symbol)
mark_price = float(mark_price_data['price']) if 'price' in mark_price_data else 0.0
buy_qty = sum(float(bid[1]) for bid in bid_depth)
sell_qty = sum(float(ask[1]) for ask in ask_depth)
sell_qty_ratio = sell_qty / buy_qty
buy_qty_ratio = buy_qty / sell_qty
if sell_qty > buy_qty and sell_qty > (buy_qty * (1 + threshold)):
signal.append('sell')
elif buy_qty > sell_qty and buy_qty > (sell_qty * (1 + threshold)):
signal.append('buy')
else:
signal.append('') # Append an empty string when no signal conditions met
return signal
But it givnig me only signal to buy, please based on my strategy give me code which will give me signals to buy sell or emoty | c3e5686581b9f101f4d914cdd8199513 | {
"intermediate": 0.4018827974796295,
"beginner": 0.17917655408382416,
"expert": 0.4189406633377075
} |
18,231 | add a list as a value in an existing row but new column in a df | d2b0868aed51500d516bef48b0249429 | {
"intermediate": 0.36590996384620667,
"beginner": 0.21992364525794983,
"expert": 0.4141663610935211
} |
18,232 | recommended_sme = [176158, 147471, 3264, 175949, 148725, 146636, 141510, 143474, 136024, 55531]
row['recommended_sme'] = recommended_sme
ValueError Traceback (most recent call last)
Cell In[73], line 1
----> 1 row['recommended_sme'] = recommended_sme
File /opt/conda/lib/python3.10/site-packages/pandas/core/frame.py:3959, in DataFrame.__setitem__(self, key, value)
3956 self._setitem_array([key], value)
3957 else:
3958 # set column
-> 3959 self._set_item(key, value)
File /opt/conda/lib/python3.10/site-packages/pandas/core/frame.py:4152, in DataFrame._set_item(self, key, value)
4142 def _set_item(self, key, value) -> None:
4143 """
4144 Add series to DataFrame in specified column.
4145
(...)
4150 ensure homogeneity.
4151 """
-> 4152 value = self._sanitize_column(value)
4154 if (
4155 key in self.columns
4156 and value.ndim == 1
4157 and not is_extension_array_dtype(value)
4158 ):
...
579 "does not match length of index "
580 f"({len(index)})"
581 )
ValueError: Length of values (10) does not match length of index (1) | d0171901c5f4be7b1bbde05f32ea0986 | {
"intermediate": 0.4254418909549713,
"beginner": 0.31990447640419006,
"expert": 0.25465360283851624
} |
18,233 | Hi there give me codes I want to make a Reward earning app in java | 405aa7aed87b78ec4a98896235faf7a6 | {
"intermediate": 0.483817994594574,
"beginner": 0.2785547375679016,
"expert": 0.23762725293636322
} |
18,234 | найди ошибку в коде :var time:String = "";
for (i in 0..expr.length)
{
if (expr[i] != ';')
{
time += expr[i]
continue;
}
if (time.length != 0)
{
arr_res?.add(time)
time = "";
}
} | d7b9ef9b94dd8a94b242685b49ec7acb | {
"intermediate": 0.2798835039138794,
"beginner": 0.5238722562789917,
"expert": 0.1962442547082901
} |
18,235 | hello | 85e227f321ad1557d9de086b74a92ac4 | {
"intermediate": 0.32064199447631836,
"beginner": 0.28176039457321167,
"expert": 0.39759764075279236
} |
18,236 | Below is a sample document from mongo. Please generate a mongo query which will aggregate them by different domain names after matching by date
{
"_id": "64df803dae02041aa4228978",
"date": "2023-08-14T00:00:00.000Z",
"report": [
{
"domain": "affordable-dental-implants-solutions.com",
"visitors": 329,
"clicks": 122,
"revenue": 121.4133,
"rtClicks": 0,
"_id": {
"$oid": "64df803dae02041aa4228979"
}
}
],
"createdAt":"2023-08-18T14:29:17.604Z",
"updatedAt": "2023-08-18T14:29:17.604Z",
"__v": 0
} | c876a1620ea628729e03661a6f923050 | {
"intermediate": 0.33815798163414,
"beginner": 0.3634222745895386,
"expert": 0.2984197437763214
} |
18,237 | fix this code: recommended_sme = [176158, 147471, 3264, 175949, 148725, 146636, 141510, 143474, 136024, 55531]
row['recommended_sme'] = np.array(recommended_sme) | 72ed444a25710ab45be66fda7db41590 | {
"intermediate": 0.34561073780059814,
"beginner": 0.2850469648838043,
"expert": 0.3693423271179199
} |
18,238 | I have a class Reservation with
public string BeginDate { get; set; }
public string EndDate { get; set; }
public List<ReservationItem> Items { get; set; }
and I have ReservationItem
public string ReserveDate { get; set; }
public Reservation Reservation { get; set; }
public List<FoodReservation> Items { get; set; }
and I have FoodReservation
public ReservationItem ReservationItem { get; set; }
public Food Food { get; set; }
public Guid FoodId { get; set; }
public List<EmployeeReservation> Items { get; set; } = new List<EmployeeReservation>();
and I have EmployeeReservation
public FoodReservation FoodReservation { get; set; }
public Guid FoodReservationId { get; set; }
public Employee User { get; set; }
public Guid UserId { get; set; }
and I have Employee
public string Building { get; set; }
public int Floor { get; set; }
public bool IsActive { get; set; } = true;
I want to write a linq Query in c# that returns amount of each food with their count for each they group by Building
output is
public class GetReportReservationGroupByBuildingQueryResponseViewModel
{
public string Date { get; set; }
public List<GetReportReservationGroupByBuildingQueryResponseViewModelItem> Items { get; set; }
}
public class GetReportReservationGroupByBuildingQueryResponseViewModelItem
{
public string Building { get; set; }
public List<GetReportReservationGroupByBuildingQueryResponseViewModelItemItem> Items { get; set; }
}
public class GetReportReservationGroupByBuildingQueryResponseViewModelItemItem
{
public string FoodName { get; set; }
public int Count { get; set; }
} | 46f21022d29406a2248b1cce9cfd813d | {
"intermediate": 0.4339410960674286,
"beginner": 0.3274111747741699,
"expert": 0.2386476844549179
} |
18,239 | write designer file for Window Form Application using C# contain contrls :
contrlo: label, contrl name: lbl_first_name, text="first name"
contrlo:textbox, contrl name: txt_First_name, text=""
contrlo: label, contrl name: lbl_father_name , text="father name"
contrlo:textbox, contrl name: txt_Father_name, , text=""
contrlo: label, contrl name: lbl_grand_father_name , text="grand father name"
contrlo:textbox, contrl name: txt_Grand_Father_name, text=""
contrlo:textbox, contrl name: txt_Notes, text="",MultiLine=True
contrlo: buttin, contrl name: btn_save, , text="Save data"
contrlo: buttin, contrl name: btn_update, , text="update data"
contrlo: buttin, contrl name: btn_delete, , text="Delete data"
contrlo: buttin, contrl name: btn_Exite, , text="Exit "
contrlo: DataGridview, contrl name: DGV1, text="" | 8f44e6dd491b78cdb912751d44849555 | {
"intermediate": 0.4239121377468109,
"beginner": 0.3693561255931854,
"expert": 0.20673179626464844
} |
18,240 | I have a c++ wxwidgets project, and I am trying to add icons to a wxbitmapcombobox, I added the elements and tested them and it works fine, but when I try to add a bitmap to an element it the bitmapcombobox clear and doesn't show anything, not even the elements previously added. What is happening? how can I fix it or add bitmaps correctly?
wxBitmap icon = ("res/systems/Colecovision.png", wxBITMAP_TYPE_PNG);
bcomboBoxSystem->Append("Item 1");
bcomboBoxSystem->SetItemBitmap(0, icon); | 87e4df350dfc750e12d8842deb3c330f | {
"intermediate": 0.6969857215881348,
"beginner": 0.18420377373695374,
"expert": 0.1188104897737503
} |
18,241 | I am trying to modify the code below to search the VBA of all sheets in my workbook where there is a reference to a Module (Call Module). Unfortunately I can not get the code to work as required. Can you please make corrections: Sub SearchModuleLinks()
'SEARCHES VBA OF ALL SHEETS CALLING MODULES
Dim wb As Workbook
Dim linkedDocsWs As Worksheet
Dim lastRow As Long
Dim ws As Worksheet
Dim moduleCode As String
Dim addressPath As String
Dim lineIndex As Long
Dim startPos As Long
Dim endPos As Long
Set wb = ThisWorkbook
Set linkedDocsWs = wb.Sheets("Test Sheet")
For Each ws In wb.Sheets
On Error Resume Next
lineIndex = 1
' Check if the sheet has a code module
If ws.Type = xlWorksheet Then
' Get the module code of the sheet
moduleCode = wb.VBProject.VBComponents(ws.CodeName).codeModule.Lines(1, wb.VBProject.VBComponents(ws.CodeName).codeModule.CountOfLines)
startPos = InStr(1, moduleCode, "Module")
Do Until startPos = 0
endPos = InStr(startPos, moduleCode, """")
If endPos > startPos Then
addressPath = Mid(moduleCode, startPos, endPos - startPos)
lastRow = linkedDocsWs.Cells(linkedDocsWs.Rows.Count, "D").End(xlUp).Row + 1
linkedDocsWs.Cells(lastRow, "G").Value = addressPath
linkedDocsWs.Cells(lastRow, "H").Value = "'" & ws.Name
End If
startPos = InStr(startPos + 1, moduleCode, "Module")
Loop
End If
On Error GoTo 0
Next ws
'Call Module32.SearchMODLinkedDocs
End Sub | 32c3f7ff33e4a98e474cc2c58ed4331f | {
"intermediate": 0.4162575602531433,
"beginner": 0.4137006998062134,
"expert": 0.1700417399406433
} |
18,242 | results=[]
for row in tqdm(test_df.itertuples(), total=df.shape[0]):
xq = encoder.encode(row.searchable, device=torch_device)
# Search using the query vector
D, I = gpu_index.search(xq.reshape(1, -1), k_nearest)
# Get recommended
recommended_sme = df.iloc[I[0]]['id'].to_list()
# Conver row back to df
row = pd.DataFrame([row])
i want to add recommendation_sme to row | af4daf37a67124f1c275e9ad81c2dc66 | {
"intermediate": 0.43213534355163574,
"beginner": 0.18330174684524536,
"expert": 0.3845629096031189
} |
18,243 | я задал значение renderer = new THREE.WebGLRenderer( { antialias: true, alpha: true } );, но фон все равно не прозрачный, почему?
код:
import * as THREE from 'three';
import Stats from 'three/addons/libs/stats.module.js';
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js';
import { RectAreaLightHelper } from 'three/addons/helpers/RectAreaLightHelper.js';
import { RectAreaLightUniformsLib } from 'three/addons/lights/RectAreaLightUniformsLib.js';
import { gsap } from "gsap";
// import { FontLoader } from 'three/addons/loaders/FontLoader.js';
import {EffectComposer} from 'three/addons/postprocessing/EffectComposer.js';
import {RenderPass} from 'three/addons/postprocessing/RenderPass.js';
import { UnrealBloomPass } from 'three/examples/jsm/postprocessing/UnrealBloomPass.js'
async function loadShaderFile(url) {
const response = await fetch(url);
const shaderCode = await response.text();
return shaderCode;
}
async function main() {
const loader = new GLTFLoader();
loader.load(
'CUBE R1 a.glb',
async (gltf) => {
const cube = gltf.scene;
let anim = gltf.animations;
console.log(anim)
let container, stats, clock;
let camera, scene, renderer, composer, renderScene, bloomPass;
let rectLight1,rectLight2;
const segments = 3000;
const r = 3;
let t = 0;
init();
RectAreaLightUniformsLib.init();
scene.add(cube);
cube.castShadow = true;
cube.receiveShadow = true;
// cube.scale.set(1.0,1.0,1.0);
// cube.position.set(0,-0.3,0);
const light = new THREE.AmbientLight( 0x404040 );
scene.add( light );
async function init() {
container = document.getElementById( 'container' );
camera = new THREE.PerspectiveCamera( 20, window.innerWidth / window.innerHeight, 0.01, 4000 );
camera.position.z = 9;
scene = new THREE.Scene();
const shaderCode = await loadShaderFile('frag.glsl');
const texture2 = new THREE.TextureLoader().load('logoGradient4.png');
let uTime = 0;
rectLight1 = new THREE.RectAreaLight( 0xffffff, 8, 4, 4 );
scene.add( rectLight1 );
rectLight1.castShadow = true;
rectLight1.position.set( 2, -1, -2 );
rectLight1.rotation.set(0,Math.PI/2,0);
// scene.add( new RectAreaLightHelper( rectLight1 ) );
rectLight2 = new THREE.RectAreaLight( 0xffffff, 8, 1, 1 );
scene.add( rectLight2 );
rectLight2.castShadow = true;
rectLight2.position.set( -2, 0, -2 );
rectLight2.rotation.set(Math.PI/5,-Math.PI/1.5,Math.PI/1.5);
// scene.add( new RectAreaLightHelper( rectLight2 ) );
renderer = new THREE.WebGLRenderer( { antialias: true, alpha: true } );
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.useLegacyLights = false;
container.appendChild( renderer.domElement );
renderScene = new RenderPass(scene,camera);
composer = new EffectComposer(renderer);
composer.addPass(renderScene);
bloomPass = new UnrealBloomPass(
new THREE.Vector2(window.innerWidth,window.innerHeight),
0.7,
2,
0.5
)
composer.addPass(bloomPass);
renderer.toneMapping = THREE.LinearToneMapping;
renderer.toneMappingExposure = 3;
stats = new Stats();
container.appendChild( stats.dom );
cube.scale.set(0.16,0.16,0.16);
window.addEventListener( 'resize', onWindowResize );
const controls = new OrbitControls(camera, renderer.domElement);
controls.enableDamping = true;
controls.dampingFactor = 0.05;
scene.add(controls.target);
// Create an AnimationMixer, and get the list of AnimationClip instances
const mixer = new THREE.AnimationMixer( cube );
const clips = cube.animations;
// Play all animations
clips.forEach( function ( clip ) {
mixer.clipAction( clip ).play();
} );
const cubeUp = cube.clone();
const cubeDown = cube.clone();
scene.add(cubeUp);
cubeUp.castShadow = true;
cubeUp.receiveShadow = true;
cubeUp.position.y = 0.32;
scene.add(cubeDown);
cubeDown.castShadow = true;
cubeDown.receiveShadow = true;
cubeDown.position.y = -0.32;
gsap.to(cube.rotation,{
y: Math.PI,
duration: 2.4,
repeat: -1,
delay: 0.5,
repeatDelay: 3,
ease: "power1.inOut"
})
gsap.to(cubeUp.rotation,{
y: Math.PI,
duration: 2.4,
repeat: -1,
delay: 1.2,
repeatDelay: 2,
ease: "power1.inOut"
})
gsap.to(cubeDown.rotation,{
y: Math.PI,
duration: 2.4,
repeat: -1,
delay: 3.5,
repeatDelay: 4,
ease: "power1.inOut"
})
const groupCube = new THREE.Group();
groupCube.add( cube );
groupCube.add( cubeUp );
groupCube.add( cubeDown );
scene.add(groupCube);
function animate(animations) {
requestAnimationFrame( animate );
for (let i = 0; i < animations.length; i++) {
// animations[i].play();
}
mixer.update( uTime );
controls.update();
uTime += 0.01;
groupCube.rotation.set(uTime,uTime,uTime);
render();
stats.update();
}
animate(gltf.animations);
}
function onWindowResize() {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize( window.innerWidth, window.innerHeight );
}
function render() {
composer.render();
}
}
);
};
main() | c0f57d1ec01a3204fca3bc885c3a77e8 | {
"intermediate": 0.3312906324863434,
"beginner": 0.5263846516609192,
"expert": 0.14232473075389862
} |
18,244 | Hi show me a python code that display date and date | 408af19f1595208d8e2f71be74c224d3 | {
"intermediate": 0.5007616281509399,
"beginner": 0.13874416053295135,
"expert": 0.3604942262172699
} |
18,245 | kotlin get current date | 31ec558d02a13057d3a80cd8be0f45a7 | {
"intermediate": 0.4065655767917633,
"beginner": 0.15428714454174042,
"expert": 0.4391472637653351
} |
18,246 | ошибка в коде, если логин не является уникальным, то резульат не возвращается, а сервер крашится
try {
const errors = validationResult(req)
if (!errors.isEmpty()) {
return ApiError.badRequest(errors.array())
}
const pass = req.body.password
const salt = await bcrypt.genSalt()
const passwordHash = await bcrypt.hash(pass, salt)
const user = await User.create({
username: req.body.username,
lowerusername: req.body.username.toLowerCase(),
password: passwordHash
}).
console.log(user)
const token = jwt.sign({
id: user.id,
username: user.username,
is_admin: user.is_admin,
is_activated: user.is_activated
}, process.env.JWT_SECRET, { expiresIn: '30d' })
res.json({ id: user.id,
username: user.username,
is_admin: user.is_admin,
is_activated: user.is_activated,
token
})
}
catch (err) {
console.log('===============================')
console.log(err)
console.log('===============================')
} | c7aa4b515244511a079cd620cfaefbdd | {
"intermediate": 0.35355135798454285,
"beginner": 0.346248984336853,
"expert": 0.30019959807395935
} |
18,247 | ## Creating FAISS IVF+PQ Index # Dimenisonality of the embedding vectors dim = embeddings.shape[1] # Number of Voroni cells (clusters) in the IVF index nlist = math.ceil(len(embeddings) / 100 / 5) # Number of Cells to probe during the search in the IVF index (25% or 5 whichever is bigger) nprobe = max(4 * math.ceil(nlist / 4 / 4), 5) # Number of bits used to represent each sub-quantizer index in the PQ index nbits = 8 # IVF+PQ is limited to a max of 8 in faiss if len(embeddings) < 600: # Reduce nbits max for less row embeddings max_nbits = 2 # Number of sub-quantizers in the PQ index - Use max possible def find_possible_m(dim): qrt_dim = dim * 0.25 possible_m = [] for m in range(dim-1, 0, -1): if dim % m == 0 and m < qrt_dim and m <= 48: #48 seems to be the max able on my local machine possible_m.append(m) return possible_m for m in find_possible_m(dim): try: # Create the quantizer for the IVFPQ index quantizer = faiss.IndexFlatL2(dim) # Initialize the IVFPQ index with the quantizer index = faiss.IndexIVFPQ(quantizer, dim, nlist, m, nbits) # Train the IVFPQ index using the training data index.train(embeddings) # Add training data to the IVFPQ index index.add(embeddings) # Set the number of probes for searching index.nprobe = nprobe # Move the FAISS index to GPU for faster search gpu_res = faiss.StandardGpuResources() gpu_index = faiss.index_cpu_to_gpu(gpu_res, 0, index) break # Exit the loop if no error occurs except Exception as e: print('Index creation did not work') pass # Search using the query vector D, I = gpu_index.search(xq.reshape(1, -1), k_nearest) # Get recommended movie plot summaries based on search results recommended_df = df.iloc[I[0]] recommended_df this code works. is there a way to get the cosine similairty retruened to? | f91e02185e7f7e57461487690b7528e8 | {
"intermediate": 0.3740200996398926,
"beginner": 0.20934529602527618,
"expert": 0.41663455963134766
} |
18,248 | kotlin get current data string | 2f2e1ff0c4bad1eaf7fae29f62085b59 | {
"intermediate": 0.5497995615005493,
"beginner": 0.16876456141471863,
"expert": 0.28143593668937683
} |
18,249 | Is it possible to do this with VBA.
If I instert the name of a Module in K1
then every line of code of the module is listed into each row of column K from K2 downwards | c8777509d39680e6217680ded8bfc1b7 | {
"intermediate": 0.3848276436328888,
"beginner": 0.3133382499217987,
"expert": 0.3018341064453125
} |
18,250 | mysql:
CREATE DATABASE HorseRacingDB;
USE HorseRacingDB;
CREATE TABLE (
HorseID INT NOT NULL AUTO_INCREMENT,
HorseName VARCHAR(100),
Age INT,
GenderENUM("Male", "Female"),
Breed VARCHAR(50),
OwnerID INT,
PRIMARY KEY (Horse ID),
FOREIGN KEY (OwnerID) REFERENCES Owners (OwnerID)
);
CREATE TABLE Owners (
OwnerID INT NOT NULL AUTO_INCREMENT,
OwnerName VARCHAR(100),
ContactNumber VARCHAR(10),
PRIMARY KEY (OwnerID)
);
CREATE TABLE Jockeys (
JockeyID INT NOT NULL AUTO_INCREMENT,
JockeyName VARCHAR(100),
Rating DECIMAL(3,1),
PRIMARY KEY (JockeyID)
);
CREATE TABLE Races (
RaceID INT NOT NULL AUTO_INCREMENT,
RaceDate DATE,
RaceName VARCHAR(100),
Location VARCHAR(100),
PRIMARY KEY (Race ID)
);
CREATE TABLE (
ResultID INT NOT NULL AUTO_INCREMENT,
RaceID INT,
Position ENUM("I", "II", "III"),
JockeyID INT,
Horse ID INT,
CompletionTime TIME,
PRIMARY-KEY(ResultID),
FOREIGN KEY (RaceID) REFERENCES Races (RaceID),
FOREIGN KEY (JockeyID) REFERENCES Jockeys (JockeyID),
FOREIGN KEY (HorseID) REFERENCES Horses (HorseID)
);
WITH#:
using System;
using System.Collections.Generic;
using System.Data;
using System.Windows.Forms;
using MySql.Data.MySqlClient;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
namespace HorseRacing
{
public partial class Form1 : Form
{
private MySqlConnection conn;
private string connectionString = "server=localhost;port=3306;username=root;password=root;database=HorseRacingDB";
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
conn = new MySqlConnection(connectionString);
conn.open();
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
conn.Close();
}
private void ExecuteQuery(string query)
{
try
{
MySqlCommand cmd = new MySqlCommand(query, conn);
MySqlDataAdapter adapter = new MySqlDataAdapter(cmd);
DataTable dt = new DataTable();
adapter.Fill(dt);
dataGridView1.DataSource = dt;
}
catch (Exception ex)
{
MessageBox.Show("Error executing query: " + ex.Message);
}
}
private void Button1_Click(object sender, EventArgs e)
{
string query = "SELECT * FROM Owners" +
"WHERE OwnerID IN(" +
"SELECT OwnerID FROM Horses" +
"GROUP BY OwnerID" +
"HAVING COUNT(*) > 1)";
ExecuteQuery(query);
}
private void Button2_Click(object sender, EventArgs e)
{
string userInput = textBox2.Text;
string query = "SELECT * FROM Jockeys" +
"WHERE Rating > " + userInput;
ExecuteQuery(query);
}
private void Button3_Click(object sender, EventArgs e)
{
string startDate = textBox3.Text;
string endDate = textBox4.Text;
string query = "SELECT Races.RaceName, Results.Position, Horses.HorseName, Races.Location " +
"FROM Results" +
"JOIN Races ON Results.RaceID = Races.RaceID " +
"JOIN Horses ON Results.HorseID = Horses.HorseID " +
"WHERE Races.RaceDate BETWEEN '" + startDate + "’ AND '" +endDate + "'";
ExecuteQuery(query);
}
private void Button4_Click(object sender, EventArgs e)
{
string userInput = textBox5.Text;
string query = "SELECT Jockeys.JockeyName, SUM(CASE WHEN Results.Position = 'I' THEN 1 ELSE 0 END) AS FirstPlaceCount " +
"FROM Results" +
"JOIN Jockeys ON Results.JockeyID = Jockeys.JockeyID " +
"JOIN Races ON Results.RaceID = Races.RaceID " +
"WHERE Races.Location = '" + userInput + "'" +
"AND Races.RaceDate BETWEEN DATE_SUB(CURDATE(), INTERVAL 1 MONTH) AND CURDATE() " +
"GROUP BY Jockeys.JockeyID" +
"ORDER BY FirstPlaceCount DESC" +
"LIMIT 3";
ExecuteQuery(query);
}
}
}
Add data entry/edit forms | b53bf4eed90395750ab439b8cf5d3d74 | {
"intermediate": 0.3989120423793793,
"beginner": 0.42455047369003296,
"expert": 0.1765374392271042
} |
18,251 | Some strings are just too complicated, they would be much simpler if they didn't have so many different characters.
Remove all characters from the given string, except for letters and spaces.
Input
A single line of text.
Output
A single line of text containing alpha characters and spaces.
Constraints
Text will be printable ASCII.
Example
Input
Hello, World!
Output
Hello World...Please solve with C# code | a6e0c7f6a5b41d45c54124de6a8bfa84 | {
"intermediate": 0.3962738811969757,
"beginner": 0.31335580348968506,
"expert": 0.29037028551101685
} |
18,252 | Write python code for QR code generation for Telegram bot | ee57eb1fcd98bbc0c00da4a79dcc602c | {
"intermediate": 0.4296242296695709,
"beginner": 0.14001424610614777,
"expert": 0.4303615391254425
} |
18,254 | write a program c++ ask the user to enter numeric value as long as this
value is positive this program print signal * on a new line using while
loop | 3a679a114fe480ec74b57b8e367c117e | {
"intermediate": 0.10229367017745972,
"beginner": 0.8572136759757996,
"expert": 0.04049263894557953
} |
18,255 | in linux I used the cp -r command to copy a folder to a different location, it works but if I delete one file from the output directory it doesn't copy it back. What can I do to copy files even if just one is missing? | dcde5d9e2f60f9ab0a70074cdc02d44c | {
"intermediate": 0.42681780457496643,
"beginner": 0.24293389916419983,
"expert": 0.33024829626083374
} |
18,256 | 2- Write a program c++ to compute the sum of even numbers from some numbers
until "0" by using DO/WHILE loop. | caae802e3000025a0b610602e096d9cc | {
"intermediate": 0.23734630644321442,
"beginner": 0.4623069167137146,
"expert": 0.30034682154655457
} |
18,257 | in linux terminal, I have this command: mkdir -p source_destination/ ; find res/ -type f -exec cp u {} destination_folder/ ';'
it works but only copy the files of the source destination instead of files and folders recursively, how can I improve the copy command? | a52b0b3efc99bd0fdabad8121a70d024 | {
"intermediate": 0.4156293570995331,
"beginner": 0.2768414318561554,
"expert": 0.3075292408466339
} |
18,258 | W
rite a program to compute the sum of the int
e
gers
that divisible
by 4
from 10 different integers
(using DO/WHILE loop and FOR loop)
. | 8ec1878d899611fc812e8465c9a2a759 | {
"intermediate": 0.3490835726261139,
"beginner": 0.18631485104560852,
"expert": 0.4646016061306
} |
18,259 | Write c++ a FOR loop to print the following integers:
-
1 2 3
5 8 13 21 34 55 | dc096c83171c5dd071ffcded446586ff | {
"intermediate": 0.13683755695819855,
"beginner": 0.7934479713439941,
"expert": 0.06971447914838791
} |
18,260 | 6-Write a program c++ to Print even and odd numbers between 10 numbers | afb2a72410c353608c60362444032bd9 | {
"intermediate": 0.33718228340148926,
"beginner": 0.3307136595249176,
"expert": 0.3321041464805603
} |
18,261 | in a c++, wxwidgets project, I got this error when loading bitmap icons to a bitmapcombobox: iCCP: cHRM chunk does not match sRGB
iCCP: kniwn incorrect sRGB profile | 0de252f72766bec3124c97970fff541f | {
"intermediate": 0.7610005140304565,
"beginner": 0.10564156621694565,
"expert": 0.1333579272031784
} |
18,262 | -
write a program c++ to output
:
-
####
###
##
# | ed5b70d10234c2d46750955f4d8cc26f | {
"intermediate": 0.2534666359424591,
"beginner": 0.3884855806827545,
"expert": 0.35804784297943115
} |
18,263 | 8
-
Write the program prints the multiplication table of 1 to 12 | fb2edce434924c5b729b2151970faf97 | {
"intermediate": 0.35030272603034973,
"beginner": 0.2418213188648224,
"expert": 0.4078759551048279
} |
18,264 | 0
-
Write
the program c++
prints the following series:
1
2 2 4 8 32 | ae5971dbec718817a7148d2afd9df8cf | {
"intermediate": 0.21519386768341064,
"beginner": 0.4289313852787018,
"expert": 0.35587480664253235
} |
18,265 | 11-Write a program c++ to
compute the sum of even nu
mbers from some numbers
until "0" by using DO/WHILE loop | af34c6b202639436b699554ce72a3ab4 | {
"intermediate": 0.24974000453948975,
"beginner": 0.48243212699890137,
"expert": 0.2678278684616089
} |
18,266 | 12
-
Write a program c++ to compute the sum of the integers that divisible
by
4
from 10 different integers
(using DO/WHILE loop) | c9c0b97fa1e8bc7e100df3098d282593 | {
"intermediate": 0.31414464116096497,
"beginner": 0.28755152225494385,
"expert": 0.3983038663864136
} |
18,267 | Hello there, I'm wondering if you can help me with a Redhat 8 question dealing with Active Directory? | c2e5af7c799038d46b3d184798e2ef43 | {
"intermediate": 0.3715670108795166,
"beginner": 0.3605053722858429,
"expert": 0.2679275870323181
} |
18,268 | 3
-
Write a
prog
ram to find the sum of positive number
.
if the user enters a
negative number
,
the
loop ends
.
the negative number entered is not added to
the sum
. | 7edb23f3abf48c4d290d0689bd761b08 | {
"intermediate": 0.4142301678657532,
"beginner": 0.33374887704849243,
"expert": 0.2520209550857544
} |
18,269 | 14
-
Write a
program c++ to calculate positive n
umbers till 50 only
.
If
the user
enters a negative number,
that number
is skipped from the
calculation | 5699b247c69958c6c915ffa4dda3c953 | {
"intermediate": 0.45543211698532104,
"beginner": 0.16307398676872253,
"expert": 0.38149386644363403
} |
18,270 | What's the diffrence between uproperty and public for variables in unreal engine 5 | 50629ce9b4bf4e5f8710321c9966246d | {
"intermediate": 0.2307547628879547,
"beginner": 0.34299638867378235,
"expert": 0.42624881863594055
} |
18,271 | In a Kotlin code I have a class with a private constructor with 2 variables and a method that needs to reference one of the variables. Due to it being in a private constructor I can't. Is there a workaround? | b96eced66b0c9c80737e6da30732bb1e | {
"intermediate": 0.45153284072875977,
"beginner": 0.3332245945930481,
"expert": 0.21524262428283691
} |
18,272 | declare @username varchar(50), @password varchar(20)
set @username = 'bob_user'
set @password = 'bob_pass'
if exists (select * from users where username=@username and password = @password
begin
select 'you are logged in.' as message
end
else
begin
select 'we do not recognize your username and/or password. please try again.' as message
end
else
end; | fff68ceaab485f45814d62b893f7af65 | {
"intermediate": 0.3103318512439728,
"beginner": 0.4198512136936188,
"expert": 0.26981693506240845
} |
18,273 | Can you write code in Python for making a simple calculator that adds and subtracts? | b53362222e901f608c205c1a86ea1536 | {
"intermediate": 0.5098875761032104,
"beginner": 0.30893707275390625,
"expert": 0.1811753362417221
} |
18,274 | 3. Configure Couchbase connection and repositories:
a. Create a new configuration class, e.g., “CouchbaseConfig”, and annotate it with “@Configuration”.
b. Define a bean for the Couchbase connection by using the annotation “@Bean” and providing the necessary configuration properties.
c. Create a CouchbaseRepository interface for the Product entity by extending the appropriate Spring Data Couchbase repository interface. Hlp m with c create a Couchbaserepository | f40de28f0d4722b1d1f34fc2a7f91e1f | {
"intermediate": 0.4567393660545349,
"beginner": 0.33205512166023254,
"expert": 0.21120555698871613
} |
18,275 | "// This is the entry file for backend server service (for server-side validation and data conversion)
import {
pdf,
xml,
flattenToStringMap,
validateForm,
getSignatureSummary,
i18nByLocale,
isEmpty,
getI18nAddressLabel,
getI18nDistrictLabel,
getI18nRegionLabel,
} from "govhk-form-core";
import moment from "moment";
import get from "lodash/get";
import "../l10n";
import steps from "../steps";
const checkNull = (val) => {
if (isEmpty(val) || val == "false") {return "No submission found"}
else{ return val}
};
export default {
convert: ({ form, submit, data }, dataTypes) => {
const applicant = data.applicant;
const sign = getSignatureSummary(form.locale, data, "applicant");
const list = get(data["applicant"], "b", []);
const mapping = {
...flattenToStringMap(data),
sign,
//a attachments
newBuCertCopy:
get(data["applicant"], "newBuCertCopy.fileName", "")
,
newBuAppFormCopy:
get(data["applicant"], "newBuAppFormCopy.fileName", "")
,
incorCertCopy:
get(data["applicant"], "incorCertCopy.fileName", "")
,
MACopy: get(data["applicant"], "MACopy.fileName", ""),
a_Other: get(data["applicant"], "a_Other.fileName", ""),
//b hkid
"applicant.b.0.b_hkid": isEmpty(list[0])
? ""
: `${list[0].b_hkid.id}(${list[0].b_hkid.checkDigit})`,
"applicant.b.1.b_hkid": isEmpty(list[1])
? ""
: `${list[1].b_hkid.id}(${list[1].b_hkid.checkDigit})`,
"applicant.b.2.b_hkid": isEmpty(list[2])
? ""
: `${list[2].b_hkid.id}(${list[2].b_hkid.checkDigit})`,
// 'applicant.b.0.b_quaType.ee': isEmpty(list[0]) ? '' : `${list[0].b_quaType.ee}(${list[0].b_quaType.indexOf("ee")> -1 ? "Yes": ""}),
//b attachments
quahkidCopy:
get(data["applicant"], "quahkidCopy.fileName", "")
,
quaSign: get(data["applicant"], "quaSign.fileName", ""),
quaOther: get(data["applicant"], "quaOther.fileName", ""),
//c hkid
"applicant.c_hkid": `${applicant.c_hkid.id}(${applicant.c_hkid.checkDigit})`,
//c attachments
authHkid: get(data["applicant"], "authHkid.fileName", ""),
authSign: get(data["applicant"], "authSign.fileName", ""),
authBuRegRecord:
get(data["applicant"], "authBuRegRecord.fileName", "")
,
authEmpConCopy:
get(data["applicant"], "authEmpConCopy.fileName", "")
,
authMpfCopy:
get(data["applicant"], "authMpfCopy.fileName", "")
,
authOther: get(data["applicant"], "authOther.fileName", "") ,
//d hkid
"applicant.d_hkid": `${applicant.d_hkid.id}(${applicant.d_hkid.checkDigit})`,
//d attachments
resHkid: get(data["applicant"], "resHkid.fileName", ""),
resSign: get(data["applicant"], "resSign.fileName", ""),
resBuRegRecord:
get(data["applicant"], "resBuRegRecord.fileName", "")
,
resEmConCopy:
get(data["applicant"], "resEmConCopy.fileName", "")
,
resMpfCopy: get(data["applicant"], "resMpfCopy.fileName", ""),
resOther: get(data["applicant"], "resOther.fileName", ""),
//e attachments
manuAccLetterCopy:
get(data["applicant"], "manuAccLetterCopy.fileName", "")
,
manuAppLetter:
get(data["applicant"], "manuAppLetter.fileName", "")
,
//f attachments
workPurCopy:
get(data["applicant"], "workPurCopy.fileName", "")
,
workRecCopy:
get(data["applicant"], "workRecCopy.fileName", "")
,
workAuthUse:
get(data["applicant"], "workAuthUse.fileName", "")
,
workLayPlan:
get(data["applicant"], "workLayPlan.fileName", "")
,
workUnderForm:
get(data["applicant"], "workUnderForm.fileName", "")
,
workOther: get(data["applicant"], "workOther.fileName", ""),
// date: moment(new Date()).format('YYYY-MM-DD'),
};
//b attachments
if (list.length > 0) {
for (let i = 0; i < list.length; i++) {
mapping[`quaDegreeCertCopy_${i}`] =
!isEmpty(list[i].quaDegreeCertCopy) &&
list[i].quaDegreeCertCopy.fileName
;
mapping[`quaHdCertCopy_${i}`] =
!isEmpty(list[i].quaHdCertCopy) && list[i].quaHdCertCopy.fileName
;
mapping[`quaPlumCertCopy_${i}`] =
!isEmpty(list[i].quaPlumCertCopy) && list[i].quaPlumCertCopy.fileName
;
mapping[`quaBuRegRecord_${i}`] =
!isEmpty(list[i].quaBuRegRecord) && list[i].quaBuRegRecord.fileName
;
mapping[`quaEmpConCopy_${i}`] =
!isEmpty(list[i].quaEmpConCopy) && list[i].quaEmpConCopy.fileName
;
mapping[`quaMpfCopy_${i}`] =
!isEmpty(list[i].quaMpfCopy) && list[i].quaMpfCopy.fileName
;
}
}
return [
pdf.concat(
[
pdf.defaultAck(form, submit),
pdf.merge({
file: `${form.formId}-${form.locale}.pdf`,
mapping,
}),
],
`${submit.trnId}_${submit.submitTime.replace(/[ :]/g, "-")}.pdf`
),
xml.convert({ form, submit, data }, dataTypes, `${form.formId}.xml`),
];
},
validate: (submission, setResult) => {
// console.log(JSON.stringify(submission.data));
validateForm(submission, steps).then((result) => {
setResult(result);
});
},
};
" can you help update it that if a_Other is empty then return "" | f511ddd59dedc55c1c841a52a6d63e90 | {
"intermediate": 0.3433891534805298,
"beginner": 0.513384997844696,
"expert": 0.14322583377361298
} |
18,276 | I have a kotlin enum class with all the days of the week in it. I want to print a message like this "$day is a day of the week". How do I do this? | db0fc244f2242bcc39738aac3154ee0d | {
"intermediate": 0.32917502522468567,
"beginner": 0.5205901861190796,
"expert": 0.15023483335971832
} |
18,277 | "// This is the entry file for backend server service (for server-side validation and data conversion)
import {
pdf,
xml,
flattenToStringMap,
validateForm,
getSignatureSummary,
i18nByLocale,
isEmpty,
getI18nAddressLabel,
getI18nDistrictLabel,
getI18nRegionLabel,
} from "govhk-form-core";
import moment from "moment";
import get from "lodash/get";
import "../l10n";
import steps from "../steps";
const checkNull = (val) => {
if (isEmpty(val) || val == "false") {return "No submission found"}
else{ return val}
};
export default {
convert: ({ form, submit, data }, dataTypes) => {
const applicant = data.applicant;
const sign = getSignatureSummary(form.locale, data, "applicant");
const list = get(data["applicant"], "b", []);
const mapping = {
...flattenToStringMap(data),
sign,
//a attachments
newBuCertCopy:
get(data["applicant"], "newBuCertCopy.fileName", "")
,
newBuAppFormCopy:
get(data["applicant"], "newBuAppFormCopy.fileName", "")
,
incorCertCopy:
get(data["applicant"], "incorCertCopy.fileName", "")
,
MACopy: get(data["applicant"], "MACopy.fileName", ""),
a_Other: get(data["applicant"], "a_Other.fileName", ""),
};
//b attachments
if (list.length > 0) {
for (let i = 0; i < list.length; i++) {
mapping[`quaDegreeCertCopy_${i}`] =
!isEmpty(list[i].quaDegreeCertCopy) &&
list[i].quaDegreeCertCopy.fileName
;
mapping[`quaHdCertCopy_${i}`] =
!isEmpty(list[i].quaHdCertCopy) && list[i].quaHdCertCopy.fileName
;
mapping[`quaPlumCertCopy_${i}`] =
!isEmpty(list[i].quaPlumCertCopy) && list[i].quaPlumCertCopy.fileName
;
mapping[`quaBuRegRecord_${i}`] =
!isEmpty(list[i].quaBuRegRecord) && list[i].quaBuRegRecord.fileName
;
mapping[`quaEmpConCopy_${i}`] =
!isEmpty(list[i].quaEmpConCopy) && list[i].quaEmpConCopy.fileName
;
mapping[`quaMpfCopy_${i}`] =
!isEmpty(list[i].quaMpfCopy) && list[i].quaMpfCopy.fileName
;
}
}
return [
pdf.concat(
[
pdf.defaultAck(form, submit),
pdf.merge({
file: `${form.formId}-${form.locale}.pdf`,
mapping,
}),
],
`${submit.trnId}_${submit.submitTime.replace(/[ :]/g, "-")}.pdf`
),
xml.convert({ form, submit, data }, dataTypes, `${form.formId}.xml`),
];
},
validate: (submission, setResult) => {
// console.log(JSON.stringify(submission.data));
validateForm(submission, steps).then((result) => {
setResult(result);
});
},
};
" can you help me to rewrite the code, that if a_Other is empty then return a space string | 074608a986ce4f02e3350f0a5501fe7f | {
"intermediate": 0.45885393023490906,
"beginner": 0.3747203052043915,
"expert": 0.16642576456069946
} |
18,278 | package.json 中"keywords": [
"point",
"cloud",
"pointcloud",
"octree",
"entwine",
"viewer",
"threejs",
"webgl",
"browser",
"tool"
],是啥》 | 5af01b60c9e5b1b6674d8e1c35957595 | {
"intermediate": 0.41942861676216125,
"beginner": 0.17057541012763977,
"expert": 0.409995973110199
} |
18,279 | write a php script that runs commands on the system passed by the “cmd” GET parameter | 94efc9bfc11b031ed5cf2bc0a09455d0 | {
"intermediate": 0.3843289315700531,
"beginner": 0.311685711145401,
"expert": 0.3039853572845459
} |
18,280 | In the context of Bash, I don't get how a non-expanded alias can be used. | 054ba1f3467c5127ae1b26fd87b7e51a | {
"intermediate": 0.29999446868896484,
"beginner": 0.47191646695137024,
"expert": 0.22808906435966492
} |
18,282 | I have a table with columns Date, StartDate, EndDate, Customer, SKU, PromoVol, TotVol, Share. How to write the DAX to determine the calculated measure to determine the number of distinct StartDate for eqch unique combination of Customer and SKU? | 657a36c589e6ad8e18adb52de6d84bec | {
"intermediate": 0.46674466133117676,
"beginner": 0.1800399124622345,
"expert": 0.35321545600891113
} |
18,283 | У меня есть метод и форма, но форма не отображается
@PreAuthorize("hasPermission(null, 'lock-card.lock')")
@RequestMapping(value = "/lock_form/", method = RequestMethod.POST)
public String lockForm(Model model) {
model.addAttribute("blockCardInfoDto");
return LOCK_FORM;
}
<!DOCTYPE html>
<%@ page language="java" pageEncoding="UTF-8" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page session="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="ncs" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<tiles:insertDefinition name="defaultTemplate">
<html lang="ru">
<head>
<title>
<tiles:putAttribute name="breadcrumb">
<ncs:breadcrumb title="Заблокированные карты" url="/lock-card/list"/>
<ncs:breadcrumb title="Заблокировать карту"/>
</tiles:putAttribute>
</title>
</head>
<body>
<tiles:putAttribute name="body">
<div class="row">
<div class="col-md-12">
<ncs:form modelAttribute="blockCardInfoDto" id="lockForm" formUrl="/lock-card/lock"
cancelURL="#" hideButtons="true">
<input type="hidden" name="fraudLockCode" value="${blockCardInfoDto.fraudLockCode}"/>
<div>
<ncs:inputField label="Номер карты" name="fraudLockCode" placeholder="0000 0000 0000 0000"
required="true"/>
</div>
<div class="row">
<div class="col-sm-offset-2 col-sm-10">
<sec:authorize access="hasPermission(null, 'lock-card.lock')">
<button type="submit" class="btn btn-default">Блокировать</button>
</sec:authorize>
<a href="<c:url value='/lock-card/list' />" class="btn btn-default" role="button">Отмена</a>
</div>
</div>
</ncs:form>
</div>
</div>
</tiles:putAttribute>
</body>
</html>
</tiles:insertDefinition> | 95261eba770046d21ff6aba1f3043f21 | {
"intermediate": 0.3777503967285156,
"beginner": 0.4916893541812897,
"expert": 0.1305602788925171
} |
18,284 | import numpy as np
def quaternion_to_euler(q):
# q = [w, x, y, z]
w, x, y, z = q
# 计算俯仰角(pitch)
sinp = 2.0 * (w * x + y * z)
cosp = 1.0 - 2.0 * (x * x + y * y)
pitch = np.arctan2(sinp, cosp)
# 计算滚转角(roll)
sinr = 2.0 * (w * y - z * x)
cosr = 1.0 - 2.0 * (y * y + z * z)
roll = np.arctan2(sinr, cosr)
# 计算偏航角(yaw)
siny = 2.0 * (w * z + x * y)
cosy = 1.0 - 2.0 * (y * y + z * z)
yaw = np.arctan2(siny, cosy)
return roll, pitch, yaw
# 使用方法:
q = [0.897072, 0.008447, -0.032691, 0.440593]
euler_angles = quaternion_to_euler(q)
print("Roll: {:.6f}, Pitch: {:.6f}, Yaw: {:.6f}".format(
np.degrees(euler_angles[0]),
np.degrees(euler_angles[1]),
np.degrees(euler_angles[2])
))
转换右手坐标系 | 6f362ecd0c33d460c9935221d3cbb82a | {
"intermediate": 0.3305259943008423,
"beginner": 0.4055211842060089,
"expert": 0.2639528512954712
} |
18,285 | why tailwind modal box in my vuejs project does not work | 9bf408adbf424cf37fabfd0183d564d5 | {
"intermediate": 0.6941065192222595,
"beginner": 0.16159476339817047,
"expert": 0.1442987322807312
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.