row_id int64 0 48.4k | init_message stringlengths 1 342k | conversation_hash stringlengths 32 32 | scores dict |
|---|---|---|---|
20,295 | write a bash script to add a dns cname record on digital ocean using their api and curl | 65000e57a34aa20b524e6fbbe11da8ae | {
"intermediate": 0.6172878742218018,
"beginner": 0.16200722754001617,
"expert": 0.2207048535346985
} |
20,296 | write a bash script to add a dns cname record on digital ocean using their api and curl. Escape all special characters in the script as if it were passed through htmlspecialchars | c974b979bddd5c8cde1797eeb9fdc0e3 | {
"intermediate": 0.47224727272987366,
"beginner": 0.22557811439037323,
"expert": 0.3021746277809143
} |
20,297 | i want to make a coroutine in unity, spawns a ball under the game object as a child, and when you press the mouse button down, the ball should unparent itself and after some time, the gameobject should spawn another ball | bdeb4b63001eddb58ce57d4065fd99aa | {
"intermediate": 0.4523497521877289,
"beginner": 0.13522537052631378,
"expert": 0.41242489218711853
} |
20,298 | add a delay in unity before you can click the screen | 3786dc4e1649f4cab3ad208969616245 | {
"intermediate": 0.3880351185798645,
"beginner": 0.25796616077423096,
"expert": 0.35399872064590454
} |
20,299 | I created a basic navigation bar of a website in html and css , but it also gets scrolled as I scroll the page up , so what function I use to keep it fixed at the top when I scroll the page up | c18aa5d07ef356bdf7657792546aa19f | {
"intermediate": 0.3767390251159668,
"beginner": 0.32920944690704346,
"expert": 0.29405152797698975
} |
20,300 | hi | 423efc17c11250894010de307d0b372e | {
"intermediate": 0.3246487081050873,
"beginner": 0.27135494351387024,
"expert": 0.40399640798568726
} |
20,301 | I writing a python program, I'm using sqlalchemy. I'd like to ask is it alright to use two nested try-excepts when it comes to software principals? | 0050802a1c66cf6ed3b8749c28d9f5ed | {
"intermediate": 0.4297066032886505,
"beginner": 0.2877793312072754,
"expert": 0.2825140357017517
} |
20,302 | Write Python code which gives current date and time in New York using web | 6fa5622b012d60c3b69debb85050676f | {
"intermediate": 0.4912647008895874,
"beginner": 0.22332832217216492,
"expert": 0.2854069471359253
} |
20,303 | Take a titanic data set from Kaggle and do machine learning codes on it | 3db75dfae60a841257a8d901c3452178 | {
"intermediate": 0.1947011649608612,
"beginner": 0.11034686863422394,
"expert": 0.6949519515037537
} |
20,304 | create a chatbot using llama2 langchain streamlit | ca945f0f9e272925220519f0dfd14254 | {
"intermediate": 0.31659412384033203,
"beginner": 0.3358153998851776,
"expert": 0.3475904166698456
} |
20,305 | write a class as base class, provide abstract function can be inherit or override for get, save, post, put using linq inn C# | 7d47a4e08d81c96d817801c2411892ea | {
"intermediate": 0.1623869687318802,
"beginner": 0.7167307734489441,
"expert": 0.12088221311569214
} |
20,306 | why when I use normalize in matlab for perprocessing data for ANN, the values goes between -1 to +1 , instead of 0 to 1?? | 5c9ae0bed292a04d8738edc0be6c511b | {
"intermediate": 0.2756771147251129,
"beginner": 0.049868613481521606,
"expert": 0.6744542717933655
} |
20,307 | create a bookmarklet that extracts all strings on the page that end in .onion and displays each extracted string in a box at the top right of the webpage, each string needs to be in a small font, and the box needs a button/function to download all the extracted strings to a txt file, and a button/function to copy all, clear all, and close. please provide code as a one liner | 537dac22dea8f621bc13b7c3f51e5969 | {
"intermediate": 0.3870679438114166,
"beginner": 0.28401675820350647,
"expert": 0.3289152681827545
} |
20,308 | I have a Kotlin class Menu with a parameter of val previousElement: Menu<E>?. The idea is that each next level into the menu is another Menu class, with previousElement being the previous Menu. Now I want to add a parameter that contains the list of all "levels" the Menu that can find out on what the element by repeatedly using previousElement until it hits null and using that to determine what is the current menu "level". Can you give an example of code and/or provide explanation on what kind of collection is the best type to use for this kind of list? | caa1b352146afcb2f743701114cdb531 | {
"intermediate": 0.573864758014679,
"beginner": 0.23316900432109833,
"expert": 0.19296623766422272
} |
20,309 | can you help me to write code by using matlab | 624986c38330bb4f57472b530e581ca6 | {
"intermediate": 0.383439302444458,
"beginner": 0.2758435904979706,
"expert": 0.3407171368598938
} |
20,310 | explain this reaper theme code concisely
set tcp.meter [368 2 12 94 1 0 1 1]
set tcp.mute + tcp_yanchor [324 1 18 16 1 y_align 1 y_align]
set tcp.solo + tcp_yanchor [342 1 18 16 1 y_align 1 y_align]
set tcp.fx + tcp_yanchor w<211 h<74 [0] [324 22 24 18 1 y_align 1 y_align] h<51 [0] [324 22 24 18 1 y_align 1 y_align]
set tcp.fxbyp tcp.fx{x}>10 + [tcp.fx tcp.fx 12 18 1 y_align 1 y_align] [tcp.fx{w}] [0]
set tcp_label_fullmargin + tcp_yanchor w<211 [25 1 275 16 0 y_align 1 y_align] w<270 [25 1 235 16 0 y_align 1 y_align] w<360 [25 1 235 16 0 y_align 1 y_align] [25 1 95 16 0 y_align 0.5 y_align] | dc23e1e1f41e682fcab84bec0415c3a1 | {
"intermediate": 0.3407656252384186,
"beginner": 0.47919851541519165,
"expert": 0.18003588914871216
} |
20,311 | In Hibernate, in a many-to-many relationship, can the developer choose which entity is the unowned side of the association? | fd5f3a5680068b8fe30fa538b87a9502 | {
"intermediate": 0.42726996541023254,
"beginner": 0.19888530671596527,
"expert": 0.3738447427749634
} |
20,312 | To embed color watermarks using the aforementioned feature from QQRD domain, an association rule is established between the
watermark bit w and the magnitude of (q21 − q31)i/j/k. The watermark bit w is embedded by adjusting the magnitude relation
between (q21)i/j/k and (q31)i/j/k. When the watermark bit to beembedded is ‘1’, the difference (q21 − q31)i/j/k should be greater
than or equal to the strength control parameter T. When the watermark bit to be embedded is ‘0’, the difference (q31 − q21)i/j/k
should be greater than or equal to the strength control parameter T. If these two rules are not met, the elements (q21)i/j/k and
(q31)i/j/k are modified to (q'21)i/j/k and (q31)i/j/k based on the following Eqs.
if w = 1 and (q21 − q31)i/j/k < T, then
(q’21)i/j/k = qavg + T/2 ;
(q‘31)i/j/k = qavg − T/2 ,
if w = 0 and (q21 − q31)i/j/k > −T, then
(q’21)i/j/k = qavg − T/2 ;
(q’31)i/j/k = qavg + T/2 | fb07a7df4c7fd12836ba4b3e75c731e0 | {
"intermediate": 0.36909425258636475,
"beginner": 0.2471473217010498,
"expert": 0.38375842571258545
} |
20,313 | To embed color watermarks using the aforementioned feature from QQRD domain, an association rule is established between the
watermark bit w and the magnitude of (q21 − q31)i/j/k. The watermark bit w is embedded by adjusting the magnitude relation
between (q21)i/j/k and (q31)i/j/k. When the watermark bit to beembedded is ‘1’, the difference (q21 − q31)i/j/k should be greater
than or equal to the strength control parameter T. When the watermark bit to be embedded is ‘0’, the difference (q31 − q21)i/j/k
should be greater than or equal to the strength control parameter T. If these two rules are not met, the elements (q21)i/j/k and
(q31)i/j/k are modified to (q’21)i/j/k and (q31)i/j/k based on the following Eqs.
if w = 1 and (q21 − q31)i/j/k < T, then
(q’21)i/j/k = qavg + T/2 ;
(q‘31)i/j/k = qavg − T/2 ,
if w = 0 and (q21 − q31)i/j/k > −T, then
(q’21)i/j/k = qavg − T/2 ;
(q’31)i/j/k = qavg + T/2
If I stipulate that T is a number greater than 0, and q21, q31, q’21, q’31 must all be greater than 0; | c46f84d5e1fe666c144a3039fcf0edb3 | {
"intermediate": 0.3611183166503906,
"beginner": 0.2446853220462799,
"expert": 0.39419639110565186
} |
20,314 | read api document from https://open.oceanengine.com/labels/12/docs/1745207002572807 generate create table statement | 0c340c3b548f9761db548df046413662 | {
"intermediate": 0.511114239692688,
"beginner": 0.21240058541297913,
"expert": 0.2764851450920105
} |
20,315 | how can we solve croatian fiscalization on java 11 | 36e28a5e1605c5f94269aad99417b6d1 | {
"intermediate": 0.43745842576026917,
"beginner": 0.1834149807691574,
"expert": 0.379126638174057
} |
20,316 | I am running the next code to find if a point is located within a polygon : from shapely.geometry import Point
from shapely.geometry.polygon import Polygon
def get_polygon_name(latitude, longitude, polygons):
point = Point(longitude, latitude)
for name, coordinates in polygons.items():
polygon = Polygon(coordinates)
if polygon.contains(point):
return name
To do so I apply multiple points from a data frame : train_df_part[['pickup_borough']] = train_df_part.apply(lambda x: get_polygon_name(x.pickup_latitude, x.pickup_longitude, polygons), axis=1), When I am running it I get an error saying: ValueError: Columns must be same length as key. but in this case the number of columns cannot be the same size of the five polygons. How can I solve it? | ae592215b540f7ec4b481e150b7507e8 | {
"intermediate": 0.7441835403442383,
"beginner": 0.1312238872051239,
"expert": 0.12459267675876617
} |
20,317 | how to make the path /alpha-bank-ui/main/dashboard get re written to /? in ingress | b1c0e3e59d254d0ccebf582b4be12b0a | {
"intermediate": 0.41403353214263916,
"beginner": 0.22646354138851166,
"expert": 0.359502911567688
} |
20,318 | Is it possible to write a python code that detects Repetitions in a text file and highlights them
by placing a "?=¿&/" suffix before them in an output file? | 6067a1670de1c89bb2526207150a86f3 | {
"intermediate": 0.4028519093990326,
"beginner": 0.09511581063270569,
"expert": 0.5020322799682617
} |
20,319 | analyze this reaper code. modify so that it toggles show embedded ui of the fx under cursor in tcp
function main()
track = VF_GetTrackUnderMouseCursor()
if track then
vsti_id = reaper.TrackFX_GetInstrument(track)
if vsti_id ~= nil then
reaper.TrackFX_Show(track, vsti_id, 1) -- select in fx chain
end
end -- if track ~= nil then
end
---------------------------------------------------------------------
function CheckFunctions(str_func) local SEfunc_path = reaper.GetResourcePath()..'/Scripts/MPL Scripts/Functions/mpl_Various_functions.lua' local f = io.open(SEfunc_path, 'r') if f then f:close() dofile(SEfunc_path) if not _G[str_func] then reaper.MB('Update '..SEfunc_path:gsub('%\\', '/')..' to newer version', '', 0) else return true end else reaper.MB(SEfunc_path:gsub('%\\', '/')..' missing', '', 0) end end
--------------------------------------------------------------------
local ret = CheckFunctions('VF_GetItemTakeUnderMouseCursor')
local ret2 = VF_CheckReaperVrs(5.95,true)
if ret and ret2 then
script_title = "Show instrument in FX chain on track under mouse cursor"
reaper.Undo_BeginBlock()
main()
reaper.Undo_EndBlock(script_title, 0)
end | d42d9e6b9c7c9d9465187235d52b6b62 | {
"intermediate": 0.5341287851333618,
"beginner": 0.23258818686008453,
"expert": 0.23328310251235962
} |
20,320 | what does re-write target / do? | 75404feb2c0414bce3191186a24e29c7 | {
"intermediate": 0.30372515320777893,
"beginner": 0.21445773541927338,
"expert": 0.4818170666694641
} |
20,321 | what is the difference between a while and a while-do loop | 1db0708e75b57fb4fb13d067185f2f07 | {
"intermediate": 0.13866440951824188,
"beginner": 0.6942497491836548,
"expert": 0.16708584129810333
} |
20,322 | Is it possible to write a python code that detects Stutters in a text file
and highlights them by placing a "[{/&%}]" suffix before them in an output file? | ae3ff96a7eaa34fde7cae8b8a00cc88b | {
"intermediate": 0.39000535011291504,
"beginner": 0.06780087202787399,
"expert": 0.5421937704086304
} |
20,323 | I need a piece of Python code to draw a scatter plot with three subgraphs using the plot package and save the image results locally | 5874948572d9936145bdafa6835be7e4 | {
"intermediate": 0.5636982321739197,
"beginner": 0.09828652441501617,
"expert": 0.33801522850990295
} |
20,324 | compare and contrast the usage of if-else statements and switch statements. Use the information in Eck, D. J. (2022). Introduction to programming using java to do so | cb9cf53b4135738a80d07cd6bd07879a | {
"intermediate": 0.30941903591156006,
"beginner": 0.2954161763191223,
"expert": 0.39516472816467285
} |
20,325 | I need help | f2aaffea58b70445ba519ccf2372e605 | {
"intermediate": 0.3868543207645416,
"beginner": 0.3114243447780609,
"expert": 0.3017213046550751
} |
20,326 | I used your code :
lookback = 10080
quantity = 0.05
active_signal = None
buy_entry_price = None
sell_entry_price = None
def calculate_percentage_difference(entry_price, exit_price):
percentage_difference = ((exit_price - entry_price) / entry_price) * 100
return percentage_difference
while True:
if df is not None:
signals = signal_generator(df)
mark_price_data = client.ticker_price(symbol=symbol)
mark_price = float(mark_price_data['price']) if 'price' in mark_price_data else 0.0
print(f"The signal time is: {dt.datetime.now().strftime('%Y-%m-%d %H:%M:%S')}, Price {mark_price} - Signals: {signals}")
if 'buy' in signals and active_signal != 'buy':
try:
active_signal = 'buy'
buy_entry_price = mark_price # Record the Buy entry price
print(f"Buy Entry Price: {buy_entry_price}")
# Execute Buy orders here
client.new_order(symbol=symbol, side='BUY', type='MARKET', quantity=quantity)
client.new_order(symbol=symbol, side='BUY', type='MARKET', quantity=quantity)
print("Long order executed!")
except binance.error.ClientError as e:
print(f"Error executing long order: ")
if sell_entry_price is not None and buy_entry_price is not None:
sell_exit_price = buy_entry_price
difference_sell = calculate_percentage_difference(sell_entry_price, sell_exit_price)
profit_sell = difference_sell * 50
total_profit_sell = profit_sell - (0.04 * profit_sell)
print(f"Sell Profit: {total_profit_sell} %,sell entry price {sell_entry_price}, buy exit price {buy_entry_price} ")
else:
print("Sell Entry price or Buy Entry price is not defined.")
elif 'sell' in signals and active_signal != 'sell':
try:
active_signal = 'sell'
sell_entry_price = mark_price # Record the sell entry price
print(f"Sell Entry Price: {sell_entry_price}")
# Execute sell orders here
client.new_order(symbol=symbol, side='SELL', type='MARKET', quantity=quantity)
client.new_order(symbol=symbol, side='SELL', type='MARKET', quantity=quantity)
print("Short order executed!")
except binance.error.ClientError as e:
print(f"Error executing short order: ")
if buy_entry_price is not None and sell_entry_price is not None:
buy_exit_price = sell_entry_price
difference_buy = calculate_percentage_difference(buy_entry_price, buy_exit_price)
profit_buy = difference_buy * 50
total_profit_buy = profit_buy - (0.04 * profit_buy)
print(f"Buy Profit: {total_profit_buy} %,buy entry {buy_entry_price}, sell exit: {sell_entry_price} ")
else:
print("Buy Entry price or Sell Entry price is not defined.")
time.sleep(1)
But it returing me wrong countings: Sell Profit: 2.8572736846930473 %,sell entry price 218.39, buy exit price 218.52 | 43917bbbd7b8729d8fc651b6a0c8ac4e | {
"intermediate": 0.34489062428474426,
"beginner": 0.42601504921913147,
"expert": 0.22909429669380188
} |
20,327 | <BarChart
initialSpacing={0}
stackData={existingArray}
width={screenWidth * 0.8}
height={220}
barWidth={50}
spacing={1}
lineConfig={{textColor:'black',textFontSize:18,textShiftX:4}}
verticalLabelRotation={20}
isAnimated
fromZero={true}
showLine={false}
xAxisLength={0}
xAxisColor={"transparent"}
yAxisColor={"transparent"}
xAxisLabelTextStyle={{color:'gray',left:10,top:-3,fontSize:12,fontFamily:FONTS.MEDIUM}}
hideRules
hideYAxisText
hideOrigin={true}
hideDataPoints={true}
barStyle={{
marginHorizontal:10,
justifyContent: "center",
alignItems: "center",
}}
scrollAnimation={true}
yAxisIndicesColor={"transparent"}
labelTextStyle={{marginVertical:10}}
renderBars={renderBars}
animateOnDataChange={true}
renderTooltip={(item) => {
console.log(item)
return (
<View
style={{
height:25,
width: 50,
backgroundColor: "#DBDBDB",
borderRadius:5,marginVertical:1,
justifyContent: "center",
alignItems: "center",
}}
>
<Text style={{ top: 2, right: -2, color: "black",fontFamily:FONTS.REGULAR }}>
{item.stacks[0].value} TND
</Text>
</View>
);
}}
/> i use ract native gifted charts and i want to display a label on the top of each bar update the code to be compatible with our requirment and also i use stack bars | 14a402be71667a6ddd9ee6a0cd13dc1d | {
"intermediate": 0.29653769731521606,
"beginner": 0.56838458776474,
"expert": 0.13507768511772156
} |
20,328 | export interface CanvasSize {
width: number;
height: number;
}
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 theme = useTheme();
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,
);
orderFeedDrawer.drawChain(
context,
canvasSize,
trades,
camera,
cupParams.aggregatedPriceStep,
cupParams.cellHeight,
cupParams.quantityDivider,
cupParams.priceDivider,
!settings.minQuantity ? 0 : parseFloat(settings.minQuantity),
dpiScale,
theme,
settings.volumeAsDollars,
);
}
};
useEffect(() => {
if (!workerRef.current) return;
draw(event.data.trades, event.data.camera));
}, [workerRef.current, canvasRef.current, canvasSize, symbol, cupParams
]);
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;
t 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 halfCupCellHeight = cupCellHeight / 2;
const startY = (fullHeightRowsCount % 2 ? fullHeightRowsCount - 1 : fullHeightRowsCount) / 2 * cupCellHeight;
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();
},
drawChain: (
ctx: CanvasRenderingContext2D,
canvasSize: CanvasSize,
trades: TradeItem[],
camera: number,
aggregatedPriceStep: number,
cupCellHeight: number,
quantityDivider: number,
priceDivider: number,
minQuantity: number,
dpiScale: number,
theme: Theme,
volumeAsDollars: boolean,
) => {
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;
let timestamp: number|null = null;
trades.forEach(trade => {
if (startX < 0) return;
const isSquare = trade?.secondPrice && trade.price !== trade.secondPrice;
const yModifier = (trade.price - camera) / aggregatedPriceStep * cupCellHeight + halfCupCellHeight;
const prevYModifier = isSquare ? ((trade?.secondPrice || 0) - camera) / aggregatedPriceStep * cupCellHeight + halfCupCellHeight : 0;
const quantity = volumeAsDollars ? (trade.quantity / quantityDivider) * (trade.price / priceDivider) : trade.quantity / quantityDivider;
if (isSquare) {
startX = orderFeedDrawer.drawSquare(
ctx,
trade.price,
trade.quantity / quantityDivider < minQuantity ? 0 : trade.radius,
quantity,
trade.side,
dpiScale,
startX,
startY - yModifier,
startY - prevYModifier,
theme,
);
} else {
startX = orderFeedDrawer.drawCircle(
ctx,
trade.price,
trade.quantity / quantityDivider < minQuantity ? 0 : trade.radius,
quantity,
trade.side,
dpiScale,
startX,
startY - yModifier,
theme,
timestamp === trade.timestamp,
);
}
timestamp = trade.timestamp;
});
},
drawCircle: (
ctx: CanvasRenderingContext2D,
price: number,
tradeRadius: number,
quantity: number,
side: "Buy" | "Sell",
dpiScale: number,
startX: number,
startY: number,
theme: Theme,
inOneTimestamp: boolean,
): number => {
const label = orderFeedTools.abbreviateNumber(quantity);
const {width: textWidth} = ctx.measureText(label);
const radius = clamp(tradeRadius, 5, 50) * dpiScale;
const bubbleX = startX - (radius * 0.75);
const bubbleY = startY;
ctx.beginPath();
ctx.fillStyle = side === "Buy"
? orderFeedOptions(theme).sell.backgroundColor
: orderFeedOptions(theme).buy.backgroundColor;
ctx.strokeStyle = side === "Buy"
? orderFeedOptions(theme).sell.borderColor
: orderFeedOptions(theme).buy.borderColor;
ctx.lineWidth = dpiScale;
ctx.arc(bubbleX, bubbleY, radius, 0, 2 * Math.PI);
ctx.fill();
ctx.stroke();
if (tradeRadius > 0) {
ctx.textBaseline = "middle";
ctx.font = `${orderFeedOptions(theme).font.weight} ${orderFeedOptions(theme).font.sizePx * dpiScale}px ${orderFeedOptions(theme).font.family}`;
ctx.fillStyle = side === "Buy"
? orderFeedOptions(theme).sell.textColor
: orderFeedOptions(theme).buy.textColor;
ctx.fillText(label, bubbleX - (textWidth / 2), bubbleY);
}
return bubbleX - radius;
},
drawSquare: (
ctx: CanvasRenderingContext2D,
price: number,
tradeRadius: number,
quantity: number,
side: "Buy" | "Sell",
dpiScale: number,
startX: number,
startY: number,
prevStartY: number,
theme: Theme,
): number => {
const label = orderFeedTools.abbreviateNumber(quantity);
const {width: textWidth} = ctx.measureText(label);
const radius = clamp(tradeRadius, 5, 50) * dpiScale;
const width = radius * 1.75;
const height = prevStartY - startY;
ctx.beginPath();
ctx.fillStyle = side === "Buy"
? orderFeedOptions(theme).sell.backgroundColor
: orderFeedOptions(theme).buy.backgroundColor;
ctx.strokeStyle = side === "Buy"
? orderFeedOptions(theme).sell.borderColor
: orderFeedOptions(theme).buy.borderColor;
ctx.lineWidth = dpiScale;
ctx.rect(startX - width + 3 * dpiScale, startY, width, height);
ctx.fill();
ctx.stroke();
if (tradeRadius > 0) {
ctx.textBaseline = "middle";
ctx.font = `${orderFeedOptions(theme).font.weight} ${orderFeedOptions(theme).font.sizePx * dpiScale}px ${orderFeedOptions(theme).font.family}`;
ctx.fillStyle = side === "Buy"
? orderFeedOptions(theme).sell.textColor
: orderFeedOptions(theme).buy.textColor;
ctx.fillText(label, startX - (width / 2) + 3 * dpiScale - (textWidth / 2), startY + (height / 2));
}
return startX - width;
},
};
export default orderFeedDrawer;
нужно переписать отрисовку на библиотеку Three.js | e11495d97dbf45909e8f11a7bf1c0eeb | {
"intermediate": 0.29930374026298523,
"beginner": 0.5225896239280701,
"expert": 0.1781066358089447
} |
20,329 | CMD mlflow ui --host 0.0.0.0 --port 5000
i have that in my docker file. i want to first moce workdir then run the cmd from there | 57149514e8876818d5f05a633f6a02f5 | {
"intermediate": 0.37598976492881775,
"beginner": 0.2451058030128479,
"expert": 0.37890443205833435
} |
20,330 | What causes this output "0. Создать архив
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index 1 out of bounds for length 1
at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266)
at java.base/java.util.Objects.checkIndex(Objects.java:359)
at java.base/java.util.ArrayList.get(ArrayList.java:427)
at Menu.run(Menu.kt:26)
at MainKt.main(Main.kt:7)
at MainKt.main(Main.kt)" when running "fun main() {
val menuLevelList = listOf("список архивов", "архив", "список заметок", "заметка")
var archiveList = Menu<Menu<*>>(menuLevelList, 0,null)
archiveList.run()
println("Програма завершена")
}" with package "import java.util.Scanner
open class Menu<E>(
val menuLevelList : List<String>,
val level : Int,
val previousElement: Menu<E>?
) {
open var contents: MutableList<Pair<String, Menu<E>?>> =
mutableListOf(
Pair("Имя элемента", null)
)//список элементов меню."0." по задумке всегда
// будет отведён в консоли на создание нового элемента. Т.к. 0 мне не нужен - этим заодно и
// индекс приравниваю к номеру опции, и инициализацую переменной делаю.
fun run() {
var command = -1 //сюда закинем номер комманды для передачи в select
while (true) { //крутим вывод опций/ввод до тех пор пока не получим рабочий ввод
if (this.menuLevelList.get(level) != this.menuLevelList.last()) {
println("0. Создать ${menuLevelList.get(this.level + 1)}")
} //если не последний элемент
// - покажем опцию пополнить список текущего меню
for (i in 1 until contents.size + 1) {
println("$i. ${contents.get(i).first}")
} //выводим все элементы текущего меню
if (this.previousElement == null) {
println("${contents.size + 1}. Завершить програму")
} else {
println("${contents.size + 1}. Назад")
}
val input: String = Scanner(System.`in`).nextLine() //всё вывели, получаем ввод
//и фильтруем его на наличие ошибок.Немного рефлексирую что не оформил в when, но мне то
// String, то Int, то Int+условие нужно, было неудобно, сдался.
if (input == "") {
println("Ошибка: пустой ввод")
continue
}
if (input.toIntOrNull() == null) {
println("Ошибка: введено не число")
continue
}
if ((input.toInt() > (contents.size + 1)) || (input.toInt() < 0)) {
println("Ошибка: команды для данного номера не существует")
continue
}
if (input.toInt() == 0 && this.menuLevelList.get(level) == this.menuLevelList.last()) {
println("Ошибка: команды для данного номера не существует")
}
command = input.toInt()
break
}
this.select(command)
}
fun select(number: Int) {
when (number) {
0 -> this.createNew()
in 1..this.contents.size -> this.contents.get(number).second!!.run()
this.contents.size + 1 -> this.back()
}
}
fun createNew() {
if (this.menuLevelList.get(level) != this.menuLevelList.last()) {
println("Ошибка: команды для данного номера не существует")
this.run()
}
var name = ""
while (true) {
println("Создаётся ${this.menuLevelList.get(level + 1)}. Введите название")
val input: String = Scanner(System.`in`).nextLine()
if (input == "") {
println("Ошибка: пустой ввод")
continue
}
name = input
break
} //крутим луп до ненулевого ввода для названия эелемента
if (this.menuLevelList.get(level+1)!=this.menuLevelList.last()){
val newElement = Menu(this.menuLevelList,level+1,this)
contents.add(Pair(name, newElement)) //если следующий элемент не последний в нашем
// списке уровней меню - он будет тоже Menu
} else {
println("Создаётся ${this.menuLevelList.get(level + 1)}. Введите содержание.")
var text = ""
while (true) {
val input: String = Scanner(System.`in`).nextLine()
if (input == "") {
println("Ошибка: пустой ввод")
continue
}
text=input
break
}} //если следующий элемент - последний, крутим луп до ненулевого ввода и делаем это
// текстом нашей заметки(в этом случае, код можно использовать для других интерфейсов тоже)
this.run()
}
fun back() {
if (previousElement != null) {
previousElement!!.run()
}
//т.к. метод не перезапускает run(), то програма завершится
}
}" | 001499ddb04813271d2f20b065528367 | {
"intermediate": 0.32386890053749084,
"beginner": 0.5268420577049255,
"expert": 0.14928893744945526
} |
20,331 | how to send Blob {size: 38805, type: 'video/webm;codecs=vp8,opus'} to a express server and convert it to video in js | 2b013050fe2defcc25ca0fbbc6a923e0 | {
"intermediate": 0.41006356477737427,
"beginner": 0.23596318066120148,
"expert": 0.3539732098579407
} |
20,332 | How would I make a script that removes the movement button and jump button on roblox? | 62aef6893d4ce4acb3374897ec73cc40 | {
"intermediate": 0.4090976119041443,
"beginner": 0.19269445538520813,
"expert": 0.39820802211761475
} |
20,333 | Write a console application for the following.
*· Scenario:
Complete the following Java program by including the definition for the function named weeklyPay that returns weekly pay.
The function has the formal parameter hours to pass the value of the number of hours worked in a week and the formal, parameter rate to pass the value of the hourly rate, the name should be passed as a third parameter, the fourth parameter of type (int, where 1=”full-time”, 2=”part-time”).
Additional specifications
*Output a dollar sign in from to each weekly pay
*Set precision to 2 decimal places
*Assume 12% FIT rate where hourly rate is less than $15, and 15% otherwise (FIT applies to taxable income) //Unit 5 Point of Clarification below
*Assume full 6.2% Social Security rate
*Assume 1.45% Medicare Rate
*If and only if a full time employee, Assume $17.00 for dental (pre-tax) //See Unit 5 Point of Clarification below
*If and only if a full time employee, Assume $77.00 employee (pre-tax) contribution toward retirement //Unit 5 Point of Clarification below
*Assume overtime pay a 2 times time's regular rate beyond 40 clockedHours for fulltime employees only
*Output to the screen the employees name IN-ALL-CAPS using the appropriate Java built-in function, weekly pay in $, and whether or not he/she is a full time or parttime employee.
//starter code
#include <iostream>
using namespace std;
double weeklyPay(double, double,string,int);// function prototype
int main( )
{
//a function call for each person - no input from the console for part 1
cout << weeklyPay (32.5, 100.25,"Tyson",1) << endl;
// re-type " or ' if necessary
return 0;
}
double weeklyPay(double hours, double rate, string name, int empType)
{// complete the function definition
double netPay = 0.0;
return netPay;
}
//make function calls "by value" for each person's paycheck.
//What is the resulting paycheck for you .... Freedom...Tyson (Dr_T)?
//The program should not accept data entry from the console at this point
Part 2 of 3: Extending code in an existing C++ file you wrote.
In your int main() function of your Unit5_Assignment_Part1_YourFirstName_YourLastName.cpp above, use the built in
tolower()function to convert and output to the screen the following text "TCC-TR IS COOL"
//hint: run the (tolower() Function through a loop for each character).
toupper()function to convert and output to the screen the following text "i will succeed at c++"
//hint: run the (toupper() Function through a loop for each character). | e36ae834d6754041527b610280f7bbd0 | {
"intermediate": 0.45762452483177185,
"beginner": 0.40275657176971436,
"expert": 0.1396189033985138
} |
20,334 | In an ECS system, can I implement a finite state machine by enablind/disabling a set of systems, and how to do so while remaining true to ECS design constraint that systems should not know about each other? | 2e6a299d8a3560baa247410cd58f5274 | {
"intermediate": 0.1741487681865692,
"beginner": 0.2486911416053772,
"expert": 0.5771600604057312
} |
20,335 | Make a Python Virtual Machine. | 76481adc0116753c8d5fa13b8c06519f | {
"intermediate": 0.3473301827907562,
"beginner": 0.15549258887767792,
"expert": 0.49717724323272705
} |
20,336 | in wxwidgets c++, how to add code when clicking the X button to close a window but not when exiting from other methods like the File -> Exit? | 06812150cbbe3e7ec5c51b24735dfb06 | {
"intermediate": 0.7317035794258118,
"beginner": 0.14673259854316711,
"expert": 0.12156375497579575
} |
20,337 | import React, { useState, useEffect } from ‘react’;
import { Stage, Graphics } from ‘react-pixi-fiber’;
const OrderFeed = ({ workerRef, symbol, settings }) => {
const cupParams = useSelector((state) => state.cupSlice);
const [dpiScale, setDpiScale] = useState(Math.ceil(window.devicePixelRatio));
const [canvasSize, setCanvasSize] = useState({ height: 0, width: 0 });
const draw = (trades, camera) => {
// implement your draw logic using react-pixi-fiber here
};
useEffect(() => {
if (!workerRef.current) return;
draw(event.data.trades, event.data.camera);
}, [workerRef.current, canvasSize, symbol, cupParams, settings]);
return (
<Stage width={canvasSize.width} height={canvasSize.height}>
{/* implement your graphics elements using react-pixi-fiber */}
</Stage>
);
};
export default OrderFeed;
const orderFeedDrawer = {
clear: (ctx, size) => {
// implement the clear logic using react-pixi-fiber here
},
drawLine: (
ctx,
canvasSize,
trades,
camera,
aggregatedPriceStep,
cupCellHeight,
quantityDivider,
minQuantity,
dpiScale,
theme
) => {
// implement the drawLine logic using react-pixi-fiber here
},
drawChain: (
ctx,
canvasSize,
trades,
camera,
aggregatedPriceStep,
cupCellHeight,
quantityDivider,
priceDivider,
minQuantity,
dpiScale,
theme,
volumeAsDollars
) => {
// implement the drawChain logic using react-pixi-fiber here
},
drawCircle: (
ctx,
price,
tradeRadius,
quantity,
side,
dpiScale,
startX,
startY,
theme,
inOneTimestamp
) => {
// implement the drawCircle logic using react-pixi-fiber here
},
drawSquare: (
ctx,
price,
tradeRadius,
quantity,
side,
dpiScale,
startX,
startY,
prevStartY,
theme
) => {
// implement the drawSquare logic using react-pixi-fiber here
},
};
export default orderFeedDrawer;
напиши мне всю логику по библиотеке react-pixi-fiber | 66311193022c1686ac0fcec26066a92c | {
"intermediate": 0.3379983603954315,
"beginner": 0.5648342370986938,
"expert": 0.09716738760471344
} |
20,338 | Provide me with a complete, working example that integrates a frontend HTML form and a Node.js backend server for a Radiology Resident Quiz Platform. The HTML form should have dropdown options for 'Board', 'Question Type', 'Difficulty Level', and 'Number of Questions'. It should also include a text area for user input up to 500 words. Upon clicking a 'Generate Quiz' button, the frontend should send a request to the Node.js backend, which in turn should make an API call to OpenAI's GPT-3 to generate quiz questions based on the user's choices and additional text input. Include all HTML, CSS, and JavaScript files, as well as server-side Node.js code. Make sure the backend code securely handles OpenAI API calls and returns the generated text to the frontend. Provide step-by-step instructions for setting up and running this complete system | 986995321dcd31eb14bcf1b118cf4d72 | {
"intermediate": 0.43744710087776184,
"beginner": 0.27106648683547974,
"expert": 0.2914864122867584
} |
20,339 | I need a way to define open var contents in such a way that it can work as both MutableList<Pair<String, Menu<E>?>> and MutableList<Pair<String,String?>> | c8e7ccce56d6dbbb2ab202f7b770188d | {
"intermediate": 0.4296889901161194,
"beginner": 0.4062851369380951,
"expert": 0.16402587294578552
} |
20,340 | help me optimize the following react typescript code
/* eslint-disable dot-notation */
/* eslint-disable no-restricted-globals */
/* eslint-disable sort-keys */
/* eslint-disable react/jsx-no-bind */
/* eslint-disable max-len */
/* eslint-disable func-names */
/* eslint-disable react/function-component-definition */
/* eslint-disable react/jsx-no-undef */
import Skeleton from 'antd/lib/skeleton';
import { t } from 'i18next';
import React, {
useEffect,
useState,
} from 'react';
import {
Form, Input, Radio, RadioChangeEvent,
} from 'antd';
import { useAccount, useMsal } from '@azure/msal-react';
import { ExclamationCircleFilled } from '@ant-design/icons';
import '../../../styles/Restrictions.css';
import ModalCustom from '../../Modal/Modal';
import { MPLMoliendaIBP } from '../../../../domain/models/PLMoliendaIBP';
import PLMoliendaIBPService from '../../../../domain/services/PLMoliendaIBPService';
interface MoliendaInterface {
month: number,
errorMessage:() => void,
saveMessage:() => void,
setSavedMolienda: (b: boolean) => void,
setVisibleMolienda: (b: boolean) => void,
visibleMolienda: boolean
}
const ModalMolienda: React.FC<MoliendaInterface> = ({
month, errorMessage, saveMessage,
setSavedMolienda, setVisibleMolienda, visibleMolienda,
}) => {
const [ saving, setSaving ] = useState(false);
const [ isLoading, setIsLoading ] = useState(true);
const { accounts } = useMsal();
const [ form ] = Form.useForm();
const userAccountInfo = useAccount(accounts[0]);
const radioElements = [ 'High season', 'No demand' ];
const [ moliendaIBP, setMoliendaIBP ] = useState<MPLMoliendaIBP>();
const [ radioDefaultValue, setRadioDefaultValue ] = useState('High season');
const [ validateDesireGrind, setvalidateDesireGrind ] = useState(false);
const [ disableDesiredGrind, setDisableDesiredGrind ] = useState(true);
const handleSaveResponse = (response: any, onSuccess: () => void, onError: () => void) => {
if (response?.success) {
setSavedMolienda(true);
onSuccess();
} else {
onError();
}
};
const cleanMoliendaIBP = () => {
setVisibleMolienda(false);
setMoliendaIBP(undefined);
form.resetFields();
};
const onFetch = async (): Promise<void> => {
try {
const moliendaService = new PLMoliendaIBPService();
const response = await moliendaService.GetMoliendaIBP();
if (response.data) {
const data = (response.data as MPLMoliendaIBP);
setMoliendaIBP(data);
}
setIsLoading(false);
} catch (e) {
setVisibleMolienda(false);
errorMessage();
}
};
useEffect(() => {
if (moliendaIBP === undefined) {
onFetch();
}
}, []);
const handleSubmit = async values => {
// pattern: '^([-]?[1-9][0-9]*|0)$',
try {
setSaving(true);
const formData: MPLMoliendaIBP = {
calculationName: values.calculationName,
desiredTotalGrind: parseFloat(values.desiredTotalGrind),
tempSoyGrind: parseFloat(values.tempSoyGrind),
correctedGrindFactor: parseFloat(values.correctedGrindFactor),
scheduledSDT: parseFloat(values.scheduledSDT),
season: values.SeasonElement,
month,
};
const moliendaIBPService = new PLMoliendaIBPService();
formData.user = userAccountInfo?.username || '';
const response = await moliendaIBPService.SaveMoliendaIBP(formData);
handleSaveResponse(response, () => {
cleanMoliendaIBP();
saveMessage();
}, errorMessage);
} catch (e) {
errorMessage();
}
setSaving(false);
};
const handleRadioOnChange = (e: RadioChangeEvent) => {
setRadioDefaultValue(e.target.value);
if (e.target.value === 'High season') {
setvalidateDesireGrind(false);
return setDisableDesiredGrind(true);
}
setvalidateDesireGrind(true);
return setDisableDesiredGrind(false);
};
return (
<ModalCustom
className="profitModal"
onCancel={() => cleanMoliendaIBP()}
onOk={form.submit}
saving={saving}
title="Molienda IBP"
visible={visibleMolienda}
>
{ isLoading
? <Skeleton loading paragraph={{ rows: 7 }} style={{ width: '450px' }} />
: (
<div className="container">
<Form
form={form}
layout="vertical"
name="dynamic_rule"
onFinish={handleSubmit}
>
<Form.Item
className="itemInputs"
label="Nombre del calculo"
name="calculationName"
rules={[
{
required: true,
whitespace: true,
},
]}
>
<div className="input-with-placeholders">
<Input
className="itemInputs"
maxLength={30}
/>
<div className="right-placeholder">
{form.getFieldError('calculationName').length > 0
&& <ExclamationCircleFilled style={{ color: '#CD0D15', fontSize: '19px' }} />}
</div>
</div>
</Form.Item>
<Form.Item
initialValue={radioDefaultValue}
label=""
name="SeasonElement"
rules={[ { required: true } ]}
>
<Radio.Group onChange={handleRadioOnChange}>
{radioElements.map(option => (
<Radio key={option} value={option}>
{option}
</Radio>
))}
</Radio.Group>
</Form.Item>
<div className="group-container">
<div className="group-inputs">
<Form.Item
className="itemInputs"
label="Molienda Total Deseada"
name="desiredTotalGrind"
rules={[
{
required: true,
},
() => ({
validator(_, value) {
if (validateDesireGrind) {
console.log('tengo que validar');
}
return Promise.resolve();
},
}),
]}
>
<div className="input-with-placeholders">
<Input
className="itemInputs"
disabled={disableDesiredGrind}
maxLength={8}
/>
<div className={disableDesiredGrind ? 'right-placeholder-disabled' : 'right-placeholder'}>
MT/Mes
</div>
</div>
</Form.Item>
<Form.Item
className="itemInputs"
label="Molienda Soja Temporal"
name="tempSoyGrind"
rules={[
{
required: true,
whitespace: true,
},
() => ({
validator(_, value) {
if (isNaN(value) && value) {
return Promise.reject(new Error('Please input a valid number'));
}
if (value > 100 || value < 0) {
return Promise.reject(new Error(`${t('Modal.Range_Between')} 0 ${t('Modal.To')} 100`));
}
return Promise.resolve();
},
}),
]}
>
<div className="input-with-placeholders">
<Input
className="itemInputs"
maxLength={8}
/>
<div className="right-placeholder">
{form.getFieldError('tempSoyGrind').length > 0
? <ExclamationCircleFilled style={{ color: '#CD0D15', fontSize: '19px' }} />
: '%'}
</div>
</div>
</Form.Item>
</div>
</div>
<div className="group-container">
<div className="group-inputs">
<Form.Item
className="itemInputs"
label="Factor molienda corregid"
name="correctedGrindFactor"
rules={[
{
required: true,
},
() => ({
validator(_, value) {
if (isNaN(value) && value) {
return Promise.reject(new Error('Please input a valid number'));
}
if (value > 1.2 || value < 0.9) {
return Promise.reject(new Error(`${t('Modal.Range_Between')} 0.9 ${t('Modal.To')} 1.2`));
}
return Promise.resolve();
},
}),
]}
>
<div className="input-with-placeholders">
<Input
className="itemInputs"
maxLength={8}
/>
<div className="right-placeholder">
{form.getFieldError('correctedGrindFactor').length > 0
? <ExclamationCircleFilled style={{ color: '#CD0D15', fontSize: '19px' }} />
: '$/GJ'}
</div>
</div>
</Form.Item>
<Form.Item
className="itemInputs"
label="SDT Programadas"
name="scheduledSDT"
rules={[
{
required: true,
whitespace: true,
},
() => ({
validator(_, value) {
if (isNaN(value) && value) {
return Promise.reject(new Error('Please input a valid number'));
}
if (value > 744 || value < 0) {
return Promise.reject(new Error(`${t('Modal.Range_Between')} 0 ${t('Modal.To')} 744`));
}
return Promise.resolve();
},
}),
]}
>
<div className="input-with-placeholders">
<Input
className="itemInputs"
maxLength={8}
/>
<div className="right-placeholder">
{form.getFieldError('scheduledSDT').length > 0
? <ExclamationCircleFilled style={{ color: '#CD0D15', fontSize: '19px' }} />
: 'h'}
</div>
</div>
</Form.Item>
</div>
</div>
</Form>
</div>
)}
</ModalCustom>
);
};
export default ModalMolienda; | ff88819e5db81fbdff6342ea37f1e085 | {
"intermediate": 0.3786810636520386,
"beginner": 0.2974410355091095,
"expert": 0.3238779604434967
} |
20,341 | Write a python function that prints the first N numbers in the fibonacci sequence using a loop | f2baf109328cf982d444ea92519986ef | {
"intermediate": 0.11798077821731567,
"beginner": 0.7297323942184448,
"expert": 0.15228678286075592
} |
20,342 | I want to create a professional HTML template in English and the colors are white and purple | 6e07e7ab66214a1d0794db8abe7fc900 | {
"intermediate": 0.402474045753479,
"beginner": 0.254351943731308,
"expert": 0.3431740403175354
} |
20,343 | hey I wanna make fastapi server that reads and sends data from xlsx file | 904b17fbd9c79cb15dc92fd484912cb4 | {
"intermediate": 0.5800555944442749,
"beginner": 0.1324867606163025,
"expert": 0.28745773434638977
} |
20,344 | create a simple table on redshift | ca7f1f79985322c047e5e0b05dd5137a | {
"intermediate": 0.4229479134082794,
"beginner": 0.23725910484790802,
"expert": 0.33979299664497375
} |
20,345 | hey I wanna make fastapi server that reads and sends data from xlsx file | bbafada977bf355d2923335edeba425f | {
"intermediate": 0.5800555944442749,
"beginner": 0.1324867606163025,
"expert": 0.28745773434638977
} |
20,346 | Is it possible to write a python code that detects Crutch Words in a text file
and highlights them by placing a "[{(CRUTCH)}]" suffix before them in an output file? | 73c2a4c1ae381902cb184b29f9583a5a | {
"intermediate": 0.3659614622592926,
"beginner": 0.057688768953084946,
"expert": 0.5763497948646545
} |
20,347 | how do I clear temp folders and cache in wine | 0a6f5b961fba466dd732503676a5422f | {
"intermediate": 0.5733572840690613,
"beginner": 0.23495207726955414,
"expert": 0.1916905790567398
} |
20,348 | Is it possible to write a python code that detects Interjections in a text file
and highlights them by placing a "[{(Interjection)}]" suffix before them in an output file? | 59f7936966702304130a97031d2ea98a | {
"intermediate": 0.415847510099411,
"beginner": 0.049524977803230286,
"expert": 0.5346274971961975
} |
20,349 | How can I organize movies by duration in an array using C++? | 4eb3b4f3ac0610ed4b68b6a154fe9067 | {
"intermediate": 0.4930150806903839,
"beginner": 0.20686382055282593,
"expert": 0.30012112855911255
} |
20,350 | pick 6 winning number betweein 1-54 | d97b0a84d7565d828ae83a7e21895b00 | {
"intermediate": 0.37127166986465454,
"beginner": 0.3481646478176117,
"expert": 0.28056371212005615
} |
20,351 | #include <iostream>
#include <string>
using namespace std;
int main()
{
string genres[5]{"horror", "comedy", "action","romance"};
for(int i=0;i<=5;i++){
cout<<genres[i];
}
return 0;
} | a26bab5d0d298c84c020a566906b7a96 | {
"intermediate": 0.3203328251838684,
"beginner": 0.4384991228580475,
"expert": 0.2411680817604065
} |
20,352 | How can I organize data using arrays in C++ when sections have their own sections? | c642ed3229340c974c000585c365659d | {
"intermediate": 0.6364631652832031,
"beginner": 0.14227905869483948,
"expert": 0.2212577760219574
} |
20,353 | Please write a sql. We have a table with one column means (scores). We get a score from input means "my_score". We need show 11 records in table. 5 higher ranks from "my_score" and "my_score" and 5 lower ranks from "my_score" with rank number. | 9562adfad4e3730400c9a64de946b7e2 | {
"intermediate": 0.39603763818740845,
"beginner": 0.21867652237415314,
"expert": 0.3852858245372772
} |
20,354 | write code for a social media app that allows you to share one sports bet a day with your friends and the world | f35c5806d58922ec736c4fa3c32d4e34 | {
"intermediate": 0.22578240931034088,
"beginner": 0.20984415709972382,
"expert": 0.5643734335899353
} |
20,355 | We need a sql code for MySQL 5.7, Assuming the table name is “roc_scores”, first column name is “score_value” and another column is "code_user ", and the input score is stored in a variable called “my_score”, write a sql that display 11 records, including the 5 higher ranks and 5 lower ranks close “my_score” with their respective rank numbers and username. we have another table means “roc_users” with two columns means “code” (equal "code_user " columns key in “roc_scores” table) and “username”. | d3fd7a3d1288b3d88b9073fbcc2f0c88 | {
"intermediate": 0.4420929551124573,
"beginner": 0.2485034018754959,
"expert": 0.3094036281108856
} |
20,356 | hi | 375136522d8f487175b3dac129003978 | {
"intermediate": 0.3246487081050873,
"beginner": 0.27135494351387024,
"expert": 0.40399640798568726
} |
20,357 | Assuming the table name is “roc_scores”, first column name is “score_value” and another is "code_user ", and the input score is stored in a variable called “my_score”, write a sql that display 11 records, including the 5 higher ranks from “my_score” and 5 lower ranks from “my_score” with their respective rank numbers and username. we have another table means “roc_users” with two columns means “code” (equal "code_user " columns key in “roc_scores” table) and “username”. sql in MYSQL 5.7 | 21d2166e3b245b80ee1496a5d874f410 | {
"intermediate": 0.4229812026023865,
"beginner": 0.24790893495082855,
"expert": 0.32910987734794617
} |
20,358 | a sql code for MYSQL 5.7 version. a table with two columns (ID, score). sort the list order by score desc. we have a variable my_score. show 5 records above and 5 records below of my_score value. | daaf28c6266f065650ef19259d3a02b5 | {
"intermediate": 0.4353763461112976,
"beginner": 0.23960772156715393,
"expert": 0.3250159025192261
} |
20,359 | a sql code for MYSQL 5.7 version. a table with two columns (code, score_value). sort the list order by score. we have a variable my_score. show 5 records close my_score from high and 5 records below of my_score from below in list. | 35704aebb8d31a7f74af4195e3b02b2a | {
"intermediate": 0.41607943177223206,
"beginner": 0.25218164920806885,
"expert": 0.3317388892173767
} |
20,360 | make somthing similar to the follwing but instead of weapon change to vechile and have create class, 3 primitive type field, 1 reference type feild (string is ok),2 constructor (simple is ok), 2 getter methods (simple one), 2 setter method (simple one): | c200f655a012aad47c6e89832c669c33 | {
"intermediate": 0.31187519431114197,
"beginner": 0.5163397192955017,
"expert": 0.17178502678871155
} |
20,361 | I got a shader in which there is a parameter ranging from 0 to 1, and it will change an object's color from yellow to blue while changing the parameter from 0 to 1. Can you write a code in Unity C# that can change this parameter from 0 to 1 for a given time? | e3769a2157dde6a6ad81e74bb2a3747c | {
"intermediate": 0.6184934973716736,
"beginner": 0.1712750941514969,
"expert": 0.21023137867450714
} |
20,362 | how is try and except different from if and else? | be610800bb895e1c43261e8883c4c52d | {
"intermediate": 0.24353596568107605,
"beginner": 0.49163445830345154,
"expert": 0.2648295760154724
} |
20,363 | what does Exception as e mean. Also, why when I input a letter do I get a ValueError, but the the exception message does not print.
def calculation(number):
try:
result = number / (number - 5)
print (f"Result: {result}")
except Exception as e:
print("An error occurred during calculation.")
user = float(input("Enter a number: "))
calculation(user) | 55c664f1a450db0c9621d7decb4230e1 | {
"intermediate": 0.3680216670036316,
"beginner": 0.5003953576087952,
"expert": 0.13158300518989563
} |
20,364 | Please explain the following R code: #Oline Statistic
library(tidyverse)
line2015 <- read.csv('2015 Basic Line Stats offense.csv')
line2016 <- read.csv('2016 Basic Line Stats offense.csv')
line2017 <- read.csv('2017 Basic Line Stats offense.csv')
line2018 <- read.csv('2018 Basic Line Stats offense.csv')
line2019 <- read.csv('2019 Basic Line Stats offense.csv')
line2020 <- read.csv('2020 Basic Line Stats offense (1).csv')
line2015 <- line2015 %>%
mutate(Year = '2015') %>%
filter(Adjusted.Line.Yards >= 3.27)
line2016 <- line2016 %>%
mutate(Year = '2016') %>%
filter(Adjusted.Line.Yards >= 3.27)
line2017 <- line2017 %>%
mutate(Year = '2017')%>%
filter(Adjusted.Line.Yards >= 3.27)
line2018 <- line2018 %>%
mutate(Year = '2018')%>%
filter(Adjusted.Line.Yards >= 3.27)
line2019 <- line2019 %>%
mutate(Year = '2019')%>%
filter(Adjusted.Line.Yards >= 3.27)
line2020 <- line2020 %>%
mutate(Year = '2020')%>%
filter(Adjusted.Line.Yards >= 3.27)
together1 <- inner_join(line2015, line2016, by = 'Team')
together2 <- inner_join(line2016, line2017, by = 'Team')
together3 <- inner_join(line2017, line2018, by = 'Team')
together4 <- inner_join(line2018, line2019, by = 'Team')
together5 <- inner_join(line2019, line2020, by = 'Team')
c <- ggplot() +
geom_point(data = together1, aes(x = Running.Back.Yards.x, y = Running.Back.Yards.y), color = 'royalblue1', size = 2.5)+
geom_point(data = together2, aes(x = Running.Back.Yards.x, y = Running.Back.Yards.y), color = 'royalblue2', size = 2.5)+
geom_point(data = together3, aes(x = Running.Back.Yards.x, y = Running.Back.Yards.y), color = 'royalblue3', size = 2.5)+
geom_point(data = together4, aes(x = Running.Back.Yards.x, y = Running.Back.Yards.y), color = 'royalblue4', size = 2.5)+
geom_point(data = together5, aes(x = Running.Back.Yards.x, y = Running.Back.Yards.y), color = 'navy', size = 2.5)
# c <- c + grids(linetype = "dashed")
# a <- a + xlim(0, 350)
# a <- a + ylim(0, 400)
c <- c + ggtitle("Running Back Rushing Att. From One Year To The Next") +
xlab("Year One Rushing Att.") + ylab("Year Two Rushing Att.")
c
pg <- ggplot_build(c)
pg
df <- rbind(pg$data[[1]], pg$data[[2]], pg$data[[3]], pg$data[[4]], pg$data[[5]])
df
cor(df[['x']], df[['y']])
#GOOD
##################################################################CORRELATATION BETWEEN OLINE AND FANTASY PERFORMANCE
# GEOM POINT NEEDS:
# 1 DATA THAT HAS: Team specific, Year Specific OLINE Data + Fantasy Points of the RB from that team + that year
# Line15 has Team specific, year specific OLINE data, need to combine that with
year15 <- read.csv('2015teamstat.csv')
year16 <- read.csv('2016teamstat.csv')
year17 <- read.csv('2017teamstat.csv')
year18 <- read.csv('2018teamstat.csv')
year19 <- read.csv('2019teamstat.csv')
year20 <- read.csv('new2020data.csv')
line2015 <- read.csv('2015 Basic Line Stats offense.csv')
line2016 <- read.csv('2016 Basic Line Stats offense.csv')
line2017 <- read.csv('2017 Basic Line Stats offense.csv')
line2018 <- read.csv('2018 Basic Line Stats offense.csv')
line2019 <- read.csv('2019 Basic Line Stats offense.csv')
line2020 <- read.csv('2020 Basic Line Stats offense (1).csv')
line2015 <- line2015 %>%
mutate(Year = '2015') %>%
arrange(Team) %>%
mutate(Number = row_number())
line2016 <- line2016 %>%
mutate(Year = '2016')%>%
arrange(Team) %>%
mutate(Number = row_number())
line2017 <- line2017 %>%
mutate(Year = '2017')%>%
arrange(Team) %>%
mutate(Number = row_number())
line2018 <- line2018 %>%
mutate(Year = '2018')%>%
arrange(Team) %>%
mutate(Number = row_number())
line2019 <- line2019 %>%
mutate(Year = '2019')%>%
arrange(Team) %>%
mutate(Number = row_number())
line2020 <- line2020 %>%
mutate(Year = '2020')%>%
arrange(Team) %>%
mutate(Number = row_number())
year15 <- year15 %>%
select(-Number)%>%
filter(!is.na(PTS))
year16 <- year16 %>%
select(-X)%>%
filter(!is.na(PTS))
year17 <- year17 %>%
select(-X) %>%
select(-X.1) %>%
filter(!is.na(PTS))
year18 <- year18 %>%
select(-X) %>%
select(-X.1) %>%
filter(!is.na(PTS))
year19 <- year19 %>%
select(-X) %>%
select(-X.1) %>%
filter(!is.na(PTS))
year20 <- year20 %>%
select(-X)%>%
filter(!is.na(PTS))
year20$Team <- gsub('?', '', year20$Team)
#########
year15 <- year15 %>%
mutate(Year = '2015') %>%
arrange(Team) %>%
mutate(Number = row_number())
year16 <- year16 %>%
mutate(Year = '2016') %>%
arrange(Team) %>%
mutate(Number = row_number())
year17 <- year17 %>%
mutate(Year = '2017')%>%
arrange(Team) %>%
mutate(Number = row_number())
year18 <- year18 %>%
mutate(Year = '2018')%>%
arrange(Team) %>%
mutate(Number = row_number())
year19 <- year19 %>%
mutate(Year = '2019')%>%
arrange(Team) %>%
mutate(Number = row_number())
year20 <- year20 %>%
mutate(Year = '2020')%>%
arrange(Team) %>%
mutate(Number = row_number())
together1 <- inner_join(year15, line2015, by = 'Number')
together2 <- inner_join(year16, line2016, by = 'Number')
together3 <- inner_join(year17, line2017, by = 'Number')
together4 <- inner_join(year18, line2018, by = 'Number')
together5 <- inner_join(year19, line2019, by = 'Number')
together5 <- inner_join(year20, line2020, by = 'Number')
p <- ggplot() +
geom_point(data = together1, aes(x = Running.Back.Yards, y = RB), color = 'royalblue1', size = 2.5)+
geom_point(data = together2, aes(x = Running.Back.Yards, y = RB), color = 'royalblue2', size = 2.5)+
# geom_point(data = together3, aes(x = Running.Back.Yards, y = RB), color = 'royalblue3', size = 2.5)+
geom_point(data = together4, aes(x = Running.Back.Yards, y = RB), color = 'royalblue4', size = 2.5)+
geom_point(data = together5, aes(x = Running.Back.Yards, y = RB), color = 'navy', size = 2.5)
p
pg <- ggplot_build(p)
pg
df <- rbind(pg$data[[1]], pg$data[[2]], pg$data[[3]], pg$data[[4]])
df
fit <- lm(y ~ x, data = df)
fit[["coefficients"]]
p <- p + geom_abline(intercept = 69.91583 , slope = 29.06602 , color = "red")
p <- p + labs(title =
"Correlation between Running Back Fantasy Performance and Average Team Points per Game") +
xlab("Average Team Points Per Game") + ylab("Running Back Fantasy Performance")
p
cor(df[['x']], df[['y']]) | 5dbb5850b4e117434f26cbef1e139d64 | {
"intermediate": 0.4346700608730316,
"beginner": 0.3407723605632782,
"expert": 0.224557563662529
} |
20,365 | Power BI Matrix Table: I need to prioratize two rows and keep them as first two rows | 086a57a61a7a01ddc06a6524d877a44e | {
"intermediate": 0.2949815094470978,
"beginner": 0.28134411573410034,
"expert": 0.4236743748188019
} |
20,366 | 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 theme = useTheme();
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, canvasSize, symbol
]);
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 orderFeedDrawer = {
clear: (ctx: WebGLRenderingContext, size: CanvasSize) => {
ctx.clearRect(0, 0, size.width, size.height);
},
drawLine: (
ctx: WebGLRenderingContext,
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 = (dpiScale) => 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();
},
у меня в проекте идет отрисовка через canvasRef.current?.getContext("2d"); CanvasRenderingContext2D, нужно сделать отрисовку более производительнее на WebGL.
перепиши код функцию draw и orderFeedDrawer, drawLine на библиотеку react-pixi-fiber | b62855c3234c9e0d197cbd2eb048ecd1 | {
"intermediate": 0.29614800214767456,
"beginner": 0.5092771053314209,
"expert": 0.19457483291625977
} |
20,367 | Hİ. I will give you the instructions. write a code in python that prints these:1 bayt = 8 bit.
1 Kb = 1024 bayt = 8192 bit.
1 Mb = 1024 Kb = 1048576 bayt = 8388608 bit.
1 Gb = 1024 Mb = 1048576 Kb = 1073741824 bayt = 8589934592 bit.
1 Tb = 1024 Gb = 1048576 Mb = 1073741824 Kb = 1099511627776 bayt = 8796093022208 bit. | 8a6541fb4f9ab79136488543de5043c6 | {
"intermediate": 0.4406534433364868,
"beginner": 0.2674344778060913,
"expert": 0.2919120788574219
} |
20,368 | import {Application} from "pixi.js";
const canvasRefPixi = useRef<PIXI.Application | null>(null);
const draw = (trades: TradeItem[], camera: number) => {
if (null === canvasRefPixi || !Array.isArray(trades)) return;
const app = canvasRefPixi.current;
if (app) {
const stage = app.stage;
orderFeedDrawer.drawLinePixi(
stage,
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>
<Application
view={canvasRefPixi.current?.view}
className={styles.canvas}
width={canvasSize?.width}
height={canvasSize?.height}
>
<Container />
</Application>
</Box>
);
};
// <Application
view={canvasRefPixi.current?.view}
className={styles.canvas}
width={canvasSize?.width}
height={canvasSize?.height}
> // JSX element class does not support attributes because it does not have a 'props' property.ts(2607)
'Application' cannot be used as a JSX component.
Its instance type 'Application<ICanvas>' is not a valid JSX element.
Type 'Application<ICanvas>' is missing the following properties from type 'ElementClass': context, setState, forceUpdate, props, and 2 more.ts(2786)
(alias) class Application<VIEW extends ICanvas = ICanvas>
import Application
Convenience class to create a new PixiJS application.
This class automatically creates the renderer, ticker and root container.
@example
import { Application, Sprite } from 'pixi.js';
// Create the application
const app = new Application();
// Add the view to the DOM
document.body.appendChild(app.view);
// ex, add display objects
app.stage.addChild(Sprite.from('something.png'));
исправь ошибку | a80f0d3e8e6da7ede8a6253e7b7f24c4 | {
"intermediate": 0.40886396169662476,
"beginner": 0.37160080671310425,
"expert": 0.21953518688678741
} |
20,369 | Is the order of local to remote paths the same between scp and sftp (on Debian GNU/Linux)? Be concise. | 1221a15e3aae65c6268798dc028d22a2 | {
"intermediate": 0.3981897532939911,
"beginner": 0.2738448679447174,
"expert": 0.3279654383659363
} |
20,370 | Customer_SKU_Date =
VAR add_table = GENERATE(
SUMMARIZE(Customer_SKU_Share_Month,
Customer_SKU_Share_Month[Customer Code],
Customer_SKU_Share_Month[SCU Code],
Customer_SKU_Share_Month[StartDate],
Customer_SKU_Share_Month[EndDate]),
VAR StartDate = Customer_SKU_Share_Month[StartDate]
VAR EndDate = Customer_SKU_Share_Month[EndDate]
RETURN
ADDCOLUMNS(
CALENDAR(StartDate, EndDate),
"Customer", Customer_SKU_Share_Month[Customer Code],
"SKU", Customer_SKU_Share_Month[SCU Code]
)
)
RETURN SUMMARIZE(add_table,[Customer],[SKU],[Date])
I neede to add a filter that Customer_SKU_Share_Month[Type] = X to create the table only for those rows. How to modify that? | 3a07a01e048c4cbf8bf9dba31b4ab479 | {
"intermediate": 0.35280027985572815,
"beginner": 0.3651336431503296,
"expert": 0.2820660471916199
} |
20,371 | Как запустит скрипт для просмотра файла?
У меня есть файл trackinfo.py
#/usr/bin/python
import sys, datetime
def read_lines(file_name):
lines = []
with open(file_name, 'rt') as f:
lines = f.read().split('\n')
return [line.split('|') for line in lines]
def filtered_dates(lines, probe_func):
parse_time = lambda t: datetime.datetime.strptime(t, '%Y-%m-%dT%H:%M:%S.%f')
return [parse_time(line[0].strip()) for line in lines if probe_func(line)]
def calc_deltas(dates):
return [dates[i] - dates[i-1] for i in range(1, len(dates))]
def print_track_stats(file_name, probe_col, probe_string):
lines = read_lines(file_name)
dates = filtered_dates(lines, lambda l: len(l) > probe_col and probe_string in l[probe_col])
deltas = calc_deltas(dates)
print(f'Начало записи трека: {dates[0]}')
print(f'Окончание записи трека: {dates[-1]}')
print(f'Общее время записи трека: {dates[-1] - dates[0]}')
print(f'Количество записаных точек: {len(dates)}')
print(f'Максимальный промежуток между записью точек: {max(deltas)}')
print(f'Минимальный промежуток между записью точек: {min(deltas)}')
print(f'В среднем между записями точек: {sum(deltas, datetime.timedelta()) / len(deltas)}')
if (len(sys.argv) > 3):
print_track_stats(sys.argv[1], int(sys.argv[2]), sys.argv[3])
else:
print('Invalid arguments')
Мне нужно прочитат данные файла
STMobile-230919.log | fa2fb2a2528bd612954cb36a5bc9dfc7 | {
"intermediate": 0.3209400177001953,
"beginner": 0.479606032371521,
"expert": 0.1994539201259613
} |
20,372 | 请你扮演一位C++开发大神,请根据一下错误信息进行推断出问题原因,错误信息如下:*** Aborted at 1695195072 (Unix time, try 'date -d @1695195072') ***
terminate called recursively
*** Signal 6 (SIGABRT) (0x1c1c3) received by PID 115139 (pthread TID 0x7fde295ff700) (linux TID 115173) (maybe from PID 115139, UID 0) (code: -6), stack trace: ***
terminate called recursively
terminate called recursively
terminate called recursively
terminate called recursively
terminate called recursively
/usr/local/nebula/bin/nebula-storaged(_ZN5folly10symbolizer17getStackTraceSafeEPmm+0x31)[0x26fd4b1]
/usr/local/nebula/bin/nebula-storaged(_ZN5folly10symbolizer21SafeStackTracePrinter15printStackTraceEb+0x26)[0x26f49b6]
/usr/local/nebula/bin/nebula-storaged[0x26f2947]
/lib64/libpthread.so.0(+0xf62f)[0x7fde3c18462f]
/lib64/libc.so.6(gsignal+0x37)[0x7fde3bddd387]
/lib64/libc.so.6(abort+0x147)[0x7fde3bddea77]
/usr/local/nebula/bin/nebula-storaged[0x116da56]
/usr/local/nebula/bin/nebula-storaged(_ZN10__cxxabiv111__terminateEPFvvE+0x5)[0x2bea8c5]
/usr/local/nebula/bin/nebula-storaged(__cxa_call_terminate+0x38)[0x2c869d8]
/usr/local/nebula/bin/nebula-storaged(__gxx_personality_v0+0x263)[0x2bea2f3]
/usr/local/nebula/bin/nebula-storaged[0x2c8d39a]
/usr/local/nebula/bin/nebula-storaged[0x2c8da2f]
/usr/local/nebula/bin/nebula-storaged(__cxa_throw+0x36)[0x2beaa76]
/usr/local/nebula/bin/nebula-storaged[0x10ac2de]
/usr/local/nebula/bin/nebula-storaged(_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_mutateEmmPKcm+0x5c)[0x2c65d1c]
/usr/local/nebula/bin/nebula-storaged(_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_appendEPKcm+0x6a)[0x2c6732a]
/usr/local/nebula/bin/nebula-storaged(_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEOS8_PKS5_+0x36)[0x1bd0156]
/usr/local/nebula/bin/nebula-storaged[0x1158160]
/usr/local/nebula/bin/nebula-storaged(_ZN5folly11AsyncSocket7ioReadyEt+0xd9)[0x2687f29]
/usr/local/nebula/bin/nebula-storaged[0x27635f4]
/usr/local/nebula/bin/nebula-storaged(event_base_loop+0x36e)[0x2763c5e]
/usr/local/nebula/bin/nebula-storaged(_ZN5folly9EventBase8loopBodyEib+0x46d)[0x26a1ccd]
/usr/local/nebula/bin/nebula-storaged(_ZN5folly9EventBase4loopEv+0x3d)[0x26a25bd]
/usr/local/nebula/bin/nebula-storaged(_ZN5folly9EventBase11loopForeverEv+0x17)[0x26a51f7]
/usr/local/nebula/bin/nebula-storaged(_ZN5folly20IOThreadPoolExecutor9threadRunESt10shared_ptrINS_18ThreadPoolExecutor6ThreadEE+0x338)[0x262f3c8]
/usr/local/nebula/bin/nebula-storaged(_ZN5folly6detail8function14FunctionTraitsIFvvEE7callBigISt5_BindIFMNS_18ThreadPoolExecutorEFvSt10shared_ptrINS7_6ThreadEEEPS7_SA_EEEEvRNS1_4DataE+0x46)[0x263d936]
/usr/local/nebula/bin/nebula-storaged[0x2c685ef]
/lib64/libpthread.so.0(+0x7ea4)[0x7fde3c17cea4]
/lib64/libc.so.6(clone+0x6c)[0x7fde3bea5b0c]
(safe mode, symbolizer not available)
*** Aborted at 1695195073 (Unix time, try 'date -d @1695195073') *** | b6a4222c9bc619aad29d1e6fe4eb752f | {
"intermediate": 0.29272592067718506,
"beginner": 0.3520742952823639,
"expert": 0.35519981384277344
} |
20,373 | how to generate a time+location based uuid with fasterxml uuid | ebe3555375ab7d928f345a284a69482a | {
"intermediate": 0.2169247418642044,
"beginner": 0.13229772448539734,
"expert": 0.6507775187492371
} |
20,374 | Make concise instructions for how to use sftp to send a directory or file from a local system to a remote one (on Debian GNU/Linux). | 93c301b00ae4d20868b74e5bf980b720 | {
"intermediate": 0.44504693150520325,
"beginner": 0.2048831433057785,
"expert": 0.35006994009017944
} |
20,375 | export interface SettingsPreponderances {
disbalance: number;
disbalanceAssets: {[key: string]: number|null};
}
const Preponderances = () => {
const [settings, setSettings] = useState<SettingsPreponderances>({
disbalance: +(window.localStorage.getItem("preponderances-disbalance") || 0),
disbalanceAssets: JSON.parse(window.localStorage.getItem("preponderances-disbalance-assets") || "{}"),
});
useEffect(() => {
localStorage.setItem("preponderances-disbalance", settings.disbalance.toString());
localStorage.setItem("preponderances-disbalance-assets", JSON.stringify(settings.disbalanceAssets));
workerRef.current?.postMessage(JSON.stringify({
type: "update_settings_disbalance",
disbalance: settings.disbalance,
disbalanceAssets: settings.disbalanceAssets,
}));
}, [settings]);
useEffect(() => {
setSettings(prevSettings => ({
...prevSettings,
disbalance: +(window.localStorage.getItem("preponderances-disbalance") || 0),
disbalanceAssets: JSON.parse(window.localStorage.getItem("preponderances-disbalance-assets") || "{}"),
}));
}, []);
return
<Box
>
<SettingsPopupTableColumns
settings={{
quantity: settings.disbalance,
quantityAssets: settings.disbalanceAssets,
}}
setSettings={(value: SettingsTableColumns) => setSettings((prev: SettingsPreponderances) => ({
disbalance: value.quantity,
disbalanceAssets: value.quantityAssets,
}))}
showSettings={showSettings}
setShowSettings={setShowSettings}
title="Настройки минимального соотношения"
generalSelectTitle="Общее соотношение"
selectTitle="Соотношение по монете"
/>
</Box>;
};
export default Preponderances;
SettingsPopupTableColumns вызывается много раз, постоянно, почему? в чем тут ошибка? | 910ef498e0c2471ebe2f8bbfa0bc8e45 | {
"intermediate": 0.4116078317165375,
"beginner": 0.332650363445282,
"expert": 0.25574183464050293
} |
20,376 | I need C Console program which can not starting without password entering (strcmp using) | 609344e80ec065a6fc4bdfc2f5ddfd25 | {
"intermediate": 0.43988674879074097,
"beginner": 0.27777743339538574,
"expert": 0.2823358476161957
} |
20,377 | как использовать clickhouse_connect в python multiprocessing | 07111d474015afd122f5aa0e37ebdd79 | {
"intermediate": 0.2780091464519501,
"beginner": 0.1986139863729477,
"expert": 0.5233768820762634
} |
20,378 | wygeneruj artykuł do medium.com dostosowując go do tego kodu, co wyżej oraz tytułu: How to Check the TPM Version and Status in PowerShell or Go
package main
import (
"flag"
"fmt"
"os/exec"
"strings"
)
var (
viewActivated bool
viewEnabled bool
viewOwned bool
viewManufacturerId bool
viewManufacturerIdTxt bool
viewManufacturerVersion bool
viewManufacturerVersionFull bool
viewManufacturerVersionInfo bool
viewPhysicalPresenceVersion bool
viewSpecVersion bool
viewPSComputerName bool
viewHelp bool
)
func init() {
flag.BoolVar(&viewActivated, "a", false, "View IsActivated_InitialValue")
flag.BoolVar(&viewEnabled, "e", false, "View IsEnabled_InitialValue")
flag.BoolVar(&viewOwned, "o", false, "View IsOwned_InitialValue")
flag.BoolVar(&viewManufacturerId, "id", false, "View ManufacturerId")
flag.BoolVar(&viewManufacturerIdTxt, "idt", false, "View ManufacturerIdTxt")
flag.BoolVar(&viewManufacturerVersion, "mv", false, "View ManufacturerVersion")
flag.BoolVar(&viewManufacturerVersionFull, "mvf", false, "View ManufacturerVersionFull20")
flag.BoolVar(&viewManufacturerVersionInfo, "mvi", false, "View ManufacturerVersionInfo")
flag.BoolVar(&viewPhysicalPresenceVersion, "ppvi", false, "View PhysicalPresenceVersionInfo")
flag.BoolVar(&viewSpecVersion, "sv", false, "View SpecVersion")
flag.BoolVar(&viewPSComputerName, "psc", false, "View PSComputerName")
flag.BoolVar(&viewHelp, "h", false, "View help screen")
flag.Parse()
}
func main() {
if viewHelp {
printHelp()
return
}
cmd := exec.Command("powershell", "-Command", "$tpm = Get-WmiObject -Namespace \"Root\\CIMv2\\Security\\MicrosoftTpm\" -Class Win32_Tpm; Write-Host \"SpecVersion: $($tpm.SpecVersion)\"; Write-Host \"ManufacturerID: $($tpm.ManufacturerID)\"")
output, err := cmd.Output()
if err != nil {
fmt.Println("Błąd podczas wykonania polecenia PowerShell:", err)
return
}
info := string(output)
lines := strings.Split(info, "\n")
for _, line := range lines {
line = strings.TrimSpace(line)
printLine(line)
}
}
func printLine(line string) {
if viewSpecVersion && strings.HasPrefix(line, "SpecVersion:") {
fmt.Println(line)
}
if viewManufacturerId && strings.HasPrefix(line, "ManufacturerID:") {
fmt.Println(line)
}
if viewActivated && strings.HasPrefix(line, "IsActivated_InitialValue:") {
fmt.Println(line)
}
if viewEnabled && strings.HasPrefix(line, "IsEnabled_InitialValue:") {
fmt.Println(line)
}
if viewOwned && strings.HasPrefix(line, "IsOwned_InitialValue:") {
fmt.Println(line)
}
if viewManufacturerIdTxt && strings.HasPrefix(line, "ManufacturerIdTxt:") {
fmt.Println(line)
}
if viewManufacturerVersion && strings.HasPrefix(line, "ManufacturerVersion:") {
fmt.Println(line)
}
if viewManufacturerVersionFull && strings.HasPrefix(line, "ManufacturerVersionFull20:") {
fmt.Println(line)
}
if viewManufacturerVersionInfo && strings.HasPrefix(line, "ManufacturerVersionInfo:") {
fmt.Println(line)
}
if viewPhysicalPresenceVersion && strings.HasPrefix(line, "PhysicalPresenceVersionInfo:") {
fmt.Println(line)
}
if viewPSComputerName && strings.HasPrefix(line, "PSComputerName:") {
fmt.Println(line)
}
}
func printHelp() {
fmt.Println("cTMP Help:")
flag.PrintDefaults()
} | f1ddfde762ef91257b0b0e219f4e91dc | {
"intermediate": 0.38785186409950256,
"beginner": 0.41759738326072693,
"expert": 0.1945507526397705
} |
20,379 | Make a new column in power BI if [date] falls between [start of leave request] and [end of leave request] put a 0, otherwise put a 1 | 9834838b6b7b6ff6de56195e40a55b68 | {
"intermediate": 0.3714812099933624,
"beginner": 0.2469031661748886,
"expert": 0.38161563873291016
} |
20,380 | how to create std::vector<rapidjson::Value> that were copied from rapidjson::value members and return this vector from method on c++ | 4f397a5e6e41fffb7b6f3957d27f120a | {
"intermediate": 0.5818939805030823,
"beginner": 0.15006978809833527,
"expert": 0.26803627610206604
} |
20,381 | What virtual machine can be installed in git bash? | c12d90df82d388f8f000105a837fedfb | {
"intermediate": 0.4212628901004791,
"beginner": 0.28970855474472046,
"expert": 0.2890285849571228
} |
20,382 | package com.example.myapplication22
import android.util.DisplayMetrics
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.*
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.FavoriteBorder
import androidx.compose.material3.*
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import androidx.lifecycle.viewmodel.compose.viewModel
@Composable
fun NewsScreen(viewModel: NewsViewModel = viewModel()) {
val newsState = viewModel.newsState.collectAsState(initial = emptyList())
val newsList = newsState.value.take(2)
val newsList2 = newsState.value.drop(2)
var count = 0;
Column(){
Row(
modifier = Modifier
.padding(16.dp)
.fillMaxWidth()
) {
for (news in newsList) {
count++;
if (count > 2) continue
Column(
modifier = Modifier
.height(370.dp)
.width(165.dp)
.align(Alignment.CenterVertically)
)
{
NewsItem(news = news, onLikeClick = { viewModel.likeClick(news) })
Spacer(modifier = Modifier.height(16.dp))
}
scss
Copy code
}
}
Row(
modifier = Modifier
.width(400.dp)
.padding(18.dp)
) {
for (news in newsList2) {
count++;
if (count > 2) {
Column(
modifier = Modifier
.height(370.dp)
.width(165.dp)
.align(Alignment.CenterVertically)
)
{
NewsItem(news = news, onLikeClick = { viewModel.likeClick(news) })
Spacer(modifier = Modifier.height(16.dp))
}
}
}
}
}
}
@Composable
fun NewsItem(news: News, onLikeClick: () -> Unit) {
var liked by remember { mutableStateOf(false) }
scss
Copy code
Column(
modifier = Modifier
.fillMaxSize()
.background(Color.White)
.padding(8.dp)
) {
Text(
text = news.title,
color = Color.White,
modifier = Modifier
.background(Color.Black)
.padding(8.dp)
.fillMaxWidth()
)
Spacer(modifier = Modifier.height(8.dp))
Text(text = news.content)
Spacer(modifier = Modifier.weight(1f)) // Заполнитель, чтобы лайки были внизу
// Разместите лайки внизу
Box(
modifier = Modifier
.fillMaxWidth()
.height(48.dp)
.background(Color.Gray),
contentAlignment = Alignment.Center
) {
Row(
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.SpaceBetween,
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 16.dp)
) {
Text(
text = "${news.likes.value} Likes",
color = Color.White
)
IconButton(
onClick = {
onLikeClick()
liked = true
}
) {
Icon(
imageVector = Icons.Default.FavoriteBorder,
contentDescription = "Like",
tint = Color.Unspecified
)
}
}
}
}
}
Как в этом коде сделать так чтобы при нажатии на Icon его цвет tint менялся на красный или на обычный если на Icon уже нажимали? | d35b67fc74774eef9611b6dc7f9fe0fe | {
"intermediate": 0.30741143226623535,
"beginner": 0.4658401906490326,
"expert": 0.22674842178821564
} |
20,383 | Using mongoose show me how to find and update document by submodule | 2d4d571850a7f50e504bc9c64503d8d3 | {
"intermediate": 0.7140624523162842,
"beginner": 0.11104720085859299,
"expert": 0.17489038407802582
} |
20,384 | I have two vectors a=c(1,2) and b=c(3,4). How do I combine them in R taking first value from a, then first value from b, the second from a, second from b, and so on? SO that the resulting vector would be c=c(1,3,2,4) | 6085891558840db9a4b918085d6d9d48 | {
"intermediate": 0.3813895881175995,
"beginner": 0.16043256223201752,
"expert": 0.4581778943538666
} |
20,385 | with pupeteer and javascript fill out the stripe checkout form.
make sure to use the selector correctly as you cant type into it, it uses country codes.
card num:
input tag with id="cardNumber"
expiry:
input tag with id="cardExpiry"
cvc:
input tag with id="cardCvc"
cardholder name:
input tag with id="billingName"
country:
select tag with id="billingCountry"
pay button:
class="SubmitButton" | ecbd76caa0a1f8c21e479b86a4d9a5be | {
"intermediate": 0.4146641492843628,
"beginner": 0.2574307918548584,
"expert": 0.3279050588607788
} |
20,386 | write about the use of the Stable Diffusion neural network for video processing | 7922e95483b76e687399cef73ba59216 | {
"intermediate": 0.05572894960641861,
"beginner": 0.04687399044632912,
"expert": 0.8973970413208008
} |
20,387 | How would you install Lima through Git or PowerShell. | 8cf639756b1e64acd7c00debcba61ce0 | {
"intermediate": 0.6911999583244324,
"beginner": 0.15275490283966064,
"expert": 0.15604513883590698
} |
20,388 | Unresolved reference 'getAge' | 46688fc9fbc604dc77974b9627146166 | {
"intermediate": 0.37516218423843384,
"beginner": 0.4593847393989563,
"expert": 0.16545309126377106
} |
20,389 | from sklearn.preprocessing import LabelEncoder
encoder = LabelEncoder()
old_df = df
for col in df.columns:
if df[col].dtype.kind in 'fi':
if df[col].isnull().any():
df[col].fillna(df[col].median(), inplace = True)
else:
df[col] = encoder.fit_transform(df[col]). explain the code | 99d2e303dce34a02245f58b6e0956efb | {
"intermediate": 0.3612901568412781,
"beginner": 0.22380059957504272,
"expert": 0.4149092137813568
} |
20,390 | make a python program to view and temporarly spoof hardware serials | 4090383f12a3c4a09544bd5a1f23092f | {
"intermediate": 0.3667528033256531,
"beginner": 0.19256089627742767,
"expert": 0.44068631529808044
} |
20,391 | export interface BigOrder {
id: number;
symbol: string;
price: number;
quantity: number;
volumeAsDollars: number;
}
let isSubscribed = false;
let wsConnection: WebSocket|null = null;
let count = 0;
let symbols:string[] = [];
let bigOrdersQuantity = 300;
let bigOrders: BigOrder[] = [];
let precision: {[key: string]: Precision} = {};
let quantity: number;
let quantityAssets: {[key: string]: number|null};
const connectToWs = (callback: () => void) => {
if (wsConnection) {
callback();
return;
}
wsConnection = new WebSocket(`${process.env.NEXT_PUBLIC_RUST_WS_SERVER}`);
wsConnection.onopen = () => {
if (null !== wsConnection) {
callback();
}
};
wsConnection.onmessage = async(message: MessageEvent) => {
if (!message.data) return;
const data = JSON.parse(message.data);
if (!data?.commands || data.commands.length === 0) return;
const bigOrder = data.commands.find((item: any) => "undefined" !== typeof item.BigOrder);
const bigOrderElimination = data.commands.find((item: any) => "undefined" !== typeof item.BigOrderElimination);
if (bigOrder) {
const symbol = bigOrder.BigOrder.exchange.substring(3);
if (symbols.includes(symbol)) {
const price = bigOrder.BigOrder.price / Math.pow(10, precision[symbol].price);
const quantity = bigOrder.BigOrder.quantity / Math.pow(10, precision[symbol].quantity);
const order = {
id: count,
symbol: symbol,
price: price,
quantity: quantity,
timestamp: bigOrder.BigOrder.timestamp,
volumeAsDollars: price * quantity,
};
bigOrders.push(order);
count = count + 1;
publish();
}
}
if(bigOrderElimination) {
const price = bigOrderElimination.bigOrderElimination.price
}
};
};
нужно изменить let bigOrders: BigOrder[] = [];, сделать объектом, где ключами будут `${symbol}_${price}`
if(bigOrderElimination) { то удалять по ключу из объекта | d8d9e4790bdab05879fc581fbbabb71c | {
"intermediate": 0.30196040868759155,
"beginner": 0.5058635473251343,
"expert": 0.1921759992837906
} |
20,392 | I have this algorithm for count buy price difference between buy price and sell price :def calculate_percentage_difference_buy(entry_price, exit_price):
percentage_difference = ((exit_price - entry_price) / entry_price) * 100
return percentage_difference
But I need code for sell entry and buy exit counting besd on my algorithm:
entry_price = sell_entry_price
exit_price = buy_entry_price
entry_price - exit_price = result
entry divide to 100 = price_result # price result = 1%
after that divide entry to price_result = percent_difference
after that percent_difference multiply to 50 | 21d5103dd5ae5e398ad954b292a2bb60 | {
"intermediate": 0.3444431722164154,
"beginner": 0.25687453150749207,
"expert": 0.3986823260784149
} |
20,393 | Which data structure is best to hold two types of information, string and integer, in C++? | 65a1518edbdee7ce8412834180d38c15 | {
"intermediate": 0.5382164716720581,
"beginner": 0.20413081347942352,
"expert": 0.2576526999473572
} |
20,394 | Преобразуй элемент чтобы он создавался с помощью js
<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/jPv44ZYFyC8?si=VC8IkXJvMcUaHIG9" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe> | 90c19c9eb7bb4a5f1f40363308fec639 | {
"intermediate": 0.3124137222766876,
"beginner": 0.377964586019516,
"expert": 0.30962175130844116
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.