row_id
int64
0
48.4k
init_message
stringlengths
1
342k
conversation_hash
stringlengths
32
32
scores
dict
29,811
This must be written in Android Studio using Java Code • Design an app to store contacts information. • Main screen shows all names saved in database as a list. • One icon allows the customer to add a new contact to the database. When this icon clicked, a blank EditContact screen is displayed. • Main screen also allows searching by entering key information into the searching box. The list of contact information will be updated when information is entered into the searching box. • Use SearchView to let customer enter key information into. • Use SearchView.setOnQueryTextListener to listen the text change in search box. • By clicking an item in the contact list, another screen will display the detail information of the selected contact. • The Detail screen will display the detail information of the selected contact. Two buttons/icons at the bottom of the screen allows customer to choose to save or delete this contact information. • When save button/icon is clicked, this contact will be added/updated and back to Main screen. • When delete button/icon is clicked, this contact will be deleted and back to Main screen.
a4497fdc6a8575076e1bf3d4b7a95ebc
{ "intermediate": 0.47734713554382324, "beginner": 0.2410401552915573, "expert": 0.28161266446113586 }
29,812
identify duplicate records using sql query
22997ce79e8e4553757621e9ea568edc
{ "intermediate": 0.4463324546813965, "beginner": 0.28342315554618835, "expert": 0.27024438977241516 }
29,813
This is for Android Studio in Java Code. • Design an app to store contacts information. • Main screen shows all names saved in database as a list. • One icon allows the customer to add a new contact to the database. When this icon clicked, a blank EditContact screen is displayed. • Main screen also allows searching by entering key information into the searching box. The list of contact information will be updated when information is entered into the searching box. • Use SearchView to let customer enter key information into. • Use SearchView.setOnQueryTextListener to listen the text change in search box. • By clicking an item in the contact list, another screen will display the detail information of the selected contact. • The Detail screen will display the detail information of the selected contact. Two buttons/icons at the bottom of the screen allows customer to choose to save or delete this contact information. • When save button/icon is clicked, this contact will be added/updated and back to Main screen. • When delete button/icon is clicked, this contact will be deleted and back to Main screen. This app is ONLY meant to save names and phone numbers
9704d85485aafc07542945c76af59e3a
{ "intermediate": 0.47458794713020325, "beginner": 0.21993082761764526, "expert": 0.3054811954498291 }
29,814
This is for Android Studio in Java Code. • Design an app to store contacts information. • Main screen shows all names saved in database as a list. • One icon allows the customer to add a new contact to the database. When this icon clicked, a blank EditContact screen is displayed. • Main screen also allows searching by entering key information into the searching box. The list of contact information will be updated when information is entered into the searching box. • Use SearchView to let customer enter key information into. • Use SearchView.setOnQueryTextListener to listen the text change in search box. • By clicking an item in the contact list, another screen will display the detail information of the selected contact. • The Detail screen will display the detail information of the selected contact. Two buttons/icons at the bottom of the screen allows customer to choose to save or delete this contact information. • When save button/icon is clicked, this contact will be added/updated and back to Main screen. • When delete button/icon is clicked, this contact will be deleted and back to Main screen. This app is ONLY meant to save names and phone numbers
8ee491f05d97ce24f44e613b238c70ca
{ "intermediate": 0.47458794713020325, "beginner": 0.21993082761764526, "expert": 0.3054811954498291 }
29,815
This is for Android Studio in Java Code. • Design an app to store contacts information. • Main screen shows all names saved in database as a list. • One icon allows the customer to add a new contact to the database. When this icon clicked, a blank EditContact screen is displayed. • Main screen also allows searching by entering key information into the searching box. The list of contact information will be updated when information is entered into the searching box. • Use SearchView to let customer enter key information into. • Use SearchView.setOnQueryTextListener to listen the text change in search box. • By clicking an item in the contact list, another screen will display the detail information of the selected contact. • The Detail screen will display the detail information of the selected contact. Two buttons/icons at the bottom of the screen allows customer to choose to save or delete this contact information. • When save button/icon is clicked, this contact will be added/updated and back to Main screen. • When delete button/icon is clicked, this contact will be deleted and back to Main screen. This app is ONLY meant to save names and phone numbers. It only uses Two Screens, MainActivity and DetailActivity, the latter lets you edit contacts.
bdb81997232ac690f499981132b42c28
{ "intermediate": 0.45314785838127136, "beginner": 0.23690752685070038, "expert": 0.30994459986686707 }
29,816
This is for Android Studio in Java Code. • Design an app to store contacts information. • Main screen shows all names saved in database as a list. • One icon allows the customer to add a new contact to the database. When this icon clicked, a blank EditContact screen is displayed. • Main screen also allows searching by entering key information into the searching box. The list of contact information will be updated when information is entered into the searching box. • Use SearchView to let customer enter key information into. • Use SearchView.setOnQueryTextListener to listen the text change in search box. • By clicking an item in the contact list, another screen will display the detail information of the selected contact. • The Detail screen will display the detail information of the selected contact. Two buttons/icons at the bottom of the screen allows customer to choose to save or delete this contact information. • When save button/icon is clicked, this contact will be added/updated and back to Main screen. • When delete button/icon is clicked, this contact will be deleted and back to Main screen. This app is ONLY meant to save names and phone numbers. It only uses Two Screens, MainActivity and DetailActivity, the latter lets you edit contacts.
7a7aab42a20972edd0cdc840d71ee21d
{ "intermediate": 0.4632970690727234, "beginner": 0.22211866080760956, "expert": 0.31458428502082825 }
29,817
I am getting this error: sqlalchemy.exc.ArgumentError: Mapper mapped class TempStockReturnDaily->temp_stock_return_daily could not assemble any primary key columns for mapped table 'temp_stock_return_daily' when I try to work with the TempStockReturnDaily model from the script below. What changes do I need make to the script so I can work with the TempStockReturnDaily model as temporary Postgres table without creating a primary key for it? class AbstractBase: __abstract__ = True @declared_attr def __tablename__(cls): return to_underscored(cls.__name__) @classmethod def _generate_index(cls, is_unique, *columns, index_name=None): prefix = 'ux' if is_unique else 'ix' index_name = index_name or f'{prefix}_{cls.__tablename__}__{"__".join(columns)}' return Index(index_name, *columns, unique=is_unique) naming_convention = { "ix": 'ix_%(column_0_label)s', "uq": "uq_%(table_name)s_%(column_0_name)s", "fk": "fk_%(table_name)s_%(column_0_name)s_%(referred_table_name)s", "pk": "pk_%(table_name)s" } def get_Base(schema_name=None): kwargs = {} if schema_name: kwargs['schema'] = schema_name meta = MetaData(naming_convention=naming_convention, **kwargs) return declarative_base(cls=AbstractBase, metadata=meta) class TemporaryModel(BaseTemp): prefixes = ['Temporary'] class TempStockReturnDaily(TemporaryModel): stock_series_id = Column(Integer, nullable=False) start_date = Column(Date(), nullable=False) end_date = Column(Date(), nullable=False) return_value = Column(Numeric(precision=18, scale=10), nullable=False)
db2ca7cbd89e32a8f42328507a8d0da8
{ "intermediate": 0.6244360208511353, "beginner": 0.2774529755115509, "expert": 0.09811095148324966 }
29,818
This is for Android Studio in Java Code. • Design an app to store contacts information. • Main screen shows all names saved in database as a list. • One icon allows the customer to add a new contact to the database. When this icon clicked, a blank EditContact screen is displayed. • Main screen also allows searching by entering key information into the searching box. The list of contact information will be updated when information is entered into the searching box. • Use SearchView to let customer enter key information into. • Use SearchView.setOnQueryTextListener to listen the text change in search box. • By clicking an item in the contact list, another screen will display the detail information of the selected contact. • The Detail screen will display the detail information of the selected contact. Two buttons/icons at the bottom of the screen allows customer to choose to save or delete this contact information. • When save button/icon is clicked, this contact will be added/updated and back to Main screen. • When delete button/icon is clicked, this contact will be deleted and back to Main screen. This app is ONLY meant to save names and phone numbers.
fda26d90a9a5d5547c6994702240039c
{ "intermediate": 0.4896863102912903, "beginner": 0.20397880673408508, "expert": 0.30633485317230225 }
29,819
This is for Android Studio in Java Code. • Design an app to store contacts information. • Main screen shows all names saved in database as a list. • One icon allows the customer to add a new contact to the database. When this icon clicked, a blank EditContact screen is displayed. • Main screen also allows searching by entering key information into the searching box. The list of contact information will be updated when information is entered into the searching box. • Use SearchView to let customer enter key information into. • Use SearchView.setOnQueryTextListener to listen the text change in search box. • By clicking an item in the contact list, another screen will display the detail information of the selected contact. • The Detail screen will display the detail information of the selected contact. Two buttons/icons at the bottom of the screen allows customer to choose to save or delete this contact information. • When save button/icon is clicked, this contact will be added/updated and back to Main screen. • When delete button/icon is clicked, this contact will be deleted and back to Main screen. This app is ONLY meant to save names and phone numbers.
9ff59bb2be3ef1fe7b65ff3fee4f128d
{ "intermediate": 0.4896863102912903, "beginner": 0.20397880673408508, "expert": 0.30633485317230225 }
29,820
how would i add music to a c++ sdl2 project using sdl mixer?
5d47adbb6bc12ede6b4a2a1e47e4c39a
{ "intermediate": 0.48234686255455017, "beginner": 0.2831374406814575, "expert": 0.23451566696166992 }
29,821
This is for Android Studio in Java Code. • Design an app to store contacts information. • First screen shows all names saved in database as a list. • One button allows the customer to add a new contact to the database. When this icon clicked, a blank EditContact screen is displayed. • First screen also allows searching by entering key information into the searching box. The list of contact information will be updated when information is entered into the searching box. • Use SearchView to let customer enter key information into. • Use SearchView.setOnQueryTextListener to listen the text change in search box. • By clicking an item in the contact list, another screen will display the detail information of the selected contact. • The Detail screen will display the detail information of the selected contact. Two buttons/icons at the bottom of the screen allows customer to choose to save or delete this contact information. • When save button/icon is clicked, this contact will be added/updated and back to Main screen. • When delete button/icon is clicked, this contact will be deleted and back to Main screen. This app is ONLY meant to save names and phone numbers.
ad9c7a952a0cb65f67ccb85e1e0e85c5
{ "intermediate": 0.49572861194610596, "beginner": 0.19868004322052002, "expert": 0.30559131503105164 }
29,822
# получаем исходный код страницы inner_html_code = str(urlopen('https://nashel.ru/rent/requests/gorod-moskva?_filtered=1').read(),'utf-8') # отправляем исходный код страницы на обработку в библиотеку inner_soup = BeautifulSoup(inner_html_code, "html.parser") text = inner_soup.get_text() #text = "Пример #текста#, в котором нужно получить #текстVar# между знаками решетки." start_index = text.find("#") + 1 end_index = text.find("#", start_index) textVar = text[start_index:end_index] print(textVar) message = (textVar) url = f"https://api.telegram.org/bot{TOKEN}/sendMessage?chat_id={chat_id}&text={message}" print(requests.get(url).json()) # Эта строка отсылает сообщение есть данный код нужно что бы он сравнивал первые пять чисел с переменной number и если число не совпадает то отправить сообщение в телеграмм и записать первые пять чисел в переменную number если номер совпадает то пауза 30 секунд и повторение цикла
d6eb04b71e4b2d6659328a8ebc1db9e0
{ "intermediate": 0.3286255896091461, "beginner": 0.42130887508392334, "expert": 0.25006550550460815 }
29,823
Create a simple contacts app in Android Studio. - The first screen should let me add, select or search for a contact. - The Second Screen should let me edit or delete the selected contact.
31cf37298fa8aa04993d72960c3bea81
{ "intermediate": 0.4288761019706726, "beginner": 0.22505798935890198, "expert": 0.3460659086704254 }
29,824
find the text of just realted topic and samuraze it : How to install pip in Python 3 on Ubuntu 18.04? | Odoo Odoo Menu Sign in Try it free Apps Finance Accounting Invoicing Expenses Spreadsheet (BI) Documents Sign Sales CRM Sales Point of Sale Subscriptions Rental Amazon Connector Websites Website Builder eCommerce Blogs Forum Live Chat eLearning Inventory & MRP Inventory Manufacturing PLM Purchase Maintenance Quality Human Resources Employees Recruitment Time Off Appraisals Referrals Fleet Marketing Social Marketing Email Marketing SMS Marketing Events Marketing Automation Surveys Services Project Timesheet Field Service Helpdesk Planning Appointments Productivity Discuss Approvals IoT VoIP KnowledgeNew! Third party apps Odoo Studio Odoo Cloud Platform Community Learn Tutorials Documentation Certifications Planet Odoo Empower Education Education Program Scale Up! Business Game Visit Odoo Get the Software Download Compare Editions Releases Collaborate Github Forum Events Translations Become a Partner Register your Accounting Firm Get Services Find a Partner Find an Accountant Meet an Expert Customer References Implementation Services Support Upgrades Github Youtube Twitter Linkedin Instagram Facebook Spotify <PRESIDIO_ANONYMIZED_PHONE_NUMBER> WhatsApp with Us Get a demo Pricing Dismiss Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps: CRM e-Commerce Accounting Inventory PoS Project management MRP Take the tour You need to be registered to interact with the community. Posts People Badges Tags View all odoo v7 accounting pos odooV8 About this forum You need to be registered to interact with the community. Posts People Badges Tags View all odoo v7 accounting pos odooV8 About this forum Help How to install pip in Python 3 on Ubuntu 18.04? Subscribe Get notified when there's activity on this post Subscribe Following This question has been flagged 4 Replies 680142 Views Odoo12python3.5ubuntu18 <PRESIDIO_ANONYMIZED_EMAIL_ADDRESS> Hello, Now I want to deploy odoo12 on ubuntu18.04 and i type "sudo apt-get install python3-pip" in terminal. But show error message like that "Enable to locate package python3-pip".How should I do?.Please kindly guide to me.Thanks 0 Add a comment Discard MUHAMMAD Imran Best Answer Installing pip for Python 3Ubuntu 18.04 ships with Python 3, as the default Python installation. Complete the following steps to install pip (pip3) for Python 3:Start by updating the package list using the following command:sudo apt updateUse the following command to install pip for Python 3:sudo apt install python3-pipThe command above will also install all the dependencies required for building Python modules.Once the installation is complete, verify the installation by checking the pip version:pip3 --versionThe version number may vary, but it will look something like this:pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6) 3 Add a comment Discard kalamozer Best Answer Do you install pip in Python 3 successful? 0 Add a comment Discard kalamozer You can just do it with this command:apt-get install python3-pipBut make sure you have Python 3 installedInstalling Pip (more details): https://linuxstans.com/install-pip-ubuntu/Installing Python 3 (more details): https://linuxstans.com/how-to-install-python-ubuntu/Source: https://geometrydas h2 2.com Sunny Sheth Best Answer Hello,you can install pip via below command.sudo python3.7 -m pip install pip--> replace your python version with python3.7 if not python3.7 in your system. ThanksSunny Sheth 0 Add a comment Discard Nick Best Answer You can just do it with this command:apt-get install python3-pipBut make sure you have Python 3 installed 0 Add a comment Discard Nick Installing Pip (more details): https://linuxstans.com/install-pip-ubuntu/Installing Python 3 (more details): https://linuxstans.com/how-to-install-python-ubuntu/ Community Tutorials Documentation Forum Open Source Download Github Runbot Translations Services Odoo.sh Hosting Support Upgrade Education Find an Accountant Find a Partner Become a Partner About us Our company Brand Assets Contact us Jobs Events Podcast Blog Customers Legal • Privacy Security English الْعَرَبيّة 简体中文 繁體中文 Čeština Nederlands English Français Deutsch Bahasa Indonesia Italiano 日本語 한국어 (KR) Português (BR) русский язык Slovenský jazyk slovenščina Español ภาษาไทย Türkçe українська Tiếng Việt Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc. Odoo's unique value proposition is to be at the same time very easy to use and fully integrated. Website made with Odoo Experience on YouTube 1. Use the live chat to ask your questions. 2. The operator answers within a few minutes. Watch now
1861fac738672f431aea3dee711678e6
{ "intermediate": 0.39720550179481506, "beginner": 0.41767966747283936, "expert": 0.1851148158311844 }
29,825
Create a simple contacts app in Android Studio. It only saves names and phone numbers. - The first screen should let me add, select or search for a contact. - If I select an existing contact, it puts me into a Second Screen that should let me edit, save or delete the selected contact.
ae2e98fe1d760698531b7c7c66dc6d28
{ "intermediate": 0.46381980180740356, "beginner": 0.2265450656414032, "expert": 0.309635192155838 }
29,826
heelo
19e7e68565ad2dc2cf879504fc0347f7
{ "intermediate": 0.3373914659023285, "beginner": 0.2789938449859619, "expert": 0.383614718914032 }
29,827
moving circle to line collision deteciton in javascript
dfb54bf58424550958bb3ffe33a883ec
{ "intermediate": 0.2686285376548767, "beginner": 0.26167288422584534, "expert": 0.46969854831695557 }
29,828
if pd.read_excel() then want to get photo using boto3 and want to save back this photo in same excel, can you help me to get code
f783e336d15df7e6aaea7d6e1e021d36
{ "intermediate": 0.5059106945991516, "beginner": 0.30351242423057556, "expert": 0.19057688117027283 }
29,829
In powershell how do I match 'ABC.btnZ_Click(): "Best"'
2a1d144fb42cbdb6be6814fd9ebe980c
{ "intermediate": 0.38292092084884644, "beginner": 0.2873518764972687, "expert": 0.3297272324562073 }
29,830
Using power shell, remove all special characters from a string
6d593d1e044725417beb0ee864fe3300
{ "intermediate": 0.37734484672546387, "beginner": 0.19145281612873077, "expert": 0.4312022924423218 }
29,831
Check and Correct TestEran_Port function used for port() testing
8bc847b1a68a8e50e4ce486b6ac39db8
{ "intermediate": 0.4999249577522278, "beginner": 0.22339756786823273, "expert": 0.2766774594783783 }
29,832
Check and Correct TestEran_Port function used for port() testing
f28a12c6b9f60731af685c33a441722f
{ "intermediate": 0.4999249577522278, "beginner": 0.22339756786823273, "expert": 0.2766774594783783 }
29,833
ERBS_41132_YUGCITY_1_KKT Check and Correct TestEran_Port function used for port() testing
af559471df25f20ce0e010a62de3ead8
{ "intermediate": 0.3556337356567383, "beginner": 0.26918429136276245, "expert": 0.37518200278282166 }
29,834
ERBS_41132_YUGCITY_1_KKT Check and Correct TestEran_Port function used for port() testing
1933730b1f2b0e8a028c34b1a88fe7ca
{ "intermediate": 0.3556337356567383, "beginner": 0.26918429136276245, "expert": 0.37518200278282166 }
29,835
PS C:\Users\moon2> & C:/Users/moon2/AppData/Local/Programs/Python/Python312/python.exe "c:/Users/moon2/OneDrive/سطح المكتب/aa.py" Traceback (most recent call last): File "c:\Users\moon2\OneDrive\سطح المكتب\aa.py", line 4, in <module> from sklearn.model_selection import train_test_split ModuleNotFoundError: No module named 'sklearn' PS C:\Users\moon2>
4e261f0bfa42183dee0c64ecc281086e
{ "intermediate": 0.34044402837753296, "beginner": 0.24418042600154877, "expert": 0.41537559032440186 }
29,836
把它改为version 5 no repaint //@version=2 strategy(title='Sniper & Strategy by CSBender_', shorttitle='Sniper & Strategy by CSBender_', overlay=true, pyramiding=0, initial_capital=1, currency=currency.USD) //============ signal Generator ==================================// Piriod=input('720')//630 ch1 = security(tickerid, Piriod, open) ch2 = security(tickerid, Piriod, close) longCondition = crossover(ch2,ch1) shortCondition = crossunder(ch2,ch1) if (longCondition) strategy.entry(".", strategy.long) plotshape(longCondition, style=shape.labelup, color=lime, text="Señal de\nCompra\nActivada", textcolor=black, location=location.belowbar) if (shortCondition) strategy.entry(".", strategy.short) plotshape(shortCondition, style=shape.labeldown, color=red, text="Señal de\nVenta\nActivada", textcolor=black) //============ Directional Projection ==================================// channel3=input(false, title="Connect Projection High/Low") tf2 = input('1', title="Trend Projection TF / Mins/D/W") M2 = input('ATR') P2 = input(13.00, type=float) W2 = input(1) pf2 = pointfigure(tickerid, 'close', M2, P2, W2) spfc2 = security(pf2, tf2, close) p22=plot(channel3?spfc2:spfc2==nz(spfc2[1])?spfc2:na, color=blue, linewidth=2, style=linebr, title="Projection", offset=0) //====================colour bar====================== mysignal = ema(close, 13) - ema(close, 26) barcolor(mysignal[0] > mysignal[1] ? green : red) //============ Trend colour ema 1 y 2 ==================================// src0 = close, len0 = input(13, minval=1, title="EMA 1") ema0 = ema(src0, len0) direction = rising(ema0, 2) ? +1 : falling(ema0, 2) ? -1 : 0 plot_color = direction > 0 ? lime: direction < 0 ? red : na plot(ema0, title="EMA", style=line, linewidth=2, color = plot_color) //============ ema 2 ==================================// src02 = close, len02 = input(21, minval=1, title="EMA 2") ema02 = ema(src02, len02) direction2 = rising(ema02, 2) ? +1 : falling(ema02, 2) ? -1 : 0 plot_color2 = direction2 > 0 ? lime: direction2 < 0 ? red : na plot(ema02, title="EMA Signal 2", style=line, linewidth=2, color = plot_color2) //=============Hull MA ==================================// show_hma = input(false, title="Display Hull MA Set:") hma_src = input(close, title="Hull MA's Source:") hma_base_length = input(8, minval=1, title="Hull MA's Base Length:") hma_length_scalar = input(5, minval=0, title="Hull MA's Length Scalar:") hullma(src, length)=>wma(2*wma(src, length/2)-wma(src, length), round(sqrt(length))) plot(not show_hma ? na : hullma(hma_src, hma_base_length+hma_length_scalar*6), color=black, linewidth=2, title="Hull MA") //============ Supertrend Generator ==================================// Factor=input(1, minval=1,maxval = 000, title="Trend Transition Signal") Pd=input(1, minval=1,maxval = 100) Up=hl2-(Factor*atr(Pd)) Dn=hl2+(Factor*atr(Pd)) TrendUp=close[1]>TrendUp[1]? max(Up,TrendUp[1]) : Up TrendDown=close[1]<TrendDown[1]? min(Dn,TrendDown[1]) : Dn Trend = close > TrendDown[1] ? 1: close< TrendUp[1]? -1: nz(Trend[1],0) plotarrow(Trend == 1 and Trend[1] == -1 ? Trend : na, title="Up Entry Arrow", colorup=lime, maxheight=1000, minheight=50, transp=85) plotarrow(Trend == -1 and Trend[1] == 1 ? Trend : na, title="Down Entry Arrow", colordown=red, maxheight=1000, minheight=50, transp=85) //============ Trend Generator ==================================// slow = 8 fast = 5 vh1 = ema(highest(avg(low, close), fast), 5) vl1 = ema(lowest(avg(high, close), slow), 8) e_ema1 = ema(close, 1) e_ema2 = ema(e_ema1, 1) e_ema3 = ema(e_ema2, 1) tema = 1 * (e_ema1 - e_ema2) + e_ema3 e_e1 = ema(close, 8) e_e2 = ema(e_e1, 5) dema = 2 * e_e1 - e_e2 signal = tema > dema ? max(vh1, vl1) : min(vh1, vl1) is_call = tema > dema and signal > low and (signal-signal[1] > signal[1]-signal[2]) is_put = tema < dema and signal < high and (signal[1]-signal > signal[2]-signal[1]) plotshape(is_call ? 1 : na, title="BUY ARROW", color=green, text="B", style=shape.arrowup, location=location.belowbar) plotshape(is_put ? -1 : na, title="SELL ARROW", color=red, text="S", style=shape.arrowdown) //============ END ==================================//
c261d864cdf21bb635c2c95159aa6675
{ "intermediate": 0.32633498311042786, "beginner": 0.32689106464385986, "expert": 0.3467739224433899 }
29,837
********************100%%**********************] 1 of 1 completed [*********************100%%**********************] 1 of 1 completed Traceback (most recent call last): File "C:\Users\moon2\AppData\Local\Programs\Python\Python312\Lib\site-packages\pandas\core\indexes\base.py", line 3790, in get_loc return self._engine.get_loc(casted_key) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "index.pyx", line 152, in pandas._libs.index.IndexEngine.get_loc File "index.pyx", line 181, in pandas._libs.index.IndexEngine.get_loc File "pandas\_libs\hashtable_class_helper.pxi", line 7080, in pandas._libs.hashtable.PyObjectHashTable.get_item File "pandas\_libs\hashtable_class_helper.pxi", line 7088, in pandas._libs.hashtable.PyObjectHashTable.get_item KeyError: 'Symbol' The above exception was the direct cause of the following exception: Traceback (most recent call last): File "c:\Users\moon2\OneDrive\سطح المكتب\aa.py", line 102, in <module> preprocessed_data[stock] = preprocess_data(historical_prices[stock]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\Users\moon2\OneDrive\سطح المكتب\aa.py", line 23, in preprocess_data data["Ticker"] = data["Symbol"] ~~~~^^^^^^^^^^ File "C:\Users\moon2\AppData\Local\Programs\Python\Python312\Lib\site-packages\pandas\core\frame.py", line 3893, in __getitem__ indexer = self.columns.get_loc(key) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\moon2\AppData\Local\Programs\Python\Python312\Lib\site-packages\pandas\core\indexes\base.py", line 3797, in get_loc raise KeyError(key) from err KeyError: 'Symbol' PS C:\Users\moon2> & C:/Users/moon2/AppData/Local/Programs/Python/Python312/python.exe "c:/Users/moon2/OneDrive/سطح المكتب/aa.py" Traceback (most recent call last): File "c:\Users\moon2\OneDrive\سطح المكتب\aa.py", line 21, in <module> symbols.append(ticker.info["symbol"]) ^^^^^^^ NameError: name 'symbols' is not defined PS C:\Users\moon2>
15f5b0a74a11bdb3378ae5cc6cf35063
{ "intermediate": 0.37161576747894287, "beginner": 0.3016035854816437, "expert": 0.32678064703941345 }
29,838
ERBS_41132_YUGCITY_1_KKT Check and Correct TestNodes_Count and TestNodes_Names used for Count() and Names() testing
1be3d16183048b1e44066772ddc630c8
{ "intermediate": 0.3801960349082947, "beginner": 0.181976318359375, "expert": 0.43782761693000793 }
29,839
haar_cascade = cv.CascadeClassifier('haar_cascade.xml') features = [] labels = [] def create_train(): for person in people: path = os.path.join(DIR, person) label = people.index(person) for img in os.listdir(path): img_path = os.path.join(path, img) img_array = cv.imread(img_path) if img_array is None: continue gray = cv.cvtColor(img_array, cv.COLOR_BGR2GRAY) faces_rect = haar_cascade.detectMultiScale(gray, scaleFactor=1.1, minNeighbors=4) for (x, y, w, h) in faces_rect: faces_roi = gray[y:y + h, x:x + w] features.append(faces_roi) labels.append(label) create_train() print('Training done ---------------') features = np.array(features, dtype='object') labels = np.array(labels) face_recognizer = cv.face.LBPHFaceRecognizer_create() # Train the Recognizer on the features list and the labels list face_recognizer.train(features,labels) face_recognizer.save('face_trained.yml') np.save('features.npy', features) np.save('labels.npy', labels) я хочу сделать идентификкацию лица на opencv. Но когда я пытаюсь обучить модель, у меня возникает ошибка face_recognizer = cv.face.LBPHFaceRecognizer_create() AttributeError: module 'cv2' has no attribute 'face' как это исправить?
b1d7ef055063e813dc34e559c9f799a7
{ "intermediate": 0.3531602919101715, "beginner": 0.269395649433136, "expert": 0.3774440586566925 }
29,840
stocks = ["MSFT", "GOOGL", "AMZN", "TSLA", "META", "NVDA", "JPM", "UNH", "V", "MA", "HD", "KO", "PFE", "JNJ", "WMT", "DIS", "BAC", "MCD", "VZ"] # Define the dictionary to store historical prices historical_prices = {} # Download the historical prices data for stock in stocks: ticker = yf.Ticker(stock) historical_prices[stock] = ticker.history(start="2022-01-01", end="2022-12-31") replace the code to fetch from vag website
f0a94eb9f974590bd64894786ad5835a
{ "intermediate": 0.49458685517311096, "beginner": 0.25532081723213196, "expert": 0.2500922679901123 }
29,841
merkle tree可以根据 leaf,path index,path element算出根节点hash吗
c4f40d98f6e5415d37d756e6ed0be254
{ "intermediate": 0.3408907949924469, "beginner": 0.35629114508628845, "expert": 0.3028181493282318 }
29,842
как сделать поиск без кнопки? <input type="hidden" name="partnerId" id="nav-partnerId" value="${searchFilter.id}"/> <div class="form-group"> <label class="sr-only" for="field-partner">Партнер</label> <select id="field-partner" path="id" name="partnerId" class="form-control"> <option value="" selected hidden>Партнер</option> <c:forEach items="${merchants}" var="merch"> <option value="${merch.id}" title="${merch.inn}">${merch.name}</option> </c:forEach> </select> </div>
a96e2bcf142d77435c040a03a9ddacba
{ "intermediate": 0.28160640597343445, "beginner": 0.4797048568725586, "expert": 0.23868873715400696 }
29,843
Explain what graph.addPluralSubgraph(Book_.authors).addSubgraph(Author_.person); does in the following text.: 5.7. Entity graphs and eager fetching When an association is mapped fetch=LAZY, it won’t, by default, be fetched when we call the find() method. We may request that an association be fetched eagerly (immediately) by passing an EntityGraph to find(). The JPA-standard API for this is a bit unwieldy: var graph = entityManager.createEntityGraph(Book.class); graph.addSubgraph(Book_.publisher); Book book = entityManager.find(Book.class, bookId, Map.of(SpecHints.HINT_SPEC_FETCH_GRAPH, graph)); This is untypesafe and unnecessarily verbose. Hibernate has a better way: var graph = session.createEntityGraph(Book.class); graph.addSubgraph(Book_.publisher); Book book = session.byId(Book.class).withFetchGraph(graph).load(bookId); This code adds a left outer join to our SQL query, fetching the associated Publisher along with the Book. We may even attach additional nodes to our EntityGraph: var graph = session.createEntityGraph(Book.class); graph.addSubgraph(Book_.publisher); graph.addPluralSubgraph(Book_.authors).addSubgraph(Author_.person); Book book = session.byId(Book.class).withFetchGraph(graph).load(bookId); This results in a SQL query with four left outer joins. In the code examples above, The classes Book_ and Author_ are generated by the JPA Metamodel Generator we saw earlier. They let us refer to attributes of our model in a completely type-safe way. We’ll use them again, below, when we talk about Criteria queries. JPA specifies that any given EntityGraph may be interpreted in two different ways. A fetch graph specifies exactly the associations that should be eagerly loaded. Any association not belonging to the entity graph is proxied and loaded lazily only if required. A load graph specifies that the associations in the entity graph are to be fetched in addition to the associations mapped fetch=EAGER. You’re right, the names make no sense. But don’t worry, if you take our advice, and map your associations fetch=LAZY, there’s no difference between a "fetch" graph and a "load" graph, so the names don’t matter. JPA even specifies a way to define named entity graphs using annotations. But the annotation-based API is so verbose that it’s just not worth using.
006425167630098e2775186a1440b756
{ "intermediate": 0.4297633767127991, "beginner": 0.3859008252620697, "expert": 0.18433576822280884 }
29,844
Change code so clean() would modify Nodes from `json:"children"`
dc6da51d1f72d6feb44609f324d06673
{ "intermediate": 0.4346335232257843, "beginner": 0.20975184440612793, "expert": 0.35561466217041016 }
29,845
I get the photo from boto3, next this photo will be insert to excel file with new column of dataframe in pandas, can you help me to get the code
395c880cd38384ccc2870f6f1999663d
{ "intermediate": 0.5561456680297852, "beginner": 0.18889710307121277, "expert": 0.2549572288990021 }
29,846
I used this code: def signal_generator(df): if df is None or len(df) < 2: return '' signal = [] final_signal = [] # Retrieve depth data th = 0.35 depth_data = client.depth(symbol=symbol) bid_depth = depth_data['bids'] ask_depth = depth_data['asks'] buy_price = float(bid_depth[0][0]) if bid_depth else 0.0 sell_price = float(ask_depth[0][0]) if ask_depth else 0.0 mark_price_data = client.ticker_price(symbol=symbol) mark_price = float(mark_price_data['price']) if 'price' in mark_price_data else 0.0 mark_price_data_change = client.ticker_24hr_price_change(symbol=symbol) mark_price_percent = float(mark_price_data_change['priceChangePercent']) if 'priceChangePercent' in mark_price_data_change else 0.0 buy_qty = float(bid_depth[0][1]) if bid_depth else 0.0 sell_qty = float(ask_depth[0][1]) if ask_depth else 0.0 # Calculate the threshold for order price deviation if mark_price_percent > 2: pth = 7 / 100 elif mark_price_percent < -2: pth = 7 / 100 else: pth = 7 / 100 executed_orders_buy = 0.0 for order in bid_depth: if float(order[0]) == mark_price: executed_orders_buy += float(order[1]) else: break buy_qty = float(bid_depth[0][1]) if bid_depth else 0.0 buy_result = buy_qty - executed_orders_buy executed_orders_sell = 0.0 for order in ask_depth: if float(order[0]) == mark_price: executed_orders_sell += float(order[1]) else: break sell_qty = float(ask_depth[0][1]) if ask_depth else 0.0 sell_result = sell_qty - executed_orders_sell if final_signal == ['buy']: active_signal = 'buy' elif final_signal == ['sell']: active_signal = 'sell' else: active_signal = None if (sell_result > (1 + th) > float(buy_qty)) and (sell_price < mark_price - (pth + 0.08)): signal.append('sell') elif (buy_result > (1 + th) > float(sell_qty)) and (buy_price > mark_price + (pth + 0.08)): signal.append('buy') else: signal.append('') if signal == ['buy'] and not ((buy_result < sell_qty) and (buy_price < mark_price)): final_signal.append('buy') elif signal == ['sell'] and not ((sell_result < buy_qty) and (sell_price > mark_price)): final_signal.append('sell') else: final_signal.append('') if active_signal == 'buy' and ((buy_result < sell_qty) and (buy_price < mark_price)): final_signal.append('buy_exit') elif active_signal == 'sell' and ((sell_result < buy_qty) and (sell_price > mark_price)): final_signal.append('sell_exit') else: final_signal.append('') return final_signal But will it return me buy_exit and sell_exit ?
766c8be2ef89404377ae9a461da8120b
{ "intermediate": 0.3378034830093384, "beginner": 0.4651678502559662, "expert": 0.19702869653701782 }
29,847
optimize code if possible
9a158fc24b947d67a4a55bb11029ac9c
{ "intermediate": 0.29573309421539307, "beginner": 0.21605701744556427, "expert": 0.4882098436355591 }
29,848
libcap.so.1:cannot open shared object file: No such file or directory
105a4bcb779e19a85f80286a3f7090c0
{ "intermediate": 0.5423403978347778, "beginner": 0.21928764879703522, "expert": 0.23837195336818695 }
29,849
here is my code, to get photo from boto3, from this code how can I insert real photo into excel with the new column as define raw_data['image']? def get_image(image_id): for index, row in raw_data.iterrows(): # print(row['image_id']) try: imgByte = s3.get_object(Bucket=BUCKET_NAME, Key=f"{int(row[image_id])}/image.png")["Body"].read() img = Image.open(BytesIO(imgByte)) if img.width < 10 or img.height < 10: return None return img except: return None raw_data['image'] = raw_data['image_id'].apply(get_image)
2078f5ca8f1aebdc8bc3d0490e3d59c3
{ "intermediate": 0.5586618185043335, "beginner": 0.3238745331764221, "expert": 0.1174636036157608 }
29,850
I have a circular dependency in Hibernate. I vaguely recall there being some annotation @ something with json to deal with this. What could it have been?
a58804986a82d14825369d4adbe2e3ba
{ "intermediate": 0.6816853880882263, "beginner": 0.14356371760368347, "expert": 0.1747509241104126 }
29,851
How to use .jks certificate to configure server side SSL in Apache Zeppelin
7eebe827736b451a9c68c227fb164a54
{ "intermediate": 0.38913971185684204, "beginner": 0.282488077878952, "expert": 0.32837218046188354 }
29,852
what wrong in this code
f98dcbb0341a9639a6e5e7adcab74b49
{ "intermediate": 0.22010308504104614, "beginner": 0.46892213821411133, "expert": 0.31097477674484253 }
29,853
hi there
356cd9be03e38ce471b235557a83ae7e
{ "intermediate": 0.32885003089904785, "beginner": 0.24785484373569489, "expert": 0.42329514026641846 }
29,854
这是bev的WriteResultImageMessage和OnReceiveData函数: std::unordered_map< std::string, std::shared_ptr<apollo::cyber::Writer<apollo::drivers::Image>> > camera_image_output_writer_; bool BevObstacleDetectionComponent::OnReceiveData( BevFrame &bev_frame){ CameraFrameSet &camera_frame_set = bev_frame.camera_frame_set; std::shared_ptr<apollo::perception::PerceptionObstacles> out_message( new (std::nothrow) apollo::perception::PerceptionObstacles); if (bev_frame.out_message_array.size() != 0){ AERROR << "using existing message serialization ..."; out_message->ParseFromArray((void *)bev_frame.out_message_array.data(), bev_frame.out_message_array.size()); double publish_time = Clock::NowInSeconds(); double msg_timestamp = cyber::Time::Now().ToSecond(); apollo::common::Header *header = out_message->mutable_header(); header->set_timestamp_sec(publish_time); header->set_module_name("perception_camera"); header->set_sequence_num(++seq_num_); // in nanosecond // PnC would use lidar timestamp to predict header->set_lidar_timestamp(static_cast<uint64_t>(msg_timestamp * 1e9)); header->set_camera_timestamp(static_cast<uint64_t>(msg_timestamp * 1e9)); }else{ apollo::common::ErrorCode error_code = apollo::common::OK; std::shared_ptr<SensorFrameMessage> prefused_message(new (std::nothrow) SensorFrameMessage); const double msg_timestamp = camera_frame_set.begin()->first + timestamp_offset_; uint32_t cur_seq_num = ++seq_num_; prefused_message->seq_num_ = cur_seq_num; if (InternalProc(bev_frame, &error_code, prefused_message.get(), out_message.get()) != cyber::SUCC) { AERROR << "InternalProc failed, error_code: " << error_code; if (MakeProtobufMsg(msg_timestamp, cur_seq_num, {}, {}, error_code, out_message.get()) != cyber::SUCC) { AERROR << "MakeProtobufMsg failed"; return false; } if (output_final_obstacles_) { writer_->Write(out_message); } return false; } // 把输出的message保存下来 // { // int message_byte_length = out_message->ByteSize(); // std::vector<char> temp(message_byte_length); // out_message->SerializeToArray((void *)temp.data(), message_byte_length); // std::fstream out_file_stream; // AERROR << "save output message : " << bev_frame.frame_dir_path + "/out_message.obs"; // out_file_stream.open(bev_frame.frame_dir_path + "/out_message.obs", std::ios::out | std::ios::binary); // out_file_stream.write(temp.data(), message_byte_length); // out_file_stream.close(); // } } //AERROR << "output_final_obstacles: " << output_final_obstacles_; if (output_final_obstacles_) { writer_->Write(out_message); } //AERROR << "output result image !"; WriteResultImageMessage(camera_frame_set); return true; } int BevObstacleDetectionComponent::WriteResultImageMessage(std::map<uint64_t, BevCameraFrame> &CameraFrameSet){ for (const auto &timestamp_cameraframe : CameraFrameSet){ const auto &frame = timestamp_cameraframe.second; const std::string &camera_name = frame.camera_name; apollo::drivers::Image image_message; if (frame.camera_result_image == nullptr) continue; const auto &mat_image = *frame.camera_result_image; double publish_time = Clock::NowInSeconds(); apollo::common::Header *header = image_message.mutable_header(); header->set_timestamp_sec(publish_time); image_message.set_width(mat_image.cols); image_message.set_height(mat_image.rows); image_message.set_step(3 * mat_image.cols); image_message.set_data(mat_image.data, mat_image.size[0] * mat_image.size[1] * mat_image.channels()); camera_image_output_writer_[camera_name]->Write(image_message); } return cyber::SUCC; } 如何将bev的WriteResultImageMessage融入到lane组件里,通过广播将已经检测出的车道线数据塞到camera_image_output_writer_里。 这是lane组件的一部分代码: void LaneDetectionComponent::OnReceiveImage( const std::shared_ptr<apollo::drivers::Image> &message, const std::string &camera_name) { std::lock_guard<std::mutex> lock(mutex_); const double msg_timestamp = message->measurement_time() + timestamp_offset_; AINFO << "Enter LaneDetectionComponent::Proc(), camera_name: " << camera_name << " image ts: " << msg_timestamp; // timestamp should be almost monotonic if (last_timestamp_ - msg_timestamp > ts_diff_) { AINFO << "Received an old message. Last ts is " << std::setprecision(19) << last_timestamp_ << " current ts is " << msg_timestamp << " last - current is " << last_timestamp_ - msg_timestamp; return; } last_timestamp_ = msg_timestamp; ++seq_num_; // for e2e lantency statistics { const double cur_time = Clock::NowInSeconds(); const double start_latency = (cur_time - message->measurement_time()) * 1e3; AINFO << "FRAME_STATISTICS:Camera:Start:msg_time[" << camera_name << "-" << FORMAT_TIMESTAMP(message->measurement_time()) << "]:cur_time[" << FORMAT_TIMESTAMP(cur_time) << "]:cur_latency[" << start_latency << "]"; } // protobuf msg std::shared_ptr<apollo::perception::PerceptionLanes> out_message( new (std::nothrow) apollo::perception::PerceptionLanes); apollo::common::ErrorCode error_code = apollo::common::OK; // prefused msg std::shared_ptr<SensorFrameMessage> prefused_message(new (std::nothrow) SensorFrameMessage); if (InternalProc(message, camera_name, &error_code, prefused_message.get(), out_message.get()) != cyber::SUCC) { AERROR << "InternalProc failed, error_code: " << error_code; return; } WriteResultImageMessage // for e2e lantency statistics { const double end_timestamp = Clock::NowInSeconds(); const double end_latency = (end_timestamp - message->measurement_time()) * 1e3; AINFO << "FRAME_STATISTICS:Camera:End:msg_time[" << camera_name << "-" << FORMAT_TIMESTAMP(message->measurement_time()) << "]:cur_time[" << FORMAT_TIMESTAMP(end_timestamp) << "]:cur_latency[" << end_latency << "]"; } }
6ade7f79dd549f414668f209cd2ca5cc
{ "intermediate": 0.39284756779670715, "beginner": 0.33933135867118835, "expert": 0.26782113313674927 }
29,855
what is wrong with this code? console.log([3] == [3]);
91a1149036dfe1ef9cecc428a585c1f2
{ "intermediate": 0.16589926183223724, "beginner": 0.7186332941055298, "expert": 0.1154673844575882 }
29,856
优化这段代码 Inventory inv = Bukkit.createInventory(null,54 , CommuneMain.config.getString("GuiTitle.ApplyDisposeGui")+"§c§"+page); List<Apply> applys = ApplyConn.getCommuneApply(CPlayerData.getCPlayer(player.getName()).getCommuneName()); for(int i = 0;i<7;i++){ int invSlot = i+10; int listSlot = i+((page-1)*21); if(applys.size()>listSlot){ Apply apply = applys.get(listSlot); ItemStack book = bookOri.clone(); List<String> lore = book.getLore(); assert lore != null; Util.ChangeLore(lore,"%player_name%",apply.getPlayerName()); Util.ChangeLore(lore, "%luckperms_prefix%", apply.getPrefix()); String time = sdf.format(new Date(apply.getApplyTime())); String[] times = time.split("/"); Util.ChangeLore(lore, "%y%", times[0]); Util.ChangeLore(lore, "%m%", times[1]); Util.ChangeLore(lore, "%d%", times[2]); book.setLore(lore); inv.setItem(invSlot,book); } } for(int i = 0;i<7;i++){ int invSlot = i+19; int listSlot = i+((page-1)*21)+7; if(applys.size()>listSlot){ Apply apply = applys.get(listSlot); ItemStack book = bookOri.clone(); List<String> lore = book.getLore(); assert lore != null; Util.ChangeLore(lore,"%player_name%",apply.getPlayerName()); Util.ChangeLore(lore, "%luckperms_prefix%", apply.getPrefix()); String time = sdf.format(new Date(apply.getApplyTime())); String[] times = time.split("/"); Util.ChangeLore(lore, "%y%", times[0]); Util.ChangeLore(lore, "%m%", times[1]); Util.ChangeLore(lore, "%d%", times[2]); book.setLore(lore); inv.setItem(invSlot,book); } } for(int i = 0;i<7;i++){ int invSlot = i+28; int listSlot = i+((page-1)*21)+14; if(applys.size()>listSlot){ Apply apply = applys.get(listSlot); ItemStack book = bookOri.clone(); List<String> lore = book.getLore(); assert lore != null; Util.ChangeLore(lore,"%player_name%",apply.getPlayerName()); Util.ChangeLore(lore, "%luckperms_prefix%", apply.getPrefix()); String time = sdf.format(new Date(apply.getApplyTime())); String[] times = time.split("/"); Util.ChangeLore(lore, "%y%", times[0]); Util.ChangeLore(lore, "%m%", times[1]); Util.ChangeLore(lore, "%d%", times[2]); book.setLore(lore); inv.setItem(invSlot,book); } } inv.setItem(49,paperOri); inv.setItem(53,arrowsOri); player.openInventory(inv);
f120ffa7407fb81716326bcee44cf6db
{ "intermediate": 0.28746822476387024, "beginner": 0.5357776880264282, "expert": 0.17675413191318512 }
29,857
Combine .key and .pem certificate files to create .jks file for Apache zeppelin server side SSL configuration
323754897dd3388cbb5e959cf1065822
{ "intermediate": 0.38622763752937317, "beginner": 0.21544423699378967, "expert": 0.39832812547683716 }
29,858
how I make a drag and drop option that with moving one node the children move as well with sigma.js in html css js platfrom?
883d3be3a3b301ec2ce5b3cb86805a28
{ "intermediate": 0.6334591507911682, "beginner": 0.10875645279884338, "expert": 0.2577843964099884 }
29,859
I sued this code: def signal_generator(df): if df is None or len(df) < 2: return '' signal = [] final_signal = [] # Retrieve depth data th = 0.35 depth_data = client.depth(symbol=symbol) bid_depth = depth_data['bids'] ask_depth = depth_data['asks'] buy_price = float(bid_depth[0][0]) if bid_depth else 0.0 sell_price = float(ask_depth[0][0]) if ask_depth else 0.0 mark_price_data = client.ticker_price(symbol=symbol) mark_price = float(mark_price_data['price']) if 'price' in mark_price_data else 0.0 mark_price_data_change = client.ticker_24hr_price_change(symbol=symbol) mark_price_percent = float(mark_price_data_change['priceChangePercent']) if 'priceChangePercent' in mark_price_data_change else 0.0 buy_qty = float(bid_depth[0][1]) if bid_depth else 0.0 sell_qty = float(ask_depth[0][1]) if ask_depth else 0.0 # Calculate the threshold for order price deviation if mark_price_percent > 2: pth = 7 / 100 elif mark_price_percent < -2: pth = 7 / 100 else: pth = 7 / 100 executed_orders_buy = 0.0 for order in bid_depth: if float(order[0]) == mark_price: executed_orders_buy += float(order[1]) else: break buy_qty = float(bid_depth[0][1]) if bid_depth else 0.0 buy_result = buy_qty - executed_orders_buy executed_orders_sell = 0.0 for order in ask_depth: if float(order[0]) == mark_price: executed_orders_sell += float(order[1]) else: break sell_qty = float(ask_depth[0][1]) if ask_depth else 0.0 sell_result = sell_qty - executed_orders_sell if (sell_result > (1 + th) > float(buy_qty)) and (sell_price < mark_price - (pth + 0.08)): signal.append('sell') elif (buy_result > (1 + th) > float(sell_qty)) and (buy_price > mark_price + (pth + 0.08)): signal.append('buy') else: signal.append('') if signal == ['buy'] and not ((buy_result < sell_qty) and (buy_price < mark_price)): final_signal.append('buy') elif signal == ['sell'] and not ((sell_result < buy_qty) and (sell_price > mark_price)): final_signal.append('sell') else: final_signal.append('') if final_signal == ['buy']: active_signal = 'buy' elif final_signal == ['sell']: active_signal = 'sell' else: active_signal = None return final_signal You need to add in my code those params: if active_signal == 'buy' and ((buy_result < sell_qty) and (buy_price < mark_price)):final_signal.append('buy_exit') elif active_signal == 'sell' and ((sell_result < buy_qty ) and (sell_price > mark_price)) final_signal.append('sell_exit) else: final_signal.append('')
941849a9c8a5c17ff9e8290cdf5a5c7f
{ "intermediate": 0.3212837874889374, "beginner": 0.44008177518844604, "expert": 0.23863443732261658 }
29,860
Please write me a portfolio website for a producer named John Stanley
c9c0457eb4e18d0ceed3f83a2d97acf8
{ "intermediate": 0.35840651392936707, "beginner": 0.28764209151268005, "expert": 0.3539513647556305 }
29,861
how to use pymorphy2 with whoosh=2.7.4
19222a92f02240f28f9d04db9e3b7399
{ "intermediate": 0.42209815979003906, "beginner": 0.21983572840690613, "expert": 0.3580661118030548 }
29,862
hey i have gmod lua code that adds postal 2 petition to the game and it gives me error when im in first person view heres the error "[rupostalpetition] addons/rupostalpetition/lua/weapons/weapon_postalpetition/shared.lua:104: bad argument #1 to 'GetBonePosition' (number expected, got no value) 1. GetBonePosition - [C]:-1 2. unknown - addons/rupostalpetition/lua/weapons/weapon_postalpetition/shared.lua:104" and heres the code
891b7825e97ef4db959bf82c4d8280d8
{ "intermediate": 0.4747123420238495, "beginner": 0.2529606521129608, "expert": 0.2723269760608673 }
29,863
clc clear ness=2; T=24; Max_Dt=300; D=26ness;%搜索空间维数(未知数个数) N=100;%粒子数 Pessmax=ones(N,Tness);%充放电 Pessmin=-Pessmax; ESSmax=2.5ones(N,ness);%容量 ESSmin=0.5ones(N,ness); ESS=zeros(N,ness); xsitemax=33ones(N,ness); xsitemin=2ones(N,ness); X_max=[Pessmax ESSmax xsitemax]; X_min=[Pessmin ESSmin xsitemin]; v_1max=0.5ones(N,Tness); v_1min=-v_1max; v_2max=0.5ones(N,ness); v_2min=-v_2max; v_3max=31ones(N,ness); v_3min=-v_3max; V_max=[v_1max v_2max v_3max]; V_min=[v_1min v_2min v_3min]; w_max=0.9; w_min=0.4; %%%%%粒子初始化%%%%% x=Pessmin+rand(N,Tness).(Pessmax-Pessmin); ESS=ESSmin+rand(N,ness).(ESSmax-ESSmin); xsite = round(xsitemin+rand(N,ness).(xsitemax-xsitemin)); %初始种群的位置(节点位置)四舍五入取整 v1=v_1min+rand(N,Tness).(v_1max-v_1min); v2=v_2min+rand(N,ness).(v_2max-v_2min); v3=v_3min+rand(N,ness).(v_3max-v_3min); X=[x ESS xsite]; V=[v1 v2 v3]; % 储能约束 SOC1=zeros(N,T+1); %SOC SOC1(:,1)=0.5ESS(:,1); %初始容量设为50%总容量 SOC2=zeros(N,T+1); SOC2(:,1)=0.5ESS(:,2); for i=1:N %储能容量约束设为20%~90% for t=1:T if t==24 X(i,24)=-sum(X(i,1:23),2);%保证储能充放电平衡 X(i,48)=-sum(X(i,25:47),2);%保证储能充放电平衡 end SOC1(i,t+1)=SOC1(i,t)-X(i,t); if SOC1(i,t+1)<0.2X(i,49) X(i,t)=SOC1(i,t)-0.2X(i,49); SOC1(i,t+1)=SOC1(i,t)-X(i,t); elseif SOC1(i,t+1)>0.9X(i,49) X(i,t)=SOC1(i,t)-0.9X(i,49); SOC1(i,t+1)=SOC1(i,t)-X(i,t); end SOC2(i,t+1)=SOC2(i,t)-X(i,t+T); if SOC2(i,t+1)<0.2X(i,50) X(i,t+T)=SOC2(i,t)-0.2X(i,50); SOC2(i,t+1)=SOC2(i,t)-X(i,t+T); elseif SOC2(i,t+1)>0.9X(i,50) X(i,t+T)=SOC2(i,t)-0.9X(i,50); SOC2(i,t+1)=SOC2(i,t)-X(i,t+T); end end end % 初始化pbest和gbest for i=1:N fitness(i)=evaluationl2(X(i,:),T); end [fitnessgbest, bestindex]=min(fitness); gbest=X(bestindex,:); pbest=X; fitnesspbest=fitness; soc1=SOC1(bestindex,:); soc2=SOC2(bestindex,:); % 迭代 for k=1:Max_Dt for i=1:N for j=1:D w=w_max-(w_max-w_min)k/Max_Dt;%惯性权重更新 c1=(0.5-2.5)k/Max_Dt+2.5; %认知 c2=(2.5-0.5)k/Max_Dt+0.5; %社会认识 V(i,j)=wV(i,j)+c1rand(pbest(i,j)-X(i,j))+c2rand(gbest(1,j)-X(i,j)); if V(i,j)>V_max(i,j) V(i,j)=V_max(i,j); elseif V(i,j)<V_min(i,j) V(i,j)=V_min(i,j); end end X(i,:)=X(i,:)+V(i,:); X(i,51:52)=round(X(i,51:52)); %对粒子边界处理***************************** for n=1:D if X(i,n)>X_max(i,n) X(i,n)=X_max(i,n); V(i,n)=-V(i,n); elseif X(i,n)<X_min(i,n) X(i,n)=X_min(i,n); V(i,n)=-V(i,n); end end for t=1:T if t==24 X(i,24)=-sum(X(i,1:23),2);%保证储能充放电平衡 X(i,48)=-sum(X(i,25:47),2);%保证储能充放电平衡 end SOC1(i,1)=0.5X(i,49); SOC1(i,t+1)=SOC1(i,t)-X(i,t); if SOC1(i,t+1)<0.2X(i,49) X(i,t)=SOC1(i,t)-0.2X(i,49); SOC1(i,t+1)=SOC1(i,t)-X(i,t); elseif SOC1(i,t+1)>0.9X(i,49) X(i,t)=SOC1(i,t)-0.9X(i,49); SOC1(i,t+1)=SOC1(i,t)-X(i,t); end SOC2(i,1)=0.5X(i,50); SOC2(i,t+1)=SOC2(i,t)-X(i,t+T); if SOC2(i,t+1)<0.2X(i,50) X(i,t+T)=SOC2(i,t)-0.2X(i,50); SOC2(i,t+1)=SOC2(i,t)-X(i,t+T); elseif SOC2(i,t+1)>0.9X(i,50) X(i,t+T)=SOC2(i,t)-0.9X(i,50); SOC2(i,t+1)=SOC2(i,t)-X(i,t+T); end end %对粒子进行评价,寻找最优值****************** fitness(i)=evaluationl2(X(i,:),T); if fitness(i)<fitnesspbest(i) pbest(i,:)=X(i,:); fitnesspbest(i)=fitness(i); end if fitness(i)<fitnessgbest gbest=X(i,:); fitnessgbest=fitness(i); soc1=SOC1(i,:); soc2=SOC2(i,:); end record(1,i)=fitnessgbest; Xrecord(i,:)=X(i,:); plot(X()) end fprintf(1,‘迭代数: %d, 最好: %.4f\n’, k,fitnessgbest); best(k)=fitnessgbest; end 以上为粒子群算法进行配电网储能选址定容的代码,运行后两个储能接入位置相同,具体如何编写代码可以使两个储能的接入位置不同
633544e81fd732f41e10f0158b401a6e
{ "intermediate": 0.27940669655799866, "beginner": 0.49003472924232483, "expert": 0.23055854439735413 }
29,864
write python code to count running processes python
921da9a84e8e75c170f69c2124de24c6
{ "intermediate": 0.4330196678638458, "beginner": 0.2521524429321289, "expert": 0.31482788920402527 }
29,865
Write a program ReverseArray.java that reverses an array of numbers of any length entered by the user. a) The program should ask the user how many numbers should be read from the command line. b) The program will then ask to enter each number. c) The program prints the entered array and the array in reverse order e. g., [1, 2, 3] [3, 2, 1] d) For printing, import java.util.Arrays and use Arrays.toString().
8e238ff16db2ea5cd2ff798636383c76
{ "intermediate": 0.5214717388153076, "beginner": 0.22625800967216492, "expert": 0.25227031111717224 }
29,866
I have a Python pandas dataframe with columns ["RUN_DATE", "COUNTRY", "VAL1", "VAL2", "VAL3"]. RUN_DATE can take either 31/1/2023 or 28/2/2023. COUNTRY can be either "US", "CANADA" or "GERMANY". VAL1, VAL2, VAL3 are real numbers. How do I add new rows to the dataframe that shows the difference in the value parameters from 31/1/2023 to 28/2/2023? I
59cfbc2d453fc1090b6441dc4667ecfd
{ "intermediate": 0.6433215737342834, "beginner": 0.13770624995231628, "expert": 0.21897222101688385 }
29,867
How deploy microservice endpoints using AWS?
5c08430eef092bc6bd4ab2d0ee8e9b2e
{ "intermediate": 0.6264846324920654, "beginner": 0.17712511122226715, "expert": 0.19639022648334503 }
29,868
что здесь? <input type="hidden" name="id" id="search-partnerId" value="${searchFilter.id}"/>
1d378f7252be4845f20b3f00fd760930
{ "intermediate": 0.3375966250896454, "beginner": 0.2330298125743866, "expert": 0.4293735921382904 }
29,869
Create a program BestBikeCustomers.java for BestBike Customer Management. The program uses the class Customer that contains the following attributes. CustomerID, Name, Surname, Age, City, PostalCode, Street, Phone, E-Mail The Customer Management program creates two customers, initializes the attributes with test data and prints out the customer data/attributes on the screen.
643e2495439a6814759296ad06728153
{ "intermediate": 0.5072277784347534, "beginner": 0.26557236909866333, "expert": 0.22719985246658325 }
29,870
position fixed without remove from flow
ca6098bd777028f17c1ee9461b9aaaa0
{ "intermediate": 0.41170060634613037, "beginner": 0.31942394375801086, "expert": 0.2688754200935364 }
29,871
how to apply pymorphy2 with whoosh=2.7.4
6248d8c7a588f52b7b5b56aa5d96ec1c
{ "intermediate": 0.2920427918434143, "beginner": 0.22691746056079865, "expert": 0.48103973269462585 }
29,872
В систему загружен следующий код: class EasyClass { private: std::string answer = "you don't know how to break it"; public: std::string GetAnswer() const { return answer; } }; /* Сюда будет вставлен весь ваш код */ int main() { EasyClass res = SolverFunction(); assert(res.GetAnswer() == "but i know how to deal with it"); } Предполагается, что вы реализуете функцию SolverFunction. В систему отправляйте код функции SolverFunction, а также любой другой код, который поможет решить задачу
45e4f695d5af20899d4d9d54ab421680
{ "intermediate": 0.24475786089897156, "beginner": 0.6327037215232849, "expert": 0.12253837287425995 }
29,873
write a method in java which loops through a string and then displays its contents
975293cb125374649718665426219c32
{ "intermediate": 0.24208620190620422, "beginner": 0.672163724899292, "expert": 0.08575008064508438 }
29,874
что за ошибка Traceback (most recent call last): File "D:\WIN\PY\MY\FTP_Scan\test.py", line 40, in <module> ftp = FTP(ip_address, timeout=2) File "C:\Users\1\AppData\Local\Programs\Python\Python310\lib\ftplib.py", line 121, in __init__ self.connect(host) File "C:\Users\1\AppData\Local\Programs\Python\Python310\lib\ftplib.py", line 158, in connect self.sock = socket.create_connection((self.host, self.port), self.timeout, File "C:\Users\1\AppData\Local\Programs\Python\Python310\lib\socket.py", line 824, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): File "C:\Users\1\AppData\Local\Programs\Python\Python310\lib\socket.py", line 955, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno 11001] getaddrinfo failed
b45f34d72e4f94c49f7748329091f761
{ "intermediate": 0.4116085171699524, "beginner": 0.3766905665397644, "expert": 0.211700901389122 }
29,875
how can i get leaflet.js to map longitude, latitude rather than latititude, longitude
4b389bfacbc0d21727164710b112394a
{ "intermediate": 0.5689190626144409, "beginner": 0.1903384029865265, "expert": 0.240742489695549 }
29,876
Write Tensorflow Python code to convert a character array (text) into a one-hot representation. Here is the current code that embeds the text into another representation: ### Vectorize the text Before training, you need to convert the strings to a numerical representation. The `tf.keras.layers.StringLookup` layer can convert each character into a numeric ID. It just needs the text to be split into tokens first. example_texts = ['abcdefg', 'xyz'] chars = tf.strings.unicode_split(example_texts, input_encoding='UTF-8') chars Now create the `tf.keras.layers.StringLookup` layer: ids_from_chars = tf.keras.layers.StringLookup( vocabulary=list(vocab), mask_token=None) It converts from tokens to character IDs: ids = ids_from_chars(chars) ids Since the goal of this tutorial is to generate text, it will also be important to invert this representation and recover human-readable strings from it. For this you can use `tf.keras.layers.StringLookup(..., invert=True)`. Note: Here instead of passing the original vocabulary generated with `sorted(set(text))` use the `get_vocabulary()` method of the `tf.keras.layers.StringLookup` layer so that the `[UNK]` tokens is set the same way. chars_from_ids = tf.keras.layers.StringLookup( vocabulary=ids_from_chars.get_vocabulary(), invert=True, mask_token=None) This layer recovers the characters from the vectors of IDs, and returns them as a `tf.RaggedTensor` of characters: chars = chars_from_ids(ids) chars You can `tf.strings.reduce_join` to join the characters back into strings. tf.strings.reduce_join(chars, axis=-1).numpy() def text_from_ids(ids): return tf.strings.reduce_join(chars_from_ids(ids), axis=-1)
8a202717571d5d7812421916a3fee878
{ "intermediate": 0.4161282479763031, "beginner": 0.1652408093214035, "expert": 0.4186309576034546 }
29,877
defmodule Lasagna do # Please define the 'expected_minutes_in_oven/0' function def expected_minutes_in_oven, do: 40 # Please define the 'remaining_minutes_in_oven/1' function def remaining_minutes_in_oven(minutes) do expected_minutes_in_oven - minutes end # Please define the 'preparation_time_in_minutes/1' function # Please define the 'total_time_in_minutes/2' function # Please define the 'alarm/0' function end
eb957bcd1a770fe8fc146dd55e970f62
{ "intermediate": 0.16080300509929657, "beginner": 0.7182912230491638, "expert": 0.12090582400560379 }
29,878
how do I write a for loop that loops through the words in a .txt file and takes out the spaces
2b9c93f772181d96b6fb3fff37567510
{ "intermediate": 0.15132413804531097, "beginner": 0.7397818565368652, "expert": 0.108893983066082 }
29,879
The program should provide the following functionality: • You can create up to 20 components (in an array!) that will have the attributes defined above (use a class Component and its objects). • When you run the program, first initialize the component array with component objects. • The user can enter new data for one or several components (Menu item 1 = Enter Component Information). • You can print out the information of the selected component (Menu item 2 = Print Component Information). • You can choose another component with the Component ID and enter/change its data or print it out.
5d72bf1f9920234e9a02721928e239dd
{ "intermediate": 0.41475990414619446, "beginner": 0.2609613239765167, "expert": 0.3242788016796112 }
29,880
how create new repository on github by cmd
1b8cf6a412703edfa02dd7eaadf973d5
{ "intermediate": 0.40955662727355957, "beginner": 0.1809476763010025, "expert": 0.4094957113265991 }
29,881
In tensorflow keras, what does this line do: self.embedding = tf.keras.layers.Embedding(vocab_size, embedding_dim)?
2fb9b3621e6aa60d35491a5a72c3e70f
{ "intermediate": 0.4110725224018097, "beginner": 0.17585842311382294, "expert": 0.41306906938552856 }
29,882
Hi
5f689c56c80f94e9e01739105a4b7518
{ "intermediate": 0.33010533452033997, "beginner": 0.26984941959381104, "expert": 0.400045245885849 }
29,883
Напиши код на Python c помощью Pandas. По заданию нужно скачаить с ресурса kaggle.com датасет cwurData.csv, содержащий мировые рейтинги университетов (допустим я скачал). Создайте из этих данных DataFrame. Выберите в отдельный DataFrame все университеты Японии, Израиля, Германии, Франции и России. Выведите круговую диаграмму числа студентов в этих университетах для каждой страны. Рядом постройте диаграмму рассеяния в осях «влияние - качество образования» (influence – quality of education), размер маркера пропорционален числу студентов, цвет – соответствует стране
66db2ba02904b9f9f206ba870f9d66b9
{ "intermediate": 0.3530554473400116, "beginner": 0.33465421199798584, "expert": 0.3122903108596802 }
29,884
Hi. Is it possible to copy files from docker container to host machine?
30625412528b118f236963c70648d57d
{ "intermediate": 0.5011513233184814, "beginner": 0.20187537372112274, "expert": 0.296973317861557 }
29,885
Proxy config for pulling image from external registry using postman pull
c93aa6173b73a9ad14133f56c77e3ed6
{ "intermediate": 0.35778334736824036, "beginner": 0.2470337599515915, "expert": 0.39518284797668457 }
29,886
Hello
3ce8438248a3d71994c512cb76f0e5c9
{ "intermediate": 0.3123404085636139, "beginner": 0.2729349136352539, "expert": 0.4147246778011322 }
29,887
dans la fonction "proposeWord", comment tester la validation de l'adresse avec "isPlayer2Turn" : " require(msg.sender == games[_gameId].player1 || (msg.sender == games[_gameId].player2 && games[_gameId].isPlayer2Turn),"invalid address");" la fonction : " function proposeWord(uint256 _gameId, string memory _wordToGuess, string memory _letterToGuess) public { require(state == State.inProgress, "Bad State"); require(msg.sender == games[_gameId].player1 || (msg.sender == games[_gameId].player2 && games[_gameId].isPlayer2Turn),"invalid address"); require(playerBalances[_gameId][msg.sender].balance > 0, "you didn't bet"); string memory filteredWord = wordFiltered(_wordToGuess); if (isWordCorrect(filteredWord)) { games[_gameId].winner = msg.sender; addBetToPlayer(_gameId, msg.sender); emit WordWin(_gameId, filteredWord); emit GameFinished(_gameId); state = State.finished; } else { if (msg.sender == games[_gameId].player2) { games[_gameId].isPlayer2Turn = false; proposeLetter(_gameId, _letterToGuess, _wordToGuess); } else { if (msg.sender == games[_gameId].player1) { games[_gameId].isPlayer2Turn = true; proposeLetter(_gameId, _letterToGuess, _wordToGuess); } } } }" le test "context ("FONCTION POUR DEVINER UN MOT", () => { beforeEach(async function() { penduelInstance = await Penduel.new(subId); const value = web3.utils.toWei("1", "ether"); await penduelInstance.createGame({ from: player2 }); await penduelInstance.joinGame({ from: player1 }); await penduelInstance.deposit({ from: player2, value: value }); await penduelInstance.deposit({ from: player1, value: value }); }); describe ("Vérifie la fonction proposeWord", () => { it("doit permettre à un joueur de proposer un mot correct et de gagner", async () => { const gameId = 1; const currentWord = "immuable"; await penduelInstance.updateStateInProgress(); const receipt = await penduelInstance.proposeWord(gameId, "immuable", "i", {from: player2}); const updatedGameState = await penduelInstance.state(); const isWordCorrect = await penduelInstance.getIsWordCorrect(currentWord); if (isWordCorrect) { assert.equal(updatedGameState, 6, "L'état devrait être finished"); const winner = await penduelInstance.getWinner(gameId); assert.equal(winner, player2, "Le player2 devrait être enregistré comme gagnant"); } else { assert.equal(updatedGameState, 5, "L'état devrait rester inProgress"); } if (isWordCorrect) { let wordWinEvent = await penduelInstance.WordWin(); assert.equal(wordWinEvent.length, 1); assert.equal(wordWinEvent[0].args.gameId, gameId); assert.equal(wordWinEvent[0].args.filteredWord, "immuable"); expectEvent(receipt, "GameFinished", { gameId: gameId }) } }); "
354df94277e74fb6dfe2b533879a1623
{ "intermediate": 0.3607184886932373, "beginner": 0.47033780813217163, "expert": 0.16894368827342987 }
29,888
write a md file for git hub for a ui css for a game and add link to live demo
1b785c88928916e59770d8580f23bacb
{ "intermediate": 0.44123131036758423, "beginner": 0.2641601264476776, "expert": 0.29460859298706055 }
29,889
tic tac toe
9d2d4f1357666a15bcbf829a47fe8f5f
{ "intermediate": 0.3972510099411011, "beginner": 0.4235629141330719, "expert": 0.1791861206293106 }
29,890
Create a simple contacts app in Android Studio. It only saves names and phone numbers. - The first screen should let me add, select or search for a contact. use SearchView for searching - If I select an existing contact, it puts me into a Second Screen that should let me edit, save or delete the selected contact.
8d4e43f15dd704d36e5e1e90b6d0443e
{ "intermediate": 0.4665026366710663, "beginner": 0.24821434915065765, "expert": 0.28528305888175964 }
29,891
Create a simple contacts app in Android Studio. It only saves names and phone numbers. - The first screen should let me add, select or search for a contact. use SearchView for searching. A button should be there to let me add a contact - If I select an existing contact, it puts me into a Second Screen that should let me edit, save or delete the selected contact.
60c3e9299e8b2488c06de5d7543803de
{ "intermediate": 0.44242727756500244, "beginner": 0.2154655158519745, "expert": 0.3421071767807007 }
29,892
Create a simple contacts app in Android Studio in Java Code. It only saves names and phone numbers. - The first screen should let me add, select or search for a contact. Use SearchView to search contacts. A button should be there to let me add a contact - If I select an existing contact, it puts me into a Second Screen that should let me edit, save or delete the selected contact.
05a25bb69750ae8bfbbfc82a737e21a6
{ "intermediate": 0.5212290287017822, "beginner": 0.1953161060810089, "expert": 0.283454954624176 }
29,893
necesito generar los unit test para el siguiente fragmento de código using System; using System.Collections.Generic; using System.Threading.Tasks; using AutoMapper; using Microsoft.Extensions.Logging; using Newtonsoft.Json; using Spv.Usuarios.Bff.Common.Constants; using Spv.Usuarios.Bff.Common.Dtos.Service.ConfiguracionService.Input; using Spv.Usuarios.Bff.Common.Dtos.Service.ConfiguracionService.Output; using Spv.Usuarios.Bff.Common.Errors; using Spv.Usuarios.Bff.Common.ExternalResponses; using Spv.Usuarios.Bff.Common.LogEvents; using Spv.Usuarios.Bff.DataAccess.ExternalWebService.Interfaces; using Spv.Usuarios.Bff.Domain.Errors; using Spv.Usuarios.Bff.Domain.Exceptions; using Spv.Usuarios.Bff.Domain.Services; using Spv.Usuarios.Bff.Service.Interface; namespace Spv.Usuarios.Bff.Service { public class ConfiguracionService : IConfiguracionService { private readonly ILogger<ConfiguracionService> _logger; private readonly IApiUsuariosRepositoryV2 _apiUsuariosRepositoryV2; private readonly IMapper _mapper; public ConfiguracionService( ILogger<ConfiguracionService> logger, IApiUsuariosRepositoryV2 apiUsuariosRepositoryV2, IMapper mapper ) { _logger = logger; _apiUsuariosRepositoryV2 = apiUsuariosRepositoryV2; _mapper = mapper; } public async Task<IResponse<LoginHabilitadoModelOutput>> LoginHabilitadoAsync( IRequestBody<LoginHabilitadoModelInput> LoginModel) { try { var LoginHabilitado = await ConfiguracionDigitalCredentialsAsync(AppConstants.LogInDisabled); if (LoginHabilitado == null) { return Responses.NotFound<LoginHabilitadoModelOutput>(ErrorCode.LoginHabilitado.ErrorDescription); } var result = new LoginHabilitadoModelOutput(); if ((string)LoginHabilitado.Value == "0") { result.Habilitado = (string)LoginHabilitado.Value; return Responses.Ok(result); } else if ((string)LoginHabilitado.Value == "1" || (string)LoginHabilitado.Value == "2") { var LoginDefaultMessaje = await ConfiguracionDigitalCredentialsAsync(AppConstants.LogInDisabledMessage); if (string.IsNullOrEmpty(LoginDefaultMessaje.Description)) { LoginDefaultMessaje = await ConfiguracionDigitalCredentialsAsync(AppConstants.LogInDefaultDisabledMessage); } result.Mensaje = LoginDefaultMessaje.Description; result.Habilitado = (string)LoginHabilitado.Value; } else { return Responses.NotFound<LoginHabilitadoModelOutput>(ErrorCode.LoginHabilitadoFueraDeRango .ErrorDescription); } return Responses.Ok(result); } catch (Exception ex) { _logger.LogError(ConfiguracionServiceEvents.ExceptionCallingLoginHabilitado, ex.Message, ex); throw; } } public async Task<IResponse<ConfiguracionModelOutput>> ConfiguracionAsync( IRequestBody<ConfiguracionModelInput> configuracionInput ) { var (Config, Error) = await ConfiguracionAsync(configuracionInput.Body); if (Error != null) { return Responses.Error<ConfiguracionModelOutput>( Error.Codigo, _mapper.Map<List<InternalCodeAndDetailErrors>>(Error.Errores) ); } return Responses.Ok(Config); } public async Task<ConfiguracionModelOutput> ConfiguracionDigitalCredentialsAsync(string name) { var (Config, Error) = await ConfiguracionAsync(new ConfiguracionModelInput { Type = AppConstants.DigitalCredentials, Name = name }); if (Error != null) { throw new BusinessException(Error.Detalle, Error.Codigo); } return Config; } private async Task<(ConfiguracionModelOutput Config, ApiUsuariosErrorResponse Error)> ConfiguracionAsync(ConfiguracionModelInput configuracionInput) { try { var response = await _apiUsuariosRepositoryV2.ObtenerConfiguracionAsync(configuracionInput); var content = await response.Content.ReadAsStringAsync(); if (!response.IsSuccessStatusCode) { var error = JsonConvert.DeserializeObject<ApiUsuariosErrorResponse>(content); return (null, error); } var result = JsonConvert.DeserializeObject<ConfiguracionModelOutput>(content); return (result, null); } catch (Exception ex) { _logger.LogError(ex, ConfiguracionServiceEvents.ExceptionConfiguracionMessage); throw; } } } }
da39bc05e5713eeae95b1f8319b92c9f
{ "intermediate": 0.4139297604560852, "beginner": 0.38456082344055176, "expert": 0.20150937139987946 }
29,894
made some progbar code here that need to be upfated in messages. the idea is to show messages in dependence of time passed, and the more time passed, the more it's reflected in overall message. do you understand or got the concept I described?:
1150e62633c48fcfc85bff2c0b713457
{ "intermediate": 0.38066303730010986, "beginner": 0.2278997302055359, "expert": 0.39143720269203186 }
29,895
Create a simple contacts app in Android Studio in Java Code. It only saves names and phone numbers. - The first screen should let me add, select or search for a contact. Use SearchView to search contacts and ListView to list the contacts. A button should be there to let me add a contact - If I select an existing contact, it puts me into a Second Screen that should let me edit, save or delete the selected contact.
a82e633342ab58a09a71c307456c6b9f
{ "intermediate": 0.5595957040786743, "beginner": 0.20162208378314972, "expert": 0.23878221213817596 }
29,896
using python make 3d game with cam move using glfw
bb0c052191f4a20a9be69c76a6312595
{ "intermediate": 0.4012317955493927, "beginner": 0.21616476774215698, "expert": 0.3826034665107727 }
29,897
Implement a tensorflow lstm example
240d22d5e97a317e9ea67e9b7c76a99b
{ "intermediate": 0.3405672609806061, "beginner": 0.1778872162103653, "expert": 0.4815455377101898 }
29,898
Implement a Tensorflow Python LSTM example by implementing a new class.
c3c450962530db799cdee38887e8e747
{ "intermediate": 0.23284438252449036, "beginner": 0.17319953441619873, "expert": 0.5939560532569885 }
29,899
Implement a Tensorflow Python LSTM example by implementing a new class without using keras sequential. You should adapt the following code snippet, replacing GRU with LSTM code: class CharRNN(tf.keras.Model): def init(self, vocab_size, embedding_dim, rnn_units): super().init(self) self.embedding = tf.keras.layers.Embedding(vocab_size, embedding_dim) self.gru = tf.keras.layers.Gru(rnn_units, return_sequences=True, return_state=True) self.dense = tf.keras.layers.Dense(vocab_size) def call(self, inputs, states=None, return_state=False, training=False): x = inputs x = self.embedding(x, training=training) if states is None: states = self.gru.get_initial_state(x) x, states = self.gru(x, initial_state=states, training=training) x = self.dense(x, training=training) if return_state: return x, states else: return x
0ea6f474efd49b7ce5ab123d0ea18a99
{ "intermediate": 0.35208526253700256, "beginner": 0.2556540071964264, "expert": 0.39226070046424866 }
29,900
Utilizing the following character set
46992797916f26a87e481a30dd1cfe5c
{ "intermediate": 0.3218715190887451, "beginner": 0.43303945660591125, "expert": 0.2450891137123108 }
29,901
Utilizing the following character set
c122b71132d099482daeb2416057ff7d
{ "intermediate": 0.3218715190887451, "beginner": 0.43303945660591125, "expert": 0.2450891137123108 }
29,902
peux tu me montrer le test ""devrait permettre au gagnant de retirer avec succès" suivant la fonction withdraw : " function withdraw(uint256 _gameId, uint256 _amount) public payable { require(state == State.finished, "game is not over"); require(msg.sender == games[_gameId].player1 || msg.sender == games[_gameId].player2, "You re not a player"); address winner = games[_gameId].winner; require(winner == msg.sender, "You are not the winner"); require(!games[_gameId].player1HasWithdrawn || !games[_gameId].player2HasWithdrawn, "withdrawn balance"); uint256 balance = playerBalances[_gameId][msg.sender].balance; require(balance >= _amount, "Insufficient balance"); playerBalances[_gameId][msg.sender].balance -= _amount; (bool success, ) = payable(msg.sender).call{value: _amount}(""); require(success, "The withdrawal failed"); if (msg.sender == games[_gameId].player1) { games[_gameId].player1HasWithdrawn = true; } else { games[_gameId].player2HasWithdrawn = true; } emit Withdraw(_gameId); }"
93522eff5f37a825fc0b616176ed79d9
{ "intermediate": 0.35361671447753906, "beginner": 0.38453832268714905, "expert": 0.2618449330329895 }
29,903
je veux tester la fonction "withdraw". voici la fonction précédent la fonction "withdraw" : "function proposeWord(uint256 _gameId, string memory _wordToGuess, string memory _letterToGuess) public { require(state == State.inProgress, "Bad State"); require(msg.sender == games[_gameId].player1 || (msg.sender == games[_gameId].player2 && games[_gameId].isPlayer2Turn),"invalid address"); require(playerBalances[_gameId][msg.sender].balance > 0, "you didn't bet"); string memory filteredWord = wordFiltered(_wordToGuess); if (isWordCorrect(filteredWord)) { games[_gameId].winner = msg.sender; addBetToPlayer(_gameId, msg.sender); emit WordWin(_gameId, filteredWord); emit GameFinished(_gameId); state = State.finished; } else { if (msg.sender == games[_gameId].player2) { games[_gameId].isPlayer2Turn = false; proposeLetter(_gameId, _letterToGuess, _wordToGuess); } else { if (msg.sender == games[_gameId].player1) { games[_gameId].isPlayer2Turn = true; proposeLetter(_gameId, _letterToGuess, _wordToGuess); } } } }" le fonction withdraxw à tester : " function withdraw(uint256 _gameId, uint256 _amount) public payable { require(state == State.finished, "game is not over"); require(msg.sender == games[_gameId].player1 || msg.sender == games[_gameId].player2, "You re not a player"); address winner = games[_gameId].winner; require(winner == msg.sender, "You are not the winner"); require(!games[_gameId].player1HasWithdrawn || !games[_gameId].player2HasWithdrawn, "withdrawn balance"); uint256 balance = playerBalances[_gameId][msg.sender].balance; require(balance >= _amount, "Insufficient balance"); playerBalances[_gameId][msg.sender].balance -= _amount; (bool success, ) = payable(msg.sender).call{value: _amount}(""); require(success, "The withdrawal failed"); if (msg.sender == games[_gameId].player1) { games[_gameId].player1HasWithdrawn = true; } else { games[_gameId].player2HasWithdrawn = true; } emit Withdraw(_gameId); }" le test " context ("FONCTION RETRAIT - GAGNANT", () => { before(async function() { penduelInstance = await Penduel.new(subId); const value = web3.utils.toWei("1", "ether"); await penduelInstance.createGame({ from: player2 }); await penduelInstance.joinGame({ from: player1 }); await penduelInstance.deposit({ from: player2, value: value }); await penduelInstance.deposit({ from: player1, value: value }); await penduelInstance.updateStateInProgress(); const isPlayer2Turn = true; if (assert(isPlayer2Turn, true, "No more guesses allowed")) { await penduelInstance.proposeWord(gameId, "immuable", "i", { from: player2 }); await penduelInstance.getIsWordCorrect("immuable"); const winner = await penduelInstance.games(gameId).winner; assert.equal(winner, player2, "Le joueur actuel devrait être déclaré comme gagnant."); const state = await penduelInstance.state(); assert.equal(state, finished, "L'état devrait être finished"); } }); describe ("Vérifie la fonction withdraw avec le gagnant", () => { it("devrait permettre au gagnant de retirer avec succès", async () => {"
90b6630da5b0cac4815eda2f6421bcdd
{ "intermediate": 0.33684200048446655, "beginner": 0.4155181050300598, "expert": 0.24763992428779602 }
29,905
in sdl2 C++, how do i resize the window without recreating it?
5cbabd6bea30d2fc479d6099e2a778a0
{ "intermediate": 0.5215597748756409, "beginner": 0.22781988978385925, "expert": 0.2506203353404999 }
29,906
using sigma.js, I can't catch the data of the node while working with click event, any solution?
3e1c7aa06c8eec74b1a83da09651f3f5
{ "intermediate": 0.8019525408744812, "beginner": 0.06706789880990982, "expert": 0.13097959756851196 }
29,908
how to apply pymorphy2 with whoosh=2.7.4 for russian language
fe3e796e43de9c3c428af09e56ce4b21
{ "intermediate": 0.2836827039718628, "beginner": 0.33019909262657166, "expert": 0.38611817359924316 }
29,909
Give the raw Postgres sql query from this python alembic code: op.create_table('stock_return_monthly', sa.Column('id', sa.Integer(), nullable=False), sa.Column('stock_series_id', sa.Integer(), nullable=False), sa.Column('calendar_begin_date', sa.Date(), nullable=True), sa.Column('calendar_end_date', sa.Date(), nullable=False), sa.PrimaryKeyConstraint('id', name=op.f('pk_stage_stock_return_monthly')), schema='staging' )
e9ed7cd15619330b0aef0796a75a9174
{ "intermediate": 0.3693521022796631, "beginner": 0.3843810260295868, "expert": 0.24626687169075012 }
29,910
I have the following SqlAlchemy data models: SCHEMA_NAME_STAGING = 'staging' SCHEMA_NAME_DATA = 'data' class AbstractBase: __abstract__ = True @declared_attr def __tablename__(cls): return to_underscored(cls.__name__) @classmethod def _generate_index(cls, is_unique, *columns, index_name=None): prefix = 'ux' if is_unique else 'ix' index_name = index_name or f'{prefix}_{cls.__tablename__}__{"__".join(columns)}' return Index(index_name, *columns, unique=is_unique) naming_convention = { "ix": 'ix_%(column_0_label)s', "uq": "uq_%(table_name)s_%(column_0_name)s", "fk": "fk_%(table_name)s_%(column_0_name)s_%(referred_table_name)s", "pk": "pk_%(table_name)s" } def get_Base(schema_name=None): kwargs = {} if schema_name: kwargs['schema'] = schema_name meta = MetaData(naming_convention=naming_convention, **kwargs) return declarative_base(cls=AbstractBase, metadata=meta) BaseStaging = get_Base(SCHEMA_NAME_STAGING) class StagingModel(BaseStaging): __abstract__ = True class StockReturnBase(StagingModel): __abstract__ = True id = Column(Integer, nullable=False, primary_key=True) stock_series_id = Column(Integer, nullable=False) class StockReturnDaily(StockReturnBase): begin_date = Column(Date(), nullable=False) end_date = Column(Date(), nullable=False) Now, turn the following SQL query into a SqlAlchemy Query SELECT d.stock_series_id AS stock_series_id, d.calendar_begin_date AS calendar_begin_date, d.calendar_end_date AS calendar_end_date FROM data.stock_return_monthly AS d INNER JOIN staging.stock_return_monthly AS s ON d.stock_series_id = s.stock_series_id AND d.calendar_begin_date = s.calendar_begin_date AND d.calendar_end_date = s.calendar_end_date
661cf191819b12bd57505a3a282b1d9b
{ "intermediate": 0.30977463722229004, "beginner": 0.3849121332168579, "expert": 0.30531319975852966 }
29,911
Hi
8ffa64f5687c72c009d58a9c562fcdd8
{ "intermediate": 0.33010533452033997, "beginner": 0.26984941959381104, "expert": 0.400045245885849 }
29,912
code example with "gui.is_enabled()" in Defold (Lua 5.1)
1a9c8128a4f3507012ea0e2ac024cf8e
{ "intermediate": 0.41778433322906494, "beginner": 0.299820214509964, "expert": 0.28239548206329346 }