row_id
int64
0
48.4k
init_message
stringlengths
1
342k
conversation_hash
stringlengths
32
32
scores
dict
20,495
write a java class called room that has name, capacity and noOfPersons as parameters
b4485aa3efffe64f1d3f38ae909c10ec
{ "intermediate": 0.2998958230018616, "beginner": 0.5077837109565735, "expert": 0.19232046604156494 }
20,496
reducers: { setBigOrders(state: BigOrdersSlice, action: PayloadAction<BigOrder[]>) { const newState: {[key: string]: {[key: number]: BigOrder}} = {}; action.payload.forEach((bigOrder) => { if (!newState[bigOrder.symbol]) { newState[bigOrder.symbol] = {}; } if (!newState[bigOrder.symbol][bigOrder.id]) { newState[bigOrder.symbol][bigOrder.id] = bigOrder; } }); Object.keys(newState).forEach((symbol: string) => { if (!isDeepStrictEqual(newState[symbol], state.bigOrders[symbol])) { state.bigOrders[symbol] = newState[symbol]; } }); }, }, state.bigOrders[symbol] // Type '{ [key: number]: BigOrder; }' is missing the following properties from type 'BigOrder[]': length, pop, push, concat, and 35 more.ts(2740)
a9448a0aa6e2a4898a0644de2afd4689
{ "intermediate": 0.3971703350543976, "beginner": 0.3534466028213501, "expert": 0.24938306212425232 }
20,497
const calcTrade = (kLineList: KLineData[]): BarTradeEntity[] => { console.log("calcTrade"); return bigOrders.map((order) => { let positionX: number = 0; for (let bar = 0; bar < kLineList.length; bar++) { const kLine = kLineList[bar]; if (order.timestamp <= kLine.timestamp) { if (positionX === 0) { positionX = bar; } break; } } return { id: order.id, timestamp: order.timestamp, price: order.price, positionX, }; }); }; Цикл в цикле не самый оптимальный алгоритм. Можно его как-нибудь оптимизировать?
111a77e2619ddff59dbd862ea8bc5585
{ "intermediate": 0.3798896372318268, "beginner": 0.3293071389198303, "expert": 0.2908031940460205 }
20,498
what programming language is used for Final Fantasy VII Remake
2526fd434f2f184b2211ae985a57b2ea
{ "intermediate": 0.2639029324054718, "beginner": 0.4215445816516876, "expert": 0.3145523965358734 }
20,499
Hi , I have an front end code . But this code contains 2 different folder. First one client second one server , but second one is not server in actually . We only send request to second one and then second one sends request to back end services. How can I connect client to server folder in front end . I am worked in 3001 port in client 3000 port in server
3e0ce352d5d7b844b6d17a9ecb957c07
{ "intermediate": 0.492832750082016, "beginner": 0.23241853713989258, "expert": 0.27474865317344666 }
20,500
under linux, what is the usage of getent ?
97a1dfd7ac84243fa27e43755286611d
{ "intermediate": 0.4103458523750305, "beginner": 0.25635337829589844, "expert": 0.33330076932907104 }
20,501
const moment = require('moment'); const blacklist = ['sik', 'yarak']; const empty = "-"; function formatMessage(username, text) { if(text.length < 200){ return { username, text, time: ` - ${moment().format('h:mm a')}` }; } } module.exports = formatMessage; Edit the code I gave you to block blacklıst words.
da23f6bd1afb5e4d02a7be6537d45e8e
{ "intermediate": 0.3291088044643402, "beginner": 0.3365130126476288, "expert": 0.3343781530857086 }
20,502
hi in Kotlin should a function returning Flow be marked suspended?
bead8013f5acbc6960f13099db9e9a99
{ "intermediate": 0.45422977209091187, "beginner": 0.38405099511146545, "expert": 0.1617191880941391 }
20,503
how to work 'hello react;
d811ced911757427bd2ffd19580f3c9e
{ "intermediate": 0.4540816843509674, "beginner": 0.28304100036621094, "expert": 0.26287737488746643 }
20,504
const OrderFeed = ({workerRef, symbol, settings}: OrderFeedProps) => { const cupParams = useSelector((state: AppState) => state.cupSlice); const [dpiScale, setDpiScale] = useState(Math.ceil(window.devicePixelRatio)); const [canvasSize, setCanvasSize] = useState<CanvasSize>({height: 0, width: 0}); const containerRef = useRef<HTMLDivElement|null>(null); const canvasRef = useRef<HTMLCanvasElement|null>(null); const size = useComponentResizeListener(canvasRef); const draw = (trades: TradeItem[], camera: number) => { if (null === canvasRef || !Array.isArray(trades)) return; const context = canvasRef.current?.getContext("2d"); if (context) { orderFeedDrawer.clear(context, canvasSize); orderFeedDrawer.drawLine( context, canvasSize, trades, camera, cupParams.aggregatedPriceStep, cupParams.cellHeight, cupParams.quantityDivider, !settings.minQuantity ? 0 : parseFloat(settings.minQuantity), dpiScale, theme, ); } }; useEffect(() => { if (!workerRef.current) return; draw(event.data.trades, event.data.camera) }, [workerRef.current, canvasRef.current ]); return <Box ref={containerRef} className={`${styles.canvasWrapper} scroll-block`}> <canvas ref={canvasRef} className={styles.canvas} width={canvasSize?.width} height={canvasSize?.height} /> </Box>; }; export default OrderFeed; const clamp = (value: number, min: number, max: number): number => { return Math.min(Math.max(value, min), max); }; const orderFeedDrawer = { clear: (ctx: CanvasRenderingContext2D, size: CanvasSize) => { ctx.clearRect(0, 0, size.width, size.height); }, drawLine: ( ctx: CanvasRenderingContext2D, canvasSize: CanvasSize, trades: TradeItem[], camera: number, aggregatedPriceStep: number, cupCellHeight: number, quantityDivider: number, minQuantity: number, dpiScale: number, theme: Theme, ) => { let startX = canvasSize.width - 10 * dpiScale; const fullHeightRowsCount = parseInt((canvasSize.height / cupCellHeight).toFixed(0)); const startY = (fullHeightRowsCount % 2 ? fullHeightRowsCount - 1 : fullHeightRowsCount) / 2 * cupCellHeight; const halfCupCellHeight = cupCellHeight / 2; ctx.beginPath(); ctx.strokeStyle = orderFeedOptions(theme).line.color; ctx.lineWidth = 2 * dpiScale; trades.forEach(trade => { const yModifier = (trade.price - (trade.price - (trade?.secondPrice || trade.price)) / 2 - camera) / aggregatedPriceStep * cupCellHeight + halfCupCellHeight; const width = 1.75 * clamp((trade.quantity / quantityDivider < minQuantity ? 0 : trade.radius), 5, 50) * dpiScale; ctx.lineTo(startX - width / 2, startY - yModifier); startX = startX - width; }); ctx.stroke(); }, }; export default orderFeedDrawer; https://www.npmjs.com/package/react-pixi-fiber нужно переписать отрисовку линий через библиотеку react-pixi-fiber
d17a1d7591752813908c0781fd57c1c2
{ "intermediate": 0.30150240659713745, "beginner": 0.4703338146209717, "expert": 0.22816377878189087 }
20,505
#include <iostream> using namespace std; int main() { int t, res; std::cin >> t; for (int i=0; i<t; i++){ int a, b, k; std::cin>>a>>b>>k; if (k %2 == 0) res = k/2 *(a-b); else res = k/2 *(a-b) + a; std::cout<< res; return 0; } }
d5108b7507791553e2e3dfd8b18899a8
{ "intermediate": 0.33219432830810547, "beginner": 0.4619489908218384, "expert": 0.20585668087005615 }
20,506
m_eval 'if(file_information("test1.dat") != "File not found") then echo "File found!" else echo "File not found." end' getting error
05817cee77083af0b7633454696a1e78
{ "intermediate": 0.38007044792175293, "beginner": 0.3850216567516327, "expert": 0.234907865524292 }
20,507
m_eval 'if[file_information("test1.dat")] then echo "File found!" else echo "File not found." end' is giving error
639412b98ebfbb48890563d4d6a1fdfa
{ "intermediate": 0.40070000290870667, "beginner": 0.37020912766456604, "expert": 0.2290908396244049 }
20,508
I have an array of data, this data is included into some objects. now I want to search if objects have a value
b368430c296282a894219264c9ca8b24
{ "intermediate": 0.5104134678840637, "beginner": 0.23402200639247894, "expert": 0.25556451082229614 }
20,509
how use .htaccess to change all http to https and www.DomainName.com to DomainName.com
63099b4bbcf0093df5416a85ffcac5b9
{ "intermediate": 0.4266425669193268, "beginner": 0.2671167850494385, "expert": 0.30624061822891235 }
20,510
const calcTrade = (kLineList: KLineData[]): BarTradeEntity[] => { return bigOrders.map((order) => { let positionX: number = 0; for (let bar = 0; bar < kLineList.length; bar++) { const kLine = kLineList[bar]; if (order.timestamp <= kLine.timestamp) { if (positionX === 0) { positionX = bar - 1; } break; } } return { id: order.id, timestamp: order.timestamp, price: order.price, positionX, }; }); }; Здесь нужно в начале запустить один отдельный цикл по KLineList, который создаст объект, где ключами будут timestamp, а значениями bar. В этом же цикле найти шаг между двумя timestamp. Затем запустить второй цикл уже по bigOrders. Для расчета positionX нужно будет расчитать существующий timestamp и получить значение из объекта первого цикла. Для расчета существующего timestamp нужно: Math.ceil(order.timestamp / timestampStep) * timestampStep
a491db2f7853c032807d069dac1d15cf
{ "intermediate": 0.36232733726501465, "beginner": 0.31518903374671936, "expert": 0.3224836587905884 }
20,511
In Hibernate, is it possible for a field of an entity to be a List whose elements are marked as embeddable?
cefb7188c0b63e8549cea551d3d9fa91
{ "intermediate": 0.5981445908546448, "beginner": 0.1078738421201706, "expert": 0.2939815819263458 }
20,512
const KLineChart: React.FC<KLineChartProps> = React.memo(({symbol, interval, windowChart, settingsTools, chartYAxisType}) => { const [candlesticks, setCandlesticks] = useState<Candle[]>([]); const [waiting, setWaiting] = useState(false); const fetchCandlesticks = () => { setWaiting(true); fetchSymbolsKlines(symbol, interval) .then((data) => { if (undefined === data) return; setCandlesticks(data.map(item => ({ timestamp: dayjs.utc(item[0]).valueOf(), open: parseFloat(item[1].toString()), high: parseFloat(item[2].toString()), low: parseFloat(item[3].toString()), close: parseFloat(item[4].toString()), volume: parseFloat(item[5].toString()), }))); }) .finally(() => { setWaiting(false); }); }; useEffect(() => { fetchCandlesticks(); }, [symbol, interval]); return ( <CandleChart candles={candlesticks} uniqueId={`chart${windowChart}-${symbol}`} symbolName={symbol} chartInterval={interval} waiting={waiting} setWaiting={setWaiting} settingsTools={settingsTools} chartYAxisType={chartYAxisType} showToolbar screenerPage showOpenOrders cleaningFigure /> ); }); KLineChart.displayName = "KLineChart"; export default KLineChart; нужно при изменении symbol не просто перерисовывать компонент CandleChart, а полностью стирать старый и рисовать новый
5288397b4395bf532992a8dc3d164b5b
{ "intermediate": 0.4478149712085724, "beginner": 0.24517475068569183, "expert": 0.307010293006897 }
20,513
how to check in runtime if value in this container boost::variant<nullptr_t, int64_t, std::string, bool, double> it of type bool
0344ef7bb42d40f83cf6ad4ec895f621
{ "intermediate": 0.5740212202072144, "beginner": 0.24979619681835175, "expert": 0.1761825978755951 }
20,514
Correct js code: // eRanConType prepares and returns Connection data fieldset export const eRanConType = (object => { //create port fieldset const connectionType = { legend: 'Connection Type', class: 'lte', name: 'connection', default: object.Connection, rows: object.Connections, display: 'grid', width: '50%', }.createFieldsetSelect() const conselector = connectionType.querySelector('select') conselector.addEventListener('change', (evnt) => { object.Connection = evnt.target.value }) //create port fieldset const port = { legend: 'Choose TnPort', class: 'lte', name: 'port', default: object.TnPort, rows: object.Ports, display: 'grid', width: '50%', }.createFieldsetSelect() const portselector = port.querySelector('select') portselector.addEventListener('change', (evnt) => { object.TnPort = evnt.target.value }) const check = connectionType.querySelector('select') check.addEventListener('change', (evnt) => { const key = evnt.target.value const port = { legend: 'Choose TnPort', class: 'lte', name: 'port', default: object.TnPort, rows: object.Ports, display: 'grid', width: '50%', } if (key != 'Router') { object.Vlans[key]['Vlan'] = '' port.remove() return connectionType } port.createFieldsetSelect() port.classList.add('pop-up') port.addEventListener('change', (evnt) => { object.TnPort = evnt.target.value row.appendChild(port) }) }) //return return connectionType })
af07a84be8db3d44087a3f7485b0237e
{ "intermediate": 0.39106836915016174, "beginner": 0.37146565318107605, "expert": 0.2374659776687622 }
20,515
Fix js code: // eRanConType prepares and returns Connection data fieldset export const eRanConType = (object => { //create port fieldset const connectionType = { legend: 'Connection Type', class: 'lte', name: 'connection', default: object.eranConnection.Connection, rows: object.eranConnection.Connections, display: 'grid', width: '50%', }.createFieldsetSelect() const conselector = connectionType.querySelector('select') conselector.addEventListener('change', (evnt) => { object.eranConnection.Connection = evnt.target.value }) const check = connectionType.querySelector('select') check.addEventListener('change', (evnt) => { const key = evnt.target.value const port = { legend: 'Choose TnPort', class: 'lte', name: 'port', default: object.bridge.TnPort, rows: object.bridge.Ports, display: 'grid', width: '50%', }.createFieldsetSelect() if (key != 'Router') { port.remove() return connectionType } port.classList.add('pop-up') port.addEventListener('change', (evnt) => { object.bridge.TnPort = evnt.target.value; connectionType.appendChild(port) }) }) //return return connectionType })
c69a8aafffac6d7cdde05e6e5caaafe8
{ "intermediate": 0.3957568407058716, "beginner": 0.33587929606437683, "expert": 0.2683638632297516 }
20,516
const KLineChart: React.FC<KLineChartProps> = React.memo(({symbol, interval, windowChart, settingsTools, chartYAxisType}) => { const [candlesticks, setCandlesticks] = useState<Candle[]>([]); const [waiting, setWaiting] = useState(false); const fetchCandlesticks = () => { setWaiting(true); fetchSymbolsKlines(symbol, interval) .then((data) => { if (undefined === data) return; setCandlesticks(data.map(item => ({ timestamp: dayjs.utc(item[0]).valueOf(), open: parseFloat(item[1].toString()), high: parseFloat(item[2].toString()), low: parseFloat(item[3].toString()), close: parseFloat(item[4].toString()), volume: parseFloat(item[5].toString()), }))); }) .finally(() => { setWaiting(false); }); }; useEffect(() => { fetchCandlesticks(); }, [symbol, interval]); return ( <CandleChart candles={candlesticks} uniqueId={chart${windowChart}-${symbol}} symbolName={symbol} chartInterval={interval} waiting={waiting} setWaiting={setWaiting} settingsTools={settingsTools} chartYAxisType={chartYAxisType} showToolbar screenerPage showOpenOrders cleaningFigure /> ); }); KLineChart.displayName = “KLineChart”; export default KLineChart; нужно при изменении symbol не просто перерисовывать компонент CandleChart, а полностью стирать старый и рисовать заново новый
b16b52922af9ce3dcd6490cca85cef6c
{ "intermediate": 0.44097745418548584, "beginner": 0.32580000162124634, "expert": 0.23322255909442902 }
20,517
return <Box height="100%" p={0.5} width="100%" borderRadius="8px" sx={{bgcolor: theme => theme.palette.mode === "dark" ? "#0d0d0d" : "#fff"}}> <Grid display="flex" justifyContent="space-between" > <FormControl sx={{mb: 1, height: 24, width: 43, px: 0, backgroundColor: theme => theme.palette.grey[100], color: "#191919", padding: "0", borderRadius: "8px", "& .MuiSelect-select": {paddingY: 0.55, pl: 1.3, overflow: "inherit"}, "& svg": {right: 2}, "& fieldset": {border: "none", pr: 0}, "& path": {color: (theme) => theme.palette.white.contrastText, pr: 0}, }}> <Select sx={{fontSize: 11, color: theme => theme.palette.white.contrastText}} value={interval} onChange={(e) => handleIntervalChange(e, windowChart)}> <MenuItem sx={{fontSize: 11}} value="1m">1м</MenuItem> <MenuItem sx={{fontSize: 11}} value="5m">5м</MenuItem> <MenuItem sx={{fontSize: 11}} value="15m">15м</MenuItem> <MenuItem sx={{fontSize: 11}} value="1h">1ч</MenuItem> <MenuItem sx={{fontSize: 11}} value="4h">4ч</MenuItem> <MenuItem sx={{fontSize: 11}} value="1d">1д</MenuItem> <MenuItem sx={{fontSize: 11}} value="1w">1н</MenuItem> </Select> </FormControl> <SettingsToolsMenu settingsTools={settingsTools} toggleVisibility={toggleVisibility} chartYAxisType={chartYAxisType} setChartYAxisType={setChartYAxisType} /> </Grid> { symbol ? <KLineChart symbol={symbol} windowChart={windowChart} interval={interval} settingsTools={settingsTools} chartYAxisType={chartYAxisType} /> : <Box width="100%" height="88%" display="flex" alignItems="center" justifyContent="center"> <Typography fontSize={28} color="#9999994d"> Выберите монету</Typography> </Box> } </Box>; }; при изменении symbol заново удалять <KLineChart symbol={symbol} windowChart={windowChart} interval={interval} settingsTools={settingsTools} chartYAxisType={chartYAxisType} /> и заново перерисовывать
1c3235efb3a2dce701443a859bd4f34e
{ "intermediate": 0.24237538874149323, "beginner": 0.4823589324951172, "expert": 0.2752656638622284 }
20,518
write python code to send messages to rabbitmq using the pika module
ae75a0a77b2e01afdf4cda96fa9b21ac
{ "intermediate": 0.4839949607849121, "beginner": 0.15172231197357178, "expert": 0.3642827272415161 }
20,519
How would I make an Azure Virtual Machine using Powershell?
8ff11c43f641f8008765763898ef4f0a
{ "intermediate": 0.5339058041572571, "beginner": 0.23992429673671722, "expert": 0.2261698842048645 }
20,520
(PHP) Proof read the following php code. How can I display the cookie value? The number in echo $Session_ID; and echo echo $_COOKIE["ECOM"]; should be same number $Session_ID=rand(1,99) echo "Your Session ID is: "; echo $Session_ID; echo ". "; setcookie("ECOM", $Session_ID, time() + 2400); echo "Cookie is set. It's value is: "; echo $_COOKIE["ECOM"];
42337a77f53bf5af66971644f63b6ec2
{ "intermediate": 0.5587686896324158, "beginner": 0.2853894829750061, "expert": 0.1558418571949005 }
20,521
Show me a program that simulates a neural net programmed in amstrad CPC locomotive basic.
c951beba9f3b6a7bde2e94593be45e72
{ "intermediate": 0.05735810846090317, "beginner": 0.0415610745549202, "expert": 0.901080846786499 }
20,522
Write basic ai app for linux
949a34c00557a6d86f003e6c8955cbf1
{ "intermediate": 0.35022470355033875, "beginner": 0.20631997287273407, "expert": 0.44345536828041077 }
20,523
write java code to get string from string-array by item id
2ba0e8e785897453d9a89e5906b44f45
{ "intermediate": 0.47226399183273315, "beginner": 0.2389177680015564, "expert": 0.28881821036338806 }
20,524
Why do I get a "no matching function" error in c++ when I try to use pop_back to enter a character value into a vector char
af1031b040d958b6bcea5f8f21ac6def
{ "intermediate": 0.5646138191223145, "beginner": 0.2856251001358032, "expert": 0.1497611552476883 }
20,525
can you bypass DNS filtering with pytohn?
fb7d67196f5ec9c5178ef8dda1713af9
{ "intermediate": 0.33547458052635193, "beginner": 0.2118133157491684, "expert": 0.4527120590209961 }
20,526
can you bypass DNS filtering in chrome with python or another way?
0c92e30ec45e5e6ab123d7382989376f
{ "intermediate": 0.3669816851615906, "beginner": 0.21318002045154572, "expert": 0.41983821988105774 }
20,527
can you bypass DNS filtering in chrome with python? note that i can only use python with NON admin privelges and cannot download any files of the internet i can use pip to install packages however, other than that i cant use CMD either, keep these restrictions in mind.
1218daccc7f54ab84cfc43980214cf4a
{ "intermediate": 0.3617241680622101, "beginner": 0.2495066225528717, "expert": 0.38876914978027344 }
20,528
here is an example of my r df: companycode financialyear total_penetration average_change 1 ANH 2011 0.6937561 0.0075398003 2 ANH 2012 0.7218856 0.0075398003 3 ANH 2013 0.7472039 0.0075398003 4 ANH 2014 0.7681970 0.0075398003 5 ANH 2015 0.7826535 0.0075398003 6 ANH 2016 0.7970239 0.0075398003 7 ANH 2017 0.8116085 0.0075398003 8 ANH 2018 0.8245756 0.0075398003 9 ANH 2019 0.8339903 0.0075398003 10 ANH 2020 0.8429301 0.0075398003 11 ANH 2021 0.8504699 0.0075398003 12 NES 2011 0.3546641 0.0087741670 13 NES 2012 0.3738781 0.0087741670 14 NES 2013 0.3919695 0.0087741670 15 NES 2014 0.4100725 0.0087741670 16 NES 2015 0.4261941 0.0087741670 17 NES 2016 0.4429508 0.0087741670 18 NES 2017 0.4607484 0.0087741670 19 NES 2018 0.4781397 0.0087741670 20 NES 2019 0.4933890 0.0087741670
4af52f64a89b6627656220ab46322ab0
{ "intermediate": 0.3930880129337311, "beginner": 0.3022315800189972, "expert": 0.3046804666519165 }
20,529
how can I prevent the normal action of a button in js
4167ecfd4c615ec0339fa95134680caa
{ "intermediate": 0.33063074946403503, "beginner": 0.22120070457458496, "expert": 0.4481685161590576 }
20,530
You are given two integers, 'N' and 'K'. You have to find if there exist 'N' positive integers such that: A[1] + A[2] +...+A[N] = K GCD(A[1], A[2], ... , A[N]) > 1 Return 1 if there exist 'N' positive integers that satisfy the two conditions described above. Return 0 otherwise. Example: N = 2 K = 4 If we select two integers, A[1] =2 and A[2] = 2 then A[1] + A[2] =4(K) and GCD( A[1] , A[2] )= GCD(2, 2) = 2. A solution python function will look like findNumbers(n, k). Following cases will give following outputs print(findNumbers(2, 4)) # 1 print(findNumbers(4, 8)) # 1 print(findNumbers(5, 8)) # 0 print(findNumbers(4, 15)) # 1 print(findNumbers(7, 15)) # 0
dfce4e3d7f0da903a2bb2434ef4a6ae2
{ "intermediate": 0.2849220633506775, "beginner": 0.48436078429222107, "expert": 0.23071716725826263 }
20,531
how to install MaskRCNN in python library
cccdecfddf83f3302aced9243f7ac2c8
{ "intermediate": 0.38166844844818115, "beginner": 0.04010479152202606, "expert": 0.5782267451286316 }
20,532
Exception in Tkinter callback Traceback (most recent call last): File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\tkinter\__init__.py", line 1921, in __call__ return self.func(*args) File "H:\Temp\ipykernel_12656\1180790666.py", line 355, in chuyenLSTT remove_data_banhang(table, (2,4), (5,6)) File "H:\Temp\ipykernel_12656\1180790666.py", line 170, in remove_data_banhang sheet.batch_update(body) File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\gspread\utils.py", line 732, in wrapper File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\gspread\worksheet.py", line 1212, in batch_update File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\gspread\worksheet.py", line 1213, in <listcomp> TypeError: string indices must be integers
7b6bd1db4a92af2a44f94e2c89659f80
{ "intermediate": 0.4410565495491028, "beginner": 0.3691355586051941, "expert": 0.18980790674686432 }
20,533
Hello I have those 2 function JSI_HOST_FUNCTION(encodeToBytes) { // Get optional parameters auto format = count >= 1 ? static_cast<SkEncodedImageFormat>(arguments[0].asNumber()) : SkEncodedImageFormat::kPNG; auto quality = count == 2 ? arguments[1].asNumber() : 100.0; // Get data sk_sp<SkData> data; if (format == SkEncodedImageFormat::kJPEG) { SkJpegEncoder::Options options; options.fQuality = quality; data = SkJpegEncoder::Encode(nullptr, getObject().get(), options); } else { SkPngEncoder::Options options; data = SkPngEncoder::Encode(nullptr, getObject().get(), options); } auto arrayCtor = runtime.global().getPropertyAsFunction(runtime, "Uint8Array"); size_t size = data->size(); jsi::Object array = arrayCtor.callAsConstructor(runtime, static_cast<double>(size)) .getObject(runtime); jsi::ArrayBuffer buffer = array.getProperty(runtime, jsi::PropNameID::forAscii(runtime, "buffer")) .asObject(runtime) .getArrayBuffer(runtime); auto bfrPtr = reinterpret_cast<uint8_t *>(buffer.data(runtime)); memcpy(bfrPtr, data->bytes(), size); return array; } JSI_HOST_FUNCTION(encodeToBase64) { // Get optional parameters auto format = count >= 1 ? static_cast<SkEncodedImageFormat>(arguments[0].asNumber()) : SkEncodedImageFormat::kPNG; auto quality = count == 2 ? arguments[1].asNumber() : 100.0; auto image = getObject(); if (image->isTextureBacked()) { image = image->makeNonTextureImage(); } sk_sp<SkData> data; if (format == SkEncodedImageFormat::kJPEG) { SkJpegEncoder::Options options; options.fQuality = quality; data = SkJpegEncoder::Encode(nullptr, image.get(), options); } else { SkPngEncoder::Options options; data = SkPngEncoder::Encode(nullptr, image.get(), options); } auto len = SkBase64::Encode(data->bytes(), data->size(), nullptr); auto buffer = std::string(len, 0); SkBase64::Encode(data->bytes(), data->size(), reinterpret_cast<void *>(&buffer[0])); return jsi::String::createFromAscii(runtime, buffer); }
5f08b0c3201359c9d119b177bbd403fe
{ "intermediate": 0.3731304407119751, "beginner": 0.3974577486515045, "expert": 0.22941182553768158 }
20,534
fix my code: # These lines are useful to have in development try: # Retrieve referenced TI inquiry_ids_str = ",".join(["'{}'".format(id) for id in recommended_df.inquiry_id.tolist()]) closed_inq = "SELECT inquiry_id, searchable FROM `i2ms-debug`.inquiry_analytics_vw i WHERE i.inquiry_id IN({inquiry_ids_str})" mydb = connection.connect(**mydbconfig) mycursor = mydb.cursor() mycursor.execute(closed_inq) closed_inq = mycursor.fetchall() closed_inq = pd.DataFrame( closed_inq, columns=["inquiry_id", "searchable"]) except Exception as e: print( { "error": { "message": "An unexpected error occurred.", "details": str(e), "code": 500, } }
ccbb28d826b19d642c81719161b3c3ab
{ "intermediate": 0.34552666544914246, "beginner": 0.4396500885486603, "expert": 0.21482329070568085 }
20,535
write me lines of code for an executor that can execute scripts into roblox
6409658ea669b856f92b4a24765748ed
{ "intermediate": 0.4477904736995697, "beginner": 0.2171456664800644, "expert": 0.3350638747215271 }
20,536
please write me a fully build up from the ground up script with at least 200 lines of code that can give people easy access to scripting in the game roblox. Make all this code in an organized manner and also understandable by people with no knowledge of coding.
2ebd9102e4167bd723f7f4497a75ae78
{ "intermediate": 0.29656684398651123, "beginner": 0.4859723746776581, "expert": 0.2174607366323471 }
20,537
create a wep page with 3 photos
431be529c0810c832187bb4009f7b170
{ "intermediate": 0.3622472584247589, "beginner": 0.22101180255413055, "expert": 0.41674089431762695 }
20,538
What is a way to find all URLs being requested in Python?
7e42ead06ad2486a0ed13cb8156302b8
{ "intermediate": 0.5218556523323059, "beginner": 0.16797544062137604, "expert": 0.31016892194747925 }
20,539
hi
606cf348234b7a3aeb0daeefb9038746
{ "intermediate": 0.3246487081050873, "beginner": 0.27135494351387024, "expert": 0.40399640798568726 }
20,540
Below is a paragraph from an academic paper. Polish the writing to meet the academic style, improve the spelling, grammar, clarity, concisio and overall readability. When necessary, rewrite the whole sentence. Furthermore, list all modifigstign and explain the reasons to do so in markdown table. " In this paper, we investigate a semilinear stochastic differential equation with multiplicative noise defined on the entire real line. The equation is given by: ∂u ∂t= ∂2u ∂x2+ f(x,u(t,x))+∂g ∂x(x,u(t,x))+σ(x,u(t,x))∂2W ∂t∂x, where f satisfies linear growth condition and g satisfies square growth condition. The noise is characterized as space-time white noise. By introducing a certain dissipativity property to f and g and utilizing the Itˆ o formula, a solution that is uniformly bounded in time is obtained. Furthermore, in conjunction with the Krylov-Bogoliouboff theorem, we establish the existence of an invariant measure for this equation. Moreover, based on the stability property of the solution, the uniqueness of the invariant measure for this equation is demonstrated. Notably, the main result has applications in the study of both the reaction-diffusion equation and the stochastic Burgers equation."
528d8c7f05638be97edc1089c2210938
{ "intermediate": 0.2719452679157257, "beginner": 0.44011005759239197, "expert": 0.28794464468955994 }
20,541
in python, write a functioned name "add" that takes two parameters "a" and "b", then return the output of a+b.
73262aef81fab766abacadc2f8b8e066
{ "intermediate": 0.2544064223766327, "beginner": 0.4053439497947693, "expert": 0.340249627828598 }
20,542
what is the output for i,x in enumerate(['a','b','c']): print (i+1,x)
6124fbbd3dc19ef0dd48371fb6ef945b
{ "intermediate": 0.22836433351039886, "beginner": 0.6241063475608826, "expert": 0.14752931892871857 }
20,543
This SQL query takes 0.5 seconds: "SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21224594 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8306959 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21213649 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21227186 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21226162 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21223278 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21225386 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21201768 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21224404 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21227451 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8402080 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8416800 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21231150 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21231150 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21231150 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21231150 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21231150 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21231150 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21231150 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21231150 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21231150 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21231150 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21231150 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21231150 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21231150 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21230885 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21230885 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21230885 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21230885 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21230885 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21230885 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21230885 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21231164 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21230669 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21224633 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21229415 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8403425 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8403425 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8403425 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8403425 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8403425 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8403425 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8403425 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8403425 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8403425 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8403425 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8403425 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8403425 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8403425 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8403425 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8403425 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8403425 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8403425 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8403425 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8403425" Is there a way to speed it up?
279b09bd273088455b1a6c6da3bb4460
{ "intermediate": 0.2565765380859375, "beginner": 0.5344035625457764, "expert": 0.20901991426944733 }
20,544
"SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21224594 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8306959 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21213649 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21227186 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21226162 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21223278 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21225386 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21201768 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21224404 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21227451 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8402080 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8416800 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21231150 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21231150 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21231150 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21231150 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21231150 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21231150 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21231150 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21231150 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21231150 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21231150 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21231150 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21231150 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21231150 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21230885 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21230885 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21230885 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21230885 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21230885 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21230885 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21230885 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21231164 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21230669 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21224633 UNION SELECT "int" AS "brett","nachricht","id","antworten","zeit" FROM "int" WHERE "id" ==21229415 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8403425 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8403425 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8403425 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8403425 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8403425 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8403425 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8403425 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8403425 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8403425 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8403425 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8403425 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8403425 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8403425 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8403425 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8403425 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8403425 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8403425 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8403425 UNION SELECT "b" AS "brett","nachricht","id","antworten","zeit" FROM "b" WHERE "id" ==8403425" This SQL query takes 0.5 seconds, which is too long. How can I create an Index for this query?
0ad1cfe40b5f9eff084b24b6550a8ff2
{ "intermediate": 0.29594939947128296, "beginner": 0.4154733717441559, "expert": 0.28857725858688354 }
20,545
hi! i am writing some c++ code, and i am trying to have a CDialog window pop up and ask for two strings from the user. once the user enters them and clicks 'ok', i want the window to close, and to have access to those two strings. how would i do this?
4e2e1cace789ec9882b8601ca7255dca
{ "intermediate": 0.46783289313316345, "beginner": 0.2707520127296448, "expert": 0.2614150941371918 }
20,546
'SELECT "_rowid_",* FROM "{bid}" WHERE gesichert > 0 AND voll!=nachricht AND antworten==gesichert ORDER BY "zeit" DESC;' This SQLite query takes too long. How can I speed it up by creating an index?
290a9d6e0e39f4494eb8b797e348034b
{ "intermediate": 0.5770462155342102, "beginner": 0.2624618113040924, "expert": 0.16049201786518097 }
20,547
Create a summary of this text, and make python examples for the problems given: "We will use Python's built-in open function to create a file object, and obtain the data from a "txt" file. We will use Python's open function to get a file object. We can apply a method to that object to read data from the file. We can open the file, Example1.txt, as follows. We use the open function. The first argument is the file path. This is made up of the file name, and the file directory. The second parameter is the mode. Common values used include 'r' for reading, 'w' for writing, and 'a' for appending. We will use 'r' for reading. Finally, we have the file object. We can now use the file object to obtain information about the file. We can use the data attribute name to get the name of the file. The result is a string that contains the name of the file. We can see what mode the object is in using the data attribute mode, and 'r' is shown representing read. You should always close the file object using the method close. This may get tedious sometimes, so let's use the "with" statement. Using a "with" statement to open a file is better practice because it automatically closes the file. The code will run everything in the indent block, then closes the file. This code reads the file, Example1.txt. We can use the file object, "File1." The code will perform all operations in the indent block then close the file at the end of the indent. The method "read" stores the values of the file in the variable "file_stuff" as a string. You can print the file content. You can check if the file content is closed, but you cannot read from it outside the indent. But you can print the file content outside the indent as well. We can print the file content. We will see the following. When we examine the raw string, we will see the " ." This is so Python knows to start a new line. We can output every line as an element in a list using the method "readlines." The first line corresponds to the first element in the list. The second line corresponds to the second element in the list, and so on. We can use the method "readline" to read the first line of the file. If we run this command, it will store the first line in the variable "file_stuff" then print the first line. We can use the method "readline" twice. The first time it's called, it will save the first line in the variable "file_stuff," and then print the first line. The second time it's called, it will save the second line in the variable "file_stuff," and then print the second line. We can use a loop to print out each line individually as follows. Let's represent every character in a string as a grid. We can specify the number of characters we would like to read from the string as an argument to the method "readlines." When we use a four as an argument in the method "readlines," we print out the first four characters in the file. Each time we call the method, we will progress through the text. If we call a method with the arguments 16, the first 16 characters are printed out, and then the new line. If we call the method a second time, the next five characters are printed out. Finally, if we call the method the last time with the argument nine, the last nine characters are printed out."
b8c460e37ca7957b72deb6eaf740880b
{ "intermediate": 0.37638556957244873, "beginner": 0.47692862153053284, "expert": 0.1466858685016632 }
20,548
in python, to print characters in a text, such as all 16 in line one, then 5 in line two, and the remaining 9 in line two, do you use read() or readlines()?
82ffaaf4c27b758b2303f1e800c1de74
{ "intermediate": 0.5791337490081787, "beginner": 0.10554343461990356, "expert": 0.3153228461742401 }
20,549
What is the difference between #define and typedef. which one is preferred? why? explain with example
883dc65c7217993ec2b6bc894d4a2d00
{ "intermediate": 0.2905203700065613, "beginner": 0.46601447463035583, "expert": 0.24346521496772766 }
20,550
I have a form and all the codes below associated with the form work correctly. I would like to add validation controls to the input in the Text Boxes. The Input box 'StartTime' must always be less than Input Box 'EndTime' If there is a value in'StartTime' Then Input Box 'EndTime' must not be blank. If there is a value in'EndTime' Then Input Box 'StartTime' must not be blank. If there is a value in either 'StarTime' or 'EndTime' Then Input Box 'AorH' must be Blank. If the InputBox 'AorH' is not Blank then Values in InputBox 'AorH' can only be either 'a' or 'h' If the InputBox 'AorH' is not Blank then the InputBoxes 'StarTime' or 'EndTime' must be Blank. Private newActiveCellRange As Range Public Property Let activeCellRange(rng As Range) Set newActiveCellRange = rng End Property Public Property Get activeCellRange() As Range Set activeCellRange = newActiveCellRange End Property Private Sub UserForm_Initialize() Me.activeCellRange = ActiveCell End Sub Private Sub StartEndButton1_Click() newActiveCellRange.Offset(0, 29).Value = StartTime.Value newActiveCellRange.Offset(0, 30).Value = EndTime.Value newActiveCellRange.Offset(0, 32).Value = AorH.Value newActiveCellRange.Offset(0, 2).Value = FullName.Value newActiveCellRange.Offset(0, 31).Calculate newActiveCellRange.Offset(0, 33).Calculate newActiveCellRange.Offset(0, 1).Calculate newActiveCellRange.Offset(0, 3).Select MsgBox "Details recorded, Enter Reason", vbInformation, "OVERTIME HOURS" Me.Hide End Sub Private Sub Worksheet_SelectionChange(ByVal Target As Range) Set activeCellRange = Target End Sub
976c7811f5b0f6e071562349b2200d0c
{ "intermediate": 0.33812206983566284, "beginner": 0.3294450640678406, "expert": 0.3324328064918518 }
20,551
get a method from outside of component on onclick in react
b0cf9a6b86dd86ba64d04032d3ae5d7f
{ "intermediate": 0.48602280020713806, "beginner": 0.19817271828651428, "expert": 0.31580448150634766 }
20,552
static void Main(string[] args) { using (SoccerContext db = new SoccerContext()) { // создание и добавление моделей Team t1 = new Team { Name = "Барселона" }; Team t2 = new Team { Name = "Реал Мадрид" }; db.Teams.Add(t1); db.Teams.Add(t2); db.SaveChanges(); Player pl1 = new Player { Name = "Роналду", Age = 31, Position = "Нападающий", Team = t2 }; Player pl2 = new Player { Name = "Месси", Age = 28, Position = "Нападающий", Team = t1 }; Player pl3 = new Player { Name = "Хави", Age = 34, Position = "Полузащитник", Team = t1 }; db.Players.AddRange(new List<Player> { pl1, pl2, pl3 }); db.SaveChanges(); var teamWithPlayers = db.Teams.Include(t => t.Players).ToList(); var playerWithPlayers = db.Players.Include(p => p.Team).ToList(); // вывод foreach (Player pl in playerWithPlayers) Console.WriteLine("{0} - {1}", pl.Name, pl.Team != null ? pl.Team.Name : ""); Console.WriteLine(); foreach (Team t in teamWithPlayers) { Console.WriteLine("Команда: {0}", t.Name); foreach (Player pl in t.Players) { Console.WriteLine("{0} - {1}", pl.Name, pl.Position); } Console.WriteLine(); } } } Ошибка: CS1660 Не удается преобразовать лямбда-выражение к типу "string", так как он не является типом делегата. 27 Активные
918d82afada32383b52f80c2e1a28d44
{ "intermediate": 0.4147021770477295, "beginner": 0.3647492229938507, "expert": 0.220548614859581 }
20,553
How do I extract a part of a string with regex python
716d43a382fcd77e9f180303c5fa7ca2
{ "intermediate": 0.5064455270767212, "beginner": 0.17681878805160522, "expert": 0.31673577427864075 }
20,554
I have a csv-file with two columns. First colum called P contains a continous variable. Second column is called M. Please write me a python script to open the file and use the data.
e6ab426013ac6a4a09e53d4f68a8f5b0
{ "intermediate": 0.36707034707069397, "beginner": 0.38461142778396606, "expert": 0.24831822514533997 }
20,555
est il possible de simplifier ces 2 fonctions " function depositPlayer1() public payable { require(msg.sender == gamePlayers[gameId][0].playerAddress, "Seul le player1 peut miser"); uint256 amount = msg.value; require(amount > 0, unicode"Le montant ne peut être égal à 0"); player1 = gamePlayers[gameId][0].playerAddress; gameBets[gameId].bet += amount; gameBalances[gameId][player1].balance += amount; emit BetDeposited(player1, gameBets[gameId].bet); status = GameStatus.waitingForPlayers; emit GameStatusUpdated(gameId, uint8(GameStatus.waitingForPlayers)); } function depositPlayer(address player) private { require(msg.sender == player, "Seul le joueur peut miser"); uint256 amount = msg.value; require(amount > 0, unicode"Le montant ne peut etre egal à 0"); gameBets[gameId].bet += amount; gameBalances[gameId][player].balance += amount; emit BetDeposited(player, gameBets[gameId].bet); if (player == player1) { status = GameStatus.waitingForPlayers; emit GameStatusUpdated(gameId, uint8(GameStatus.waitingForPlayers)); } else { requireStatusWaitingForPlayers(); handleRefund(amount); player2HasBet = true; } }"
b34f6a3d1a301e8be2322c0dcb407f6a
{ "intermediate": 0.3123558759689331, "beginner": 0.4874843657016754, "expert": 0.2001597285270691 }
20,556
est il possible de simplifier ces fonctions ou d'en faire qu'une ? " // FONCTIONS POUR GERER LES FONDS // /** * @notice effectue un dépôt pour participer à une partie */ function deposit() external payable { gameId = getCurrentGameId(); requireStatusCreatedGame(); require(gameId > 0, "Identifiant de jeu invalide"); uint8 playerIndex = getPlayerIndex(); require(playerIndex < 2, "Adresse de joueur non valide"); if (playerIndex == 0) { depositPlayer(player1); } else { require(playerIndex == 1 && player2 == address(0), "Le player2 est deja defini"); depositPlayer(player2); } } // FONCTION POUR EFFECTUER UN DEPOT /** * @notice effectue un dépôt pour participer à une partie */ function depositPlayer1() public payable { require(msg.sender == gamePlayers[gameId][0].playerAddress, "Seul le player1 peut miser"); uint256 amount = msg.value; require(amount > 0, unicode"Le montant ne peut être égal à 0"); player1 = gamePlayers[gameId][0].playerAddress; gameBets[gameId].bet += amount; gameBalances[gameId][player1].balance += amount; emit BetDeposited(player1, gameBets[gameId].bet); status = GameStatus.waitingForPlayers; emit GameStatusUpdated(gameId, uint8(GameStatus.waitingForPlayers)); } function depositPlayer(address player) private { require(msg.sender == player, "Seul le joueur peut miser"); uint256 amount = msg.value; require(amount > 0, unicode"Le montant ne peut etre egal à 0"); gameBets[gameId].bet += amount; gameBalances[gameId][player].balance += amount; emit BetDeposited(player, gameBets[gameId].bet); if (player == player1) { status = GameStatus.waitingForPlayers; emit GameStatusUpdated(gameId, uint8(GameStatus.waitingForPlayers)); } else { requireStatusWaitingForPlayers(); handleRefund(amount); player2HasBet = true; } } /** * @notice effectue un remboursement si trop perçu */ function handleRefund(uint256 _amount) internal { uint256 player1Bet = gameBets[gameId].bet; uint256 refund = 0; uint256 newAmount = _amount; if (_amount > player1Bet) { refund = _amount - player1Bet; newAmount = _amount - refund; } gameBets[gameId].bet += newAmount; gameBalances[gameId][gamePlayers[gameId][1].playerAddress].balance += newAmount; if (refund > 0) { payable(msg.sender).transfer(refund); } emit BetDeposited(gamePlayers[gameId][1].playerAddress, newAmount); status = GameStatus.waitingForRandomWord; emit GameStatusUpdated(gameId, uint8(status)); }
0ccb7d6bf9a345ad047c7bcbb12ee291
{ "intermediate": 0.3754248321056366, "beginner": 0.49141237139701843, "expert": 0.13316281139850616 }
20,557
sum formula in excel
f35820055b4ffd24454b7b43a9dbf7b6
{ "intermediate": 0.34726348519325256, "beginner": 0.29532381892204285, "expert": 0.357412725687027 }
20,558
I have the following python program: data = pd.read_csv('C:/My_Filepath', sep=";") p = data["p"] m = data["m"] Adjust it to bin the data stored in 'p' to 10 bins
0f9e0c1f04394b28543883d4e7ae13dd
{ "intermediate": 0.4730224609375, "beginner": 0.1578468233346939, "expert": 0.3691307008266449 }
20,559
Below is a paragraph from an academic paper. Polish the writing to meet the academic style, improve the spelling, grammar, clarity, concisio and overall readability. When necessary, rewrite the whole sentence. Furthermore, list all modifigstign and explain the reasons to do so in markdown table. "By using the Markov property, P(u(t) ∈ K(r)) = E(P1(u(t − 1),K(r))) Because u(t) is bounded in probability in H and let r > r1sufficiently large, we can conclude that the family of laws L(u(t)) is tight in H."
7d5b0baeafc0ac118cda3f71bd142e95
{ "intermediate": 0.2791099548339844, "beginner": 0.44493699073791504, "expert": 0.2759530544281006 }
20,560
can you convert this vuex source to pinia """import axios from "axios"; const state = { loading: true, success: true, allowRegistration: true, loginEnabled: true, version: "loading", totalUsers: 1, name: "COCO Annotator", socket: null }; const getters = {}; const mutations = { socket(state, connected) { state.socket = connected; }, increamentUserCount(state) { state.totalUsers++; }, getServerInfo(state) { state.loading = true; axios .get("/api/info/") .then(response => { state.loading = false; state.success = true; let data = response.data; state.version = data.git.tag; state.allowRegistration = data.allow_registration; state.loginEnabled = data.login_enabled; state.totalUsers = data.total_users; }) .catch(() => { state.loading = false; state.success = true; state.version = "unknown"; }); } }; const actions = {}; export default { namespaced: true, state, getters, actions, mutations };"""
7f65148585ad85b809a4fcf6e1ff93b3
{ "intermediate": 0.4679030776023865, "beginner": 0.3320688307285309, "expert": 0.20002803206443787 }
20,561
Hello?
2cd702c06c8668c610ed7c93f63b73fb
{ "intermediate": 0.3467289209365845, "beginner": 0.2526143789291382, "expert": 0.40065672993659973 }
20,562
I'm using Laravel framework for my project. How do I change placeholder inside the text [Company Name] with name of my company "Acme"? Please not that [Company name] should be case insensitive. Here's example text: "At [Company Name], we understand the importance of finding a gift that not only fits your budget but also reflects the recipient's personality and style. That's why we've put together this comprehensive guide to housewarming gifts that are sure to impress. From luxurious and extravagant options to unique and personalized choices, we've got you covered."
2fa697e6753c4974e6f13b09defd85e7
{ "intermediate": 0.557269811630249, "beginner": 0.2060464769601822, "expert": 0.23668374121189117 }
20,563
got some input container with lots of input related elements within it. need to compensate a 80px left, because there's some addiditional elements in this container from the left side, and need to compense these 80px from the left to 100%. any ideas? maybe if using var() sizing formula? any other ideas?: .input-field-container { width:100%; left:80px; position: relative; display: flex;flex-direction: column; grid-template-columns: 1fr 1fr; }
968274e459d7dd5acfede5cdb46b9fed
{ "intermediate": 0.507061243057251, "beginner": 0.28040555119514465, "expert": 0.21253320574760437 }
20,564
first block of input container should stay in a single full width occupying row line, while second input container should stay in a single full width occupying row line but under the first block. any ideas?: <!DOCTYPE html> <html> <head> <style> .input-container { display: grid; grid-template-columns: 80px 1fr; grid-gap: 10px; align-items: center; width: 100%; } .gen-button { grid-row: span 2; } </style> </head> <body> <div class='input-container'> <button class='title'>Input:</button> <div class='mark'>someText1</div> <div class='input-gap'> <textarea id='inputTextArea' class='input-field inputTextArea' rows='1'>some default text here1</textarea> </div> </div> <div class='input-container'> <button class='gen-button'>process</button> <div class='mark'>someText2</div> <div class='input-gap'> <textarea id='inputTextArea2' class='input-field2 inputTextArea2' rows='1'>some default text here2</textarea> </div> </div> </body> </html>
aa0967a4f56227bc924c875f8af6f61b
{ "intermediate": 0.29502981901168823, "beginner": 0.48716697096824646, "expert": 0.2178032398223877 }
20,565
first block of input container should stay in a single full width occupying row line, while second input container should stay in a single full width occupying row line but under the first block. any ideas?: <!DOCTYPE html> <html> <head> <style> .input-container { display: grid; grid-template-columns: 80px 1fr; grid-gap: 10px; align-items: center; width: 100%; } .gen-button { grid-row: span 2; } </style> </head> <body> <div class='input-container'> <button class='title'>Input:</button> <div class='mark'>someText1</div> <div class='input-gap'> <textarea id='inputTextArea' class='input-field inputTextArea' rows='1'>some default text here1</textarea> </div> </div> <div class='input-container'> <button class='gen-button'>process</button> <div class='mark'>someText2</div> <div class='input-gap'> <textarea id='inputTextArea2' class='input-field2 inputTextArea2' rows='1'>some default text here2</textarea> </div> </div> </body> </html>
dd69596bc2237bbec98ba5540c53b4f3
{ "intermediate": 0.29502981901168823, "beginner": 0.48716697096824646, "expert": 0.2178032398223877 }
20,566
first block of input container should stay in a single full width occupying row line, while second input container should stay in a single full width occupying row line but under the first block. any ideas?: <!DOCTYPE html> <html> <head> <style> .input-container { display: grid; grid-template-columns: 80px 1fr; grid-gap: 10px; align-items: center; width: 100%; } .gen-button { grid-row: span 2; } </style> </head> <body> <div class='input-container'> <button class='title'>Input:</button> <div class='mark'>someText1</div> <div class='input-gap'> <textarea id='inputTextArea' class='input-field inputTextArea' rows='1'>some default text here1</textarea> </div> </div> <div class='input-container'> <button class='gen-button'>process</button> <div class='mark'>someText2</div> <div class='input-gap'> <textarea id='inputTextArea2' class='input-field2 inputTextArea2' rows='1'>some default text here2</textarea> </div> </div> </body> </html>
f8ac39d434ea86ab0b860ee5d20f835d
{ "intermediate": 0.29502981901168823, "beginner": 0.48716697096824646, "expert": 0.2178032398223877 }
20,567
first block of input container should stay in a single full width occupying row line, while second input container should stay in a single full width occupying row line but under the first block. any ideas?: <!DOCTYPE html> <html> <head> <style> .input-container { display: grid; grid-template-columns: 80px 1fr; grid-gap: 10px; align-items: center; width: 100%; } .gen-button { grid-row: span 2; } </style> </head> <body> <div class='input-container'> <button class='title'>Input:</button> <div class='mark'>someText1</div> <div class='input-gap'> <textarea id='inputTextArea' class='input-field inputTextArea' rows='1'>some default text here1</textarea> </div> </div> <div class='input-container'> <button class='gen-button'>process</button> <div class='mark'>someText2</div> <div class='input-gap'> <textarea id='inputTextArea2' class='input-field2 inputTextArea2' rows='1'>some default text here2</textarea> </div> </div> </body> </html>
17ed5a2761555f044e38d587cf7d98fd
{ "intermediate": 0.29502981901168823, "beginner": 0.48716697096824646, "expert": 0.2178032398223877 }
20,568
first block of input container should stay in a single full width occupying row line, while second input container should stay in a single full width occupying row line but under the first block. any ideas?: <!DOCTYPE html> <html> <head> <style> .input-container { display: grid; grid-template-columns: 80px 1fr; grid-gap: 10px; align-items: center; width: 100%; } .gen-button { grid-row: span 2; } </style> </head> <body> <div class='input-container'> <button class='title'>Input:</button> <div class='mark'>someText1</div> <div class='input-gap'> <textarea id='inputTextArea' class='input-field inputTextArea' rows='1'>some default text here1</textarea> </div> </div> <div class='input-container'> <button class='gen-button'>process</button> <div class='mark'>someText2</div> <div class='input-gap'> <textarea id='inputTextArea2' class='input-field2 inputTextArea2' rows='1'>some default text here2</textarea> </div> </div> </body> </html>
954af2d92ed2046436aeaf9eb46f6f96
{ "intermediate": 0.29502981901168823, "beginner": 0.48716697096824646, "expert": 0.2178032398223877 }
20,569
first block of input container should stay in a single full width occupying row line, while second input container should stay in a single full width occupying row line but under the first block. any ideas?: <!DOCTYPE html> <html> <head> <style> .input-container { display: grid; grid-template-columns: 80px 1fr; grid-gap: 10px; align-items: center; width: 100%; } .gen-button { grid-row: span 2; } </style> </head> <body> <div class='input-container'> <button class='title'>Input:</button> <div class='mark'>someText1</div> <div class='input-gap'> <textarea id='inputTextArea' class='input-field inputTextArea' rows='1'>some default text here1</textarea> </div> </div> <div class='input-container'> <button class='gen-button'>process</button> <div class='mark'>someText2</div> <div class='input-gap'> <textarea id='inputTextArea2' class='input-field2 inputTextArea2' rows='1'>some default text here2</textarea> </div> </div> </body> </html>
73e2eda94872dccd57fc77aaa15c5f60
{ "intermediate": 0.29502981901168823, "beginner": 0.48716697096824646, "expert": 0.2178032398223877 }
20,570
este es mi clase abstracta Trabajador /* * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template */ package com.mycompany.trabajo; /** * * @author Marcos */ public abstract class Trabajador { protected String nombre; protected String codigo; public Trabajador(String nombre, String codigo){ this.nombre = nombre; this.codigo = codigo; } public String getNombre(){ return nombre; } public String getCodigo(){ return codigo; } public abstract float productividad(); } y esta es mi clase analista que extiende de trabajador /* * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template */ package com.mycompany.trabajo; /** * * @author Marcos */ public class Analista extends Trabajador { private int esquemas; public Analista(String nombre, String codigo, int esquemas){ super(nombre, codigo); this.esquemas = esquemas; } public float productividad(float esquemas){ return esquemas * 2; } public int getEsquemas(){ return esquemas; } } me da error en la clase analista
ee9e300a7cb3536c982ba790ad51cdf8
{ "intermediate": 0.2741028964519501, "beginner": 0.4008729159832001, "expert": 0.32502418756484985 }
20,571
I have a html form textarea field to allow user to input any text. For example: I'm tony. I like to say "Hi man"! I have discount 50%. I will update the field to mysql with php. Please give me a sample code.
095547ad40122ced1b1a5415fe3ace1e
{ "intermediate": 0.4431549608707428, "beginner": 0.2997024357318878, "expert": 0.2571426331996918 }
20,572
Using Matlab, generate a homogeneous Poisson spike train for 100 seconds with a constant rate, r(t) = 100 Hz, and record the time of each spike. Choose a range of time step size Δt = [0.005, 0.001, 0.0005, 0.0001]. For each Δt, compute and report the coefficient of variation of the interspike intervals, and the Fano factor for spike counts using time window Tw = 0.05 sec. Which Δt gives the most accurate estimation of the coefficient of variation and the Fano factor?
0329b525a649585bf7e80c3314e70c43
{ "intermediate": 0.2545841634273529, "beginner": 0.16624435782432556, "expert": 0.5791714787483215 }
20,573
How can I add subplot in a plot and draw the line to each value in the subplot?
cf711bd986c617e7bf4ba0cad2d2d4f7
{ "intermediate": 0.4028889238834381, "beginner": 0.2257656455039978, "expert": 0.3713454008102417 }
20,574
the errors that i'm getting are as follows: The non-nullable local variable 'basic_dic' must be assigned before it can be used. and The argument type 'Map<dynamic, dynamic>' can't be assigned to the parameter type 'Map<String, dynamic>'. following is my flutter code for what i'm getting the above mentioned errors: import 'package:flutter/services.dart'; import 'package:sqflite/sqflite.dart'; import 'package:path/path.dart' as path; import 'package:path_provider/path_provider.dart'; import 'dart:io' as io; import 'db_model.dart'; class DictionaryDataBaseHelper { late Database _db; Future<void> init() async { io.Directory applicationDirectory = await getApplicationDocumentsDirectory(); String dbPathEnglish = path.join(applicationDirectory.path, "dic.db"); bool dbExistsEnglish = await io.File(dbPathEnglish).exists(); if (!dbExistsEnglish) { // Copy from asset ByteData data = await rootBundle.load(path.join("assets", "dic.db")); List<int> bytes = data.buffer.asUint8List(data.offsetInBytes, data.lengthInBytes); // Write and flush the bytes written await io.File(dbPathEnglish).writeAsBytes(bytes, flush: true); } this._db = await openDatabase(dbPathEnglish); } /// get all the words from english dictionary Future<List<EnglishWord>> getAllTheWordsEnglish() async { if (_db == null) { throw "bd is not initiated, initiate using [init(db)] function"; } List<Map> basic_dic; await _db.transaction((txn) async { basic_dic = await txn.query( "basic_dic", columns: [ "head_word", "meaning", ], ); }); return basic_dic.map((e) => EnglishWord.fromJson(e)).toList(); } }
d4a075870eeb6a818977ada187e8f23f
{ "intermediate": 0.5588853359222412, "beginner": 0.29350605607032776, "expert": 0.147608682513237 }
20,575
Jules is a graduate student studying the role of a novel B-cell-specific membrane protein, CDX. She hypothesizes that CDX is a signaling protein that modulates the activity of B cells. She has obtained an IgG monoclonal antibody against CDX, which should cross-link (induce dimerization) of the CDX protein, leading to its downstream signaling. Her experimental goal is to test whether CDX initiates cell signaling and activates the cells. To that end, Jules extracts PBMCs (peripheral blood mononuclear cells, which include all white blood cells) from human blood, washes away the serum proteins, and incubates them with the CDX antibody. When she tests her sample at the end of the day, she finds that most of her B cells are dead! Jules is tempted to believe that she has found a surprising role of CDX in B cell death. Unfortunately, Jules knows better. Describe two likely explanations for her results.
c23f783c0ef234c8d0cdf1d014f5d23a
{ "intermediate": 0.3165714144706726, "beginner": 0.30550068616867065, "expert": 0.37792789936065674 }
20,576
what is automotive INDUSTRY
49a63917d38e3529497bb706afdb210f
{ "intermediate": 0.3752792775630951, "beginner": 0.41318878531455994, "expert": 0.21153195202350616 }
20,577
Write code in c++ to solve An Up-Down sequence is defined as a sequence if the differences between successive numbers strictly alternate between positive and negative. The first difference (if one exists) may be either positive or negative. For example, the sequence \([1, 5, 3, 4]\) is an Up-Down sequence because the differences between successive numbers are \((4, -2, 1)\), which are alternatively positive and negative. Specially, a sequence with only one integer is an Up-Down sequence with length of 1. Given a sequence of \(N\) integers, return the length of the longest Up-Down subsequence. A subsequence is obtained by deleting some number (or 0) of elements from the original sequence, leaving the remaining elements in their original order. Input Specification The first line of input will contain the integer \(N\) (\(1 \le N \le 2 \times 10^6\)). The second line of input will contain \(N\) space-separated integers representing the sequence. Each integer is in the range \([0, 10^9]\). For 50% of test cases, \(N \le 2000\). Output Specification Output the length of the longest Up-Down subsequence.
d6b6488e760645fc5aaba8be17ad93a4
{ "intermediate": 0.39406779408454895, "beginner": 0.25286832451820374, "expert": 0.3530639111995697 }
20,578
Write a solution in c++ that is fast: An Up-Down sequence is defined as a sequence if the differences between successive numbers strictly alternate between positive and negative. The first difference (if one exists) may be either positive or negative. For example, the sequence \([1, 5, 3, 4]\) is an Up-Down sequence because the differences between successive numbers are \((4, -2, 1)\), which are alternatively positive and negative. Specially, a sequence with only one integer is an Up-Down sequence with length of 1. Given a sequence of \(N\) integers, return the length of the longest Up-Down subsequence. A subsequence is obtained by deleting some number (or 0) of elements from the original sequence, leaving the remaining elements in their original order. Input Specification The first line of input will contain the integer \(N\) (\(1 \le N \le 2 \times 10^6\)). The second line of input will contain \(N\) space-separated integers representing the sequence. Each integer is in the range \([0, 10^9]\). For 50% of test cases, \(N \le 2000\). Output Specification Output the length of the longest Up-Down subsequence.
a9784a86ee8f807faafbbd350281bb80
{ "intermediate": 0.3694949448108673, "beginner": 0.24651168286800385, "expert": 0.3839934170246124 }
20,579
hi! i'm working on some code to parse some text. here is my code: ''' from rply import LexerGenerator, LexingError, ParserGenerator def lex_spartytalk(): """ Lexer function for reading Tokens for spartytalk @return lexer of the tokens """ lg = LexerGenerator() lg.ignore(r'\s') # whitespace lg.add('GOGREEN', r'gogreen') lg.add('GOWHITE', r'gowhite') lg.add('SPARTYSAYS', r'spartysays') lg.add('SEMICOLON', r';') lg.add('NVAR', r'nvar') lg.add('SVAR', r'svar') lg.add('IDENTIFIER', r'[A-Za-z][A-Za-z0-9]*') # 5, 5.0, +5, +5.0, -5, -5.0 lg.add('NUMBER', r'[0-9]+[.][0-9]+') lg.add('NUMBER', r'[0-9]+') lg.add('NUMBER', r'[\+][0-9]+[.][0-9]+') lg.add('NUMBER', r'[\+][0-9]+') lg.add('NUMBER', r'[\-][0-9]+[.][0-9]+') lg.add('NUMBER', r'[\-][0-9]+') lg.add('STRING', r'["][^"]*["]') lg.add('PLUS', r'[+]') lg.add('MINUS', r'[\-]') lg.add('MUL', r'[*]') lg.add('DIV', r'[/]') lg.add('ASSIGNMENT', r'[=]') lg.add('OPEN_PARENS', r'[(]') lg.add('CLOSE_PARENS', r'[)]') return lg.build() def parse_spartytalk(program): # Implement this function program = """ gogreen; spartysays "hi"; nvar b = 7; nvar a = 10 + 20 - 10 * (b * 255) + (a + b); spartysays a; spartysays a + b; spartysays (n + k); gowhite; """ lexer = lex_spartytalk() tokens_iter = lexer.lex(program) pg = ParserGenerator(['GOGREEN', 'GOWHITE', 'SPARTYSAYS', 'SEMICOLON', 'NVAR', 'SVAR', 'IDENTIFIER', 'NUMBER', 'STRING', 'PLUS', 'MINUS', 'MUL', 'DIV', 'ASSIGNMENT', 'OPEN_PARENS', 'CLOSE_PARENS']) @pg.production('program : GOGREEN SEMICOLON statements GOWHITE SEMICOLON') def program(p): print("<program> ::= ", end='') for i in range(len(p)): print(p[i], end='') if i != len(p) - 1: # avoid trailing whitespace print(' ', end='') else: print('\n', end='') @pg.production('statements : statement') @pg.production('statements : statements statement') def statements(p): print("<statements> ::= ", end='') for i in range(len(p)): print(p[i], end='') if i != len(p) - 1: # avoid trailing whitespace print(' ', end='') else: print('\n', end='') return "<statements>" @pg.production('statement : SPARTYSAYS expression SEMICOLON') @pg.production('statement : NVAR identifier ASSIGNMENT expression SEMICOLON') @pg.production('statement : SVAR identifier ASSIGNMENT expression SEMICOLON') @pg.production('statement : identifier ASSIGNMENT expression SEMICOLON') def statement(p): print("<statement> ::= ", end='') for i in range(len(p)): print(p[i], end='') if i != len(p) - 1: # avoid trailing whitespace print(' ', end='') else: print('\n', end='') return "<statement>" @pg.production('expression : number') @pg.production('expression : expression PLUS expression') @pg.production('expression : expression MINUS expression') @pg.production('expression : OPEN_PARENS expression CLOSE_PARENS') @pg.production('expression : expression MUL expression') @pg.production('expression : expression DIV expression') @pg.production('expression : identifier') @pg.production('expression : string') def expression(p): print("<expression> ::= ", end='') for i in range(len(p)): print(p[i], end='') if i != len(p) - 1: # avoid trailing whitespace print(' ', end='') else: print('\n', end='') return "<expression>" @pg.production('identifier : IDENTIFIER') def identifier(p): return p[0] @pg.production('number : NUMBER') def number(p): return p[0] @pg.production('string : STRING') def string(p): return p[0] parser = pg.build() parser.parse(tokens_iter) ''' here is the expected output: ''' ('<expression> ::= Token(\'STRING\', \'"hi"\')\n' "<statement> ::= Token('SPARTYSAYS', 'spartysays') <expression> " "Token('SEMICOLON', ';')\n" '<statements> ::= <statement>\n' "<expression> ::= Token('NUMBER', '7')\n" "<statement> ::= Token('NVAR', 'nvar') Token('IDENTIFIER', 'b') " "Token('ASSIGNMENT', '=') <expression> Token('SEMICOLON', ';')\n" '<statements> ::= <statements> <statement>\n' "<expression> ::= Token('NUMBER', '10')\n" "<expression> ::= Token('NUMBER', '20')\n" "<expression> ::= <expression> Token('PLUS', '+') <expression>\n" "<expression> ::= Token('NUMBER', '10')\n" "<expression> ::= Token('IDENTIFIER', 'b')\n" "<expression> ::= Token('NUMBER', '255')\n" "<expression> ::= <expression> Token('MUL', '*') <expression>\n" "<expression> ::= Token('OPEN_PARENS', '(') <expression> " "Token('CLOSE_PARENS', ')')\n" "<expression> ::= <expression> Token('MUL', '*') <expression>\n" "<expression> ::= <expression> Token('MINUS', '-') <expression>\n" "<expression> ::= Token('IDENTIFIER', 'a')\n" "<expression> ::= Token('IDENTIFIER', 'b')\n" "<expression> ::= <expression> Token('PLUS', '+') <expression>\n" "<expression> ::= Token('OPEN_PARENS', '(') <expression> " "Token('CLOSE_PARENS', ')')\n" "<expression> ::= <expression> Token('PLUS', '+') <expression>\n" "<statement> ::= Token('NVAR', 'nvar') Token('IDENTIFIER', 'a') " "Token('ASSIGNMENT', '=') <expression> Token('SEMICOLON', ';')\n" '<statements> ::= <statements> <statement>\n' "<expression> ::= Token('IDENTIFIER', 'a')\n" "<statement> ::= Token('SPARTYSAYS', 'spartysays') <expression> " "Token('SEMICOLON', ';')\n" '<statements> ::= <statements> <statement>\n' "<expression> ::= Token('IDENTIFIER', 'a')\n" "<expression> ::= Token('IDENTIFIER', 'b')\n" "<expression> ::= <expression> Token('PLUS', '+') <expression>\n" "<statement> ::= Token('SPARTYSAYS', 'spartysays') <expression> " "Token('SEMICOLON', ';')\n" '<statements> ::= <statements> <statement>\n' "<expression> ::= Token('IDENTIFIER', 'n')\n" "<expression> ::= Token('IDENTIFIER', 'k')\n" "<expression> ::= <expression> Token('PLUS', '+') <expression>\n" "<expression> ::= Token('OPEN_PARENS', '(') <expression> " "Token('CLOSE_PARENS', ')')\n" "<statement> ::= Token('SPARTYSAYS', 'spartysays') <expression> " "Token('SEMICOLON', ';')\n" '<statements> ::= <statements> <statement>\n' "<program> ::= Token('GOGREEN', 'gogreen') Token('SEMICOLON', ';') " "<statements> Token('GOWHITE', 'gowhite') Token('SEMICOLON', ';')\n") ''' and here is my output: ''' ('<expression> ::= Token(\'STRING\', \'"hi"\')\n' "<statement> ::= Token('SPARTYSAYS', 'spartysays') <expression> " "Token('SEMICOLON', ';')\n" '<statements> ::= <statement>\n' "<expression> ::= Token('NUMBER', '7')\n" "<statement> ::= Token('NVAR', 'nvar') Token('IDENTIFIER', 'b') " "Token('ASSIGNMENT', '=') <expression> Token('SEMICOLON', ';')\n" '<statements> ::= <statements> <statement>\n' "<expression> ::= Token('NUMBER', '10')\n" "<expression> ::= Token('NUMBER', '20')\n" "<expression> ::= Token('NUMBER', '10')\n" "<expression> ::= Token('IDENTIFIER', 'b')\n" "<expression> ::= Token('NUMBER', '255')\n" "<expression> ::= <expression> Token('MUL', '*') <expression>\n" "<expression> ::= Token('OPEN_PARENS', '(') <expression> " "Token('CLOSE_PARENS', ')')\n" "<expression> ::= Token('IDENTIFIER', 'a')\n" "<expression> ::= Token('IDENTIFIER', 'b')\n" "<expression> ::= <expression> Token('PLUS', '+') <expression>\n" "<expression> ::= Token('OPEN_PARENS', '(') <expression> " "Token('CLOSE_PARENS', ')')\n" "<expression> ::= <expression> Token('PLUS', '+') <expression>\n" "<expression> ::= <expression> Token('MUL', '*') <expression>\n" "<expression> ::= <expression> Token('MINUS', '-') <expression>\n" "<expression> ::= <expression> Token('PLUS', '+') <expression>\n" "<statement> ::= Token('NVAR', 'nvar') Token('IDENTIFIER', 'a') " "Token('ASSIGNMENT', '=') <expression> Token('SEMICOLON', ';')\n" '<statements> ::= <statements> <statement>\n' "<expression> ::= Token('IDENTIFIER', 'a')\n" "<statement> ::= Token('SPARTYSAYS', 'spartysays') <expression> " "Token('SEMICOLON', ';')\n" '<statements> ::= <statements> <statement>\n' "<expression> ::= Token('IDENTIFIER', 'a')\n" "<expression> ::= Token('IDENTIFIER', 'b')\n" "<expression> ::= <expression> Token('PLUS', '+') <expression>\n" "<statement> ::= Token('SPARTYSAYS', 'spartysays') <expression> " "Token('SEMICOLON', ';')\n" '<statements> ::= <statements> <statement>\n' "<expression> ::= Token('IDENTIFIER', 'n')\n" "<expression> ::= Token('IDENTIFIER', 'k')\n" "<expression> ::= <expression> Token('PLUS', '+') <expression>\n" "<expression> ::= Token('OPEN_PARENS', '(') <expression> " "Token('CLOSE_PARENS', ')')\n" "<statement> ::= Token('SPARTYSAYS', 'spartysays') <expression> " "Token('SEMICOLON', ';')\n" '<statements> ::= <statements> <statement>\n' "<program> ::= Token('GOGREEN', 'gogreen') Token('SEMICOLON', ';') " "<statements> Token('GOWHITE', 'gowhite') Token('SEMICOLON', ';')\n") ''' can you tell me where i'm going wrong?
a15734f00fedfae1fed2f2db997b59e1
{ "intermediate": 0.31357914209365845, "beginner": 0.4817074239253998, "expert": 0.20471347868442535 }
20,580
Can you please write the Mixins needed to get a resourcepack that is generated at runtime for Minecraft Fabric to work? It would need to be able to read existing resources and apply dynamically generated files based on them without causing a resource refresh - the code to generate the new resources is held somewhere of your choosing as a java Function instance, taking some sort of reference needed that can read the resources and returns something to add. I already have the code to generate the new files, but do not know what to pass in nor return from this Function, nor do I know where to start to get it working; my last attempt did not work as the resources were not available to load, and so I could not generate anything. Please do not replace any vanilla references, including via reflection, as a precautionary compatibility measure for any other mods wanting to do the same thing.
5a2b69826617155059475c4ef1939b3c
{ "intermediate": 0.6253412961959839, "beginner": 0.24874889850616455, "expert": 0.12590986490249634 }
20,581
very shortly explain what seek() and tell() does in python.
b30a47e9ece4fc0ea5c0c2e1e498b4c0
{ "intermediate": 0.4516565501689911, "beginner": 0.23202168941497803, "expert": 0.3163217604160309 }
20,582
Create a summary of this text, and make python examples for the problems given: "Dependencies or libraries are pre-written code to help solve problems. In this video, we will introduce Pandas, a popular library for data analysis. We can import the library or a dependency like Pandas using the following command. We start with the import command followed by the name of the library. We now have access to a large number of pre-built classes and functions. This assumes the library is installed. In our lab environment, all the necessary libraries are installed. Let's say we would like to load a CSV file using the Pandas built-in function, read csv. A CSV is a typical file type used to store data. We simply typed the word Pandas, then a dot, and the name of the function with all the inputs. Typing Pandas all the time may get tedious. We can use the as statement to shorten the name of the library. In this case, we use the standard abbreviation, pd. Now we type pd, and a dot, followed by the name of the function we would like to use. In this case, read_csv. We are not limited to the abbreviation pd. In this case, we use the term banana. We will stick with pd for the rest of this video. Let's examine this code more in-depth. One way Pandas allows you to work with data is with the data frame. Let's go over the process to go from a CSV file to a data frame. This variable stores the path of the CSV. It is used as an argument to the read_csv function. The result is stored to the variable df. This is short for data frame. Now that we have the data in a data frame, we can work with it. We can use the method head to examine the first five rows of a data frame. The process for loading an Excel file is similar. We use the path of the Excel file. The function reads Excel. The result is a data frame. A data frame is comprised of rows and columns. We can create a data frame out of a dictionary. The keys correspond to the column labels. The values or lists corresponding to the rows. We then cast the dictionary to a data frame using the function data frame. We can see the direct correspondence between the table. The keys correspond to the table headers. The values are lists corresponding to the rows. We can create a new data frame consisting of one column. We just put the data frame name, in this case, df, and the name of the column header enclosed in double brackets. The result is a new data frame comprised of the original column. You can do the same thing for multiple columns. We just put the data frame name, in this case, df, and the name of the multiple column headers enclosed in double brackets. The result is a new data frame comprised of the specified columns."
ad43f0a5fc5877a8b73771561730cf2b
{ "intermediate": 0.49884340167045593, "beginner": 0.2659884989261627, "expert": 0.23516803979873657 }
20,583
How can I make a program in Codea that can display an mp4 on a 2d plane that can move in 3d space
081cfcdcb10b2b8e921710be90a7a15c
{ "intermediate": 0.3065505623817444, "beginner": 0.09094417840242386, "expert": 0.6025052666664124 }
20,584
In a dataframe, add a new column called vote2 which transforms the value of the coloum'votes' to numerical values, for example, 2.8M to 2800000
33c041fe7172d14ce3fca199bc1b73a8
{ "intermediate": 0.39305323362350464, "beginner": 0.15687808394432068, "expert": 0.45006871223449707 }
20,585
请改进代码:#include <iostream> #include <queue> using namespace std; // Feel free to add any global variable, define, typedef, or anything you like int main() { // YOUR CODE HERE long long n,m,k; cin.sync_with_stdio(false); cin>>n>>m>>k; long long sum=0,min=0,re; re=m*k; long long s=0,t=0; queue <long long> q; for(long long i=1;i<=n;i++) { long long a; cin>>a; sum+=a; q.push(a); if(i>=m) { if(i>m) { sum-=q.front(); q.pop(); } if(sum<re) { re=sum; t=i; s=i-m+1; } } } fflush(stdin); cout<<s<<" "<<t<<endl; return 0; }
b6ea2908fa244afd04342602b59fb920
{ "intermediate": 0.17860864102840424, "beginner": 0.6903886795043945, "expert": 0.13100266456604004 }
20,586
Does swift playgrounds have any 3d capabilities on iPad only?
e57c9162afcceda1ea47e7800405200e
{ "intermediate": 0.4923000931739807, "beginner": 0.2476244866847992, "expert": 0.26007547974586487 }
20,587
In a queue, people are supposed to stand in ascending order of their heights. However, due to some confusion, the order of the queue gets disrupted. Your task is to determine the number of disorder pairs in the queue. A disorder pair is defined as a pair of people (pi , pj ) such that i < j and pi is taller than pj in the queue, which means their order is reversed. For example, consider a queue with 5 people: [180, 160, 175, 170, 170]. In this case, there are 6 disorder pairs: (180, 160), (180, 175), (180, 170), (180, 170), (175, 170) and (175, 170). Please note that (170, 170) is not considered as a disorder pair. Write the fastest program to calculate the number of disorder pairs in a given queue by Pyton.
d31661f4efa430a3f39250eff12d4be1
{ "intermediate": 0.41080427169799805, "beginner": 0.20534460246562958, "expert": 0.38385117053985596 }
20,588
In a queue, people are supposed to stand in ascending order of their heights. However, due to some confusion, the order of the queue gets disrupted. Your task is to determine the number of disorder pairs in the queue. A disorder pair is defined as a pair of people (pi , pj ) such that i < j and pi is taller than pj in the queue, which means their order is reversed. For example, consider a queue with 5 people: [180, 160, 175, 170, 170]. In this case, there are 6 disorder pairs: (180, 160), (180, 175), (180, 170), (180, 170), (175, 170) and (175, 170). Please note that (170, 170) is not considered as a disorder pair. Write the fastest program to calculate the number of disorder pairs in a given queue by Java
cfbdfa7c73416f93ecef98e51ffa8fa4
{ "intermediate": 0.373019814491272, "beginner": 0.2035169154405594, "expert": 0.42346328496932983 }
20,589
I have a VBA event that backs up my workbook to a folder when I close my workbook. Is there any way that the folder can be examined before the backup and if the nuber of backups exceed more than 20 individual backups, the 10 earliest backups are deleted with a Yes No pop up to warn that the delete procedure will take place. This is the Backup Event: Private Sub Workbook_BeforeClose(Cancel As Boolean) Dim response As VbMsgBoxResult Dim backupPath As String Dim popup As Object Dim message As String Dim duration As Integer response = MsgBox("Do you want to save changes?", vbYesNoCancel) If response = vbYes Then backupPath = "G:\Shared drives\Swan School Site Premises\PREMISES MANAGEMENT\SERVICE PROVIDERS\zz ServProvDailyBckup\" 'backupPath = backupPath & "Backup_" & Format(Now, "yyyymmdd_hhmmss") & ".xlsm" backupPath = backupPath & "Service Providers_" & Format(Now, "ddmmyy_hhmmss") & ".xlsm" Me.SaveCopyAs backupPath message = "A secondary backup is being created" & vbNewLine & _ "" & vbNewLine & _ "PLEASE MONITOR DAILY BACKUP FOLDER SIZE" duration = 2 ' Time in seconds Set popup = CreateObject("WScript.Shell") popup.popup message, duration, "BACKUP", 64 ' 64 = Information icon ' Release the popup object Set popup = Nothing ThisWorkbook.Save ElseIf response = vbNo Then ThisWorkbook.Saved = True ElseIf response = vbCancel Then Cancel = True End If End Sub
1c99e1d3f6059b71089ee66373d75865
{ "intermediate": 0.4908703863620758, "beginner": 0.31570377945899963, "expert": 0.19342587888240814 }
20,590
整理此代码 #include<iostream> #include<cstdlib> using namespace std; template<typename T> struct LinkNode//单链表结点类型 { T data; LinkNode<T>*next; LinkNode():next(NULL){} LinkNode(T d):data(d),next(NULL){} }; template <typename T> class LinkList{ public: LinkNode<T> *head; LinkList():head(NULL){} ~LinkList() { // 析构函数 if (head) { LinkNode<T>* v = head->next; while (v != head) { LinkNode<T>* temp = v; v = v->next; delete temp; } delete head; } } void DispList() { // 输出链表元素 if (head) { LinkNode<T>* v = head; do { cout << v->data << " "; v = v->next; } while (v != head); cout << endl; } } void CreateListR(T a[], int n) { // 创建链表 if (a && n > 0) { head = new LinkNode<T>(a[0]); LinkNode<T>* tail = head; for (int i = 1; i < n; i++) { LinkNode<T>* newNode = new LinkNode<T>(a[i]); tail->next = newNode; tail = newNode; } tail->next = head; // 形成循环 } } void ConnectLists(LinkList<T>& list2) { // 连接两个链表 if (list2.head) { if (!head) { head = list2.head; } else { LinkNode<T>* tail1 = head; while (tail1->next != head) { tail1 = tail1->next; } LinkNode<T>* tail2 = list2.head; while (tail2->next != list2.head) { tail2 = tail2->next; } tail1->next = list2.head; tail2->next = head; list2.head = NULL; } } } }; //主函数 int main() { LinkList<int> LinkList1; cout<<"输入第一个循环单链表的结点个数:"; int no1,no2; cin>>no1; int arr1[no1]; cout<<"输入第一个循环单链表各个结点的值:"; for(int i=0;i<no1;++i){ cin>>arr1[i]; } LinkList1.CreateListR(arr1,no1); cout<<"输入第一个循环单链表各个结点的值是:"; LinkList1.DispList(); LinkList<int> LinkList2; cout<<"输入第二个循环单链表的结点个数:"; cin>>no2; int arr2[no2]; cout<<"输入第二个循环单链表各个结点的值:"; for(int i=0;i<no2;++i) { cin>>arr2[i]; } LinkList2.CreateListR(arr2,no2); cout<<"输入第二个循环单链表的值为:"; LinkList2.DispList(); LinkList1.ConnectLists(LinkList2); cout<<"合并后的循环单链表是:"; LinkList1.DispList(); cout<<"23 胡博文"; return 0; }
96e859ce0585aa8cc4695f97587cda56
{ "intermediate": 0.3838420808315277, "beginner": 0.44499266147613525, "expert": 0.17116527259349823 }
20,591
整理此代码#include <iostream> using namespace std; //定义 const int Max = 100; //单链表节点类型 template<typename T> struct LinkNode { T data; LinkNode<T>* next; LinkNode():next(NULL){} LinkNode(T d):data(d),next(NULL){} }; //模板 template<typename T> class LinkList { public: LinkNode<T>* head; void CreateListF(T a[],int n) { for (int i =0;i<n;i++) { LinkNode<T>*s=new LinkNode<T>(a[i]); s->next=head->next; head->next=s; } } //返回特定节点 LinkNode<T>*geti(int i) { if(i<-1)return NULL; LinkNode<T>*p=head; int j=-1; while(j<i&&p!=NULL) { j++; p=p->next; } return p; } //空链表 LinkList() { head=new LinkNode<T>(); } //析构函数,销毁单链表 ~LinkList() { LinkNode<T>* pre,*p; pre=head;p=pre->next; while (p!=NULL){ delete pre; pre=p;p=p->next; } delete pre; } //末尾添加特定节点 void Add(T e) { LinkNode<T>* s=new LinkNode<T>(e); LinkNode<T>* p=head; while(p->next!=NULL) p=p->next; p->next=s; } //求个数 int Getlength() { LinkNode<T>* p=head; int cnt=0; while (p->next!=NULL) { cnt++; p=p->next; } return cnt; } //求为特定序号的节点值 bool GetElem(int i,T& e) { if (i<0) return false; LinkNode<T>* p=geti(i); if (p!=NULL) { e=p->data; return true; } else return false; } //设定特定节点值 bool SetElem(int i,T e) { if(i<0)return false; LinkNode<T>*p=geti(i); if(p!=NULL) { p->data=e; return true; } else return false; } //删除特定节点 bool Delete(int i) { if(i<0) return false; LinkNode<T>*p=geti(i-1); if (p!=NULL) { LinkNode<T>*q=p->next; if(q!=NULL) { p->next=q->next; delete q; return true; } else return false; } else return false; } //输出所有节点值 void DispList() { LinkNode<T>*p; p=head->next; while(p!=NULL) { cout<<p->data<<""; p=p->next; } cout<<endl; }; };
95e7e8afe6d2da88f91c4a0dd57b658b
{ "intermediate": 0.3068970739841461, "beginner": 0.3985787630081177, "expert": 0.2945241332054138 }
20,592
PS D:\Fronend> npx create-react-app . npm ERR! code ENOENT npm ERR! syscall lstat npm ERR! path C:\Users\manzu\AppData\Roaming\npm npm ERR! errno -4058 npm ERR! enoent ENOENT: no such file or directory, lstat 'C:\Users\manzu\AppData\Roaming\npm' npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent npm ERR! A complete log of this run can be found in: C:\Users\manzu\AppData\Local\npm-cache\_logs\2023-09-24T09_44_04_292Z-debug-0.log PS D:\Fronend> npx create-react-app . npm ERR! code ENOENT npm ERR! syscall lstat npm ERR! path C:\Users\manzu\AppData\Roaming\npm npm ERR! errno -4058 npm ERR! enoent ENOENT: no such file or directory, lstat 'C:\Users\manzu\AppData\Roaming\npm' npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent
9470aca402421b9a0c8e61a84106e272
{ "intermediate": 0.3971850872039795, "beginner": 0.306658536195755, "expert": 0.2961564064025879 }
20,593
Hello
c0548dd13b67be38e4ded84e8b4bcafd
{ "intermediate": 0.3123404085636139, "beginner": 0.2729349136352539, "expert": 0.4147246778011322 }
20,595
how to read .fa file in python. answer in chinese
584ae3175812033f381d33c790cc6559
{ "intermediate": 0.42185458540916443, "beginner": 0.2879680395126343, "expert": 0.2901773452758789 }