Wednesday, June 23, 2021

Recent Questions - Stack Overflow

Recent Questions - Stack Overflow

Recent Questions - Stack Overflow


How to delete a debezium connector

Posted: 23 Jun 2021 11:02 AM PDT

How can I delete a debezium connector. I am following this tutorial https://debezium.io/documentation/reference/tutorial.html and I see the way to register a connector but couldn't figure out how to delete / update a connector.

curl -i -X POST -H "Accept:application/json" -H "Content-Type:application/json" localhost:8083/connectors/ -d '{ "name": "inventory-connector", "config": { "connector.class": "io.debezium.connector.mysql.MySqlConnector", "tasks.max": "1", "database.hostname": "mysql", "database.port": "3306", "database.user": "debezium", "database.password": "dbz", "database.server.id": "184054", "database.server.name": "dbserver1", "database.include.list": "inventory", "database.history.kafka.bootstrap.servers": "kafka:9092", "database.history.kafka.topic": "dbhistory.inventory" } }'  

Can you also please point to me to the documentation page where deleting and updating a connector is mentioned.

Undefined control sequence when usign \includepdf

Posted: 23 Jun 2021 11:02 AM PDT

I'm new with latex. I am trying to include a pdf file using overleaf and I don't know why I get several errors: "undefined control sequence", "pdf not found". I think I have uploaded de pdf right, I don't know what might be the problem.

I don't know how to copy the exact text of the error so I have attached some images.

I have read some posts about updating something in MikTex. I don't know what MikTex is and I don't know if I am using it.

This is the structure of my document:

\documentclass{article} % General document formatting \usepackage[margin=0.7in]{geometry} \usepackage[parfill]{parskip} \usepackage[utf8]{inputenc} \usepackage[final]{pdfpages}

% Related to math  \usepackage{amsmath,amssymb,amsfonts,amsthm}  

\begin{document}

Name, date, Exercise X

\section*{Part a}

\section*{Part b}

\includepdf[pages=1-2]{ProblemasPNG.pdf}

\end{document}

My code

Some errors

Some more errors

What does lightweight regular experiosn mean?

Posted: 23 Jun 2021 11:01 AM PDT

I have been learning regular expressions and came across term "lightweight" regular expressions. So, I have looked for it on this forum and also on Google, but could not find anything which defines the lightweightness of regular expression. What is different between lightweight and normal regular expression?

React router link with params do not redirect

Posted: 23 Jun 2021 11:01 AM PDT

When I'm on the page that uses param for example: /user/ant, I want to go to /delete, but my link adds to the /user and I'm getting /user/desiredLink

My routes code

<Route path="/user/:usr">      <User />  </Route>    <Route path="/user">      <User />  </Route>  

SQLite: add multiple rows to table from javascript with fixed value

Posted: 23 Jun 2021 11:01 AM PDT

I'm a newbie in databases, so I apologize in advance if this question is about something easy and obvious but I'm not able to figure alone. Basically, I'm trying to do what follows (for educational purpose, nothing related to anything "serious"):

I want to insert in a table multiple rows, querying the db with javascript, but the last entry of the row is "fixed" (I'm gonna explain what I mean few lines after).

Reading other threads here, I discovered I can insert multiple rows from js packing my data in an array of arrays querying the db like this

const values = [[...], [...], ... ]  const query = 'INSERT INTO mytable (val0, val1, val2, val3) VALUES ?'  db.run(query, [values], ...);  

Yet, what I want to do is inserting as last value of each row the MAX of one entry of another table, i.e. what I'd do with a query like this (for inserting a single row)

INSERT INTO mytable (val0, val1, val2, val3) VALUES (?, ?, ?, (SELECT MAX(id) FROM foo))  

But I didn't figure how to "mix" the two things.

Daff csv diff library user defined key not working

Posted: 23 Jun 2021 11:01 AM PDT

I'm using the daff csv library and I'm trying to add column names as primary key. In the doc it says to use addPrimaryKey(). However it doesn't seem to work and library just deduces the key from the data.

The "age" has been assigned as the primary key, but it's using "key" as the primary key.

before_data = [["key", "id", "name", "age"],  ["1001", "1", "Cleo", "4"],  ["1010", "2", "Pancakes", "2"]]    after_data = [["key", "id", "name", "age"],  ["1001", "1", "Cleo", "5"],  ["1009", "3", "Bailey", "1"],  ["1012", "234", "John", "10"],  ["1010", "32", "Dave", "21"]]    table1 = daff.PythonTableView(before_data)  table2 = daff.PythonTableView(after_data)    compare_object = daff.Coopy.compareTables(table1, table2)    align_tables = compare_object.align()    data_diff = []  table_diff = daff.PythonTableView(data_diff)    flags = daff.CompareFlags()  **flags.addPrimaryKey("age")**    highlighter = daff.TableDiff(align_tables, flags)  highlighter.hilite(table_diff)    sys.stdout.writelines(str(data_diff))  This gives me:  [['@@', 'key', 'id', 'name', 'age'],  ['->', '1001', '1', 'Cleo', '4->5'],  ['+++', '1009', '3', 'Bailey', '1'],  ['+++', '1012', '234', 'John', '10'],  ['->', '1010', '2->32', 'Pancakes->Dave', '2->21']]  

How to install docx2pdf python module in msys2 (mingw - windows 64 bit)

Posted: 23 Jun 2021 11:00 AM PDT

I am trying to install docx2pdf module.

I think that has dependency pywin32. I tried to install the last package in msys but i got this error:

  Χρήστος@Chris-pc MINGW64 /c/python/scripts/Papinhio player/notes/pywin32-master  $ python setup.py build  Building pywin32 3.8.301.1  running build  running build_py  creating build  creating build/lib.mingw-3.8  creating build/lib.mingw-3.8/win32  creating build/lib.mingw-3.8/win32/lib  copying win32\lib/afxres.py -> build/lib.mingw-3.8/win32\lib  copying win32\lib/commctrl.py -> build/lib.mingw-3.8/win32\lib  copying win32\lib/dbi.py -> build/lib.mingw-3.8/win32\lib  copying win32\lib/mmsystem.py -> build/lib.mingw-3.8/win32\lib  copying win32\lib/netbios.py -> build/lib.mingw-3.8/win32\lib  copying win32\lib/ntsecuritycon.py -> build/lib.mingw-3.8/win32\lib  copying win32\lib/pywin32_bootstrap.py -> build/lib.mingw-3.8/win32\lib  copying win32\lib/pywin32_testutil.py -> build/lib.mingw-3.8/win32\lib  copying win32\lib/pywintypes.py -> build/lib.mingw-3.8/win32\lib  copying win32\lib/rasutil.py -> build/lib.mingw-3.8/win32\lib  copying win32\lib/regcheck.py -> build/lib.mingw-3.8/win32\lib  copying win32\lib/regutil.py -> build/lib.mingw-3.8/win32\lib  copying win32\lib/sspi.py -> build/lib.mingw-3.8/win32\lib  copying win32\lib/sspicon.py -> build/lib.mingw-3.8/win32\lib  copying win32\lib/win32con.py -> build/lib.mingw-3.8/win32\lib  copying win32\lib/win32cryptcon.py -> build/lib.mingw-3.8/win32\lib  copying win32\lib/win32evtlogutil.py -> build/lib.mingw-3.8/win32\lib  copying win32\lib/win32gui_struct.py -> build/lib.mingw-3.8/win32\lib  copying win32\lib/win32inetcon.py -> build/lib.mingw-3.8/win32\lib  copying win32\lib/win32netcon.py -> build/lib.mingw-3.8/win32\lib  copying win32\lib/win32pdhquery.py -> build/lib.mingw-3.8/win32\lib  copying win32\lib/win32pdhutil.py -> build/lib.mingw-3.8/win32\lib  copying win32\lib/win32rcparser.py -> build/lib.mingw-3.8/win32\lib  copying win32\lib/win32serviceutil.py -> build/lib.mingw-3.8/win32\lib  copying win32\lib/win32timezone.py -> build/lib.mingw-3.8/win32\lib  copying win32\lib/win32traceutil.py -> build/lib.mingw-3.8/win32\lib  copying win32\lib/win32verstamp.py -> build/lib.mingw-3.8/win32\lib  copying win32\lib/winerror.py -> build/lib.mingw-3.8/win32\lib  copying win32\lib/winioctlcon.py -> build/lib.mingw-3.8/win32\lib  copying win32\lib/winnt.py -> build/lib.mingw-3.8/win32\lib  copying win32\lib/winperf.py -> build/lib.mingw-3.8/win32\lib  copying win32\lib/winxptheme.py -> build/lib.mingw-3.8/win32\lib  creating build/lib.mingw-3.8/win32com  copying com/win32com/olectl.py -> build/lib.mingw-3.8/win32com  copying com/win32com/storagecon.py -> build/lib.mingw-3.8/win32com  copying com/win32com/universal.py -> build/lib.mingw-3.8/win32com  copying com/win32com/util.py -> build/lib.mingw-3.8/win32com  copying com/win32com/__init__.py -> build/lib.mingw-3.8/win32com  creating build/lib.mingw-3.8/win32com/client  copying com/win32com/client/build.py -> build/lib.mingw-3.8/win32com/client  copying com/win32com/client/CLSIDToClass.py -> build/lib.mingw-3.8/win32com/clie  nt  copying com/win32com/client/combrowse.py -> build/lib.mingw-3.8/win32com/client  copying com/win32com/client/connect.py -> build/lib.mingw-3.8/win32com/client  copying com/win32com/client/dynamic.py -> build/lib.mingw-3.8/win32com/client  copying com/win32com/client/gencache.py -> build/lib.mingw-3.8/win32com/client  copying com/win32com/client/genpy.py -> build/lib.mingw-3.8/win32com/client  copying com/win32com/client/makepy.py -> build/lib.mingw-3.8/win32com/client  copying com/win32com/client/selecttlb.py -> build/lib.mingw-3.8/win32com/client  copying com/win32com/client/tlbrowse.py -> build/lib.mingw-3.8/win32com/client  copying com/win32com/client/util.py -> build/lib.mingw-3.8/win32com/client  copying com/win32com/client/__init__.py -> build/lib.mingw-3.8/win32com/client  creating build/lib.mingw-3.8/win32com/demos  copying com/win32com/demos/connect.py -> build/lib.mingw-3.8/win32com/demos  copying com/win32com/demos/dump_clipboard.py -> build/lib.mingw-3.8/win32com/dem  os  copying com/win32com/demos/eventsApartmentThreaded.py -> build/lib.mingw-3.8/win  32com/demos  copying com/win32com/demos/eventsFreeThreaded.py -> build/lib.mingw-3.8/win32com  /demos  copying com/win32com/demos/excelAddin.py -> build/lib.mingw-3.8/win32com/demos  copying com/win32com/demos/excelRTDServer.py -> build/lib.mingw-3.8/win32com/dem  os  copying com/win32com/demos/iebutton.py -> build/lib.mingw-3.8/win32com/demos  copying com/win32com/demos/ietoolbar.py -> build/lib.mingw-3.8/win32com/demos  copying com/win32com/demos/outlookAddin.py -> build/lib.mingw-3.8/win32com/demos  copying com/win32com/demos/trybag.py -> build/lib.mingw-3.8/win32com/demos  copying com/win32com/demos/__init__.py -> build/lib.mingw-3.8/win32com/demos  creating build/lib.mingw-3.8/win32com/makegw  copying com/win32com/makegw/makegw.py -> build/lib.mingw-3.8/win32com/makegw  copying com/win32com/makegw/makegwenum.py -> build/lib.mingw-3.8/win32com/makegw  copying com/win32com/makegw/makegwparse.py -> build/lib.mingw-3.8/win32com/makeg  w  copying com/win32com/makegw/__init__.py -> build/lib.mingw-3.8/win32com/makegw  creating build/lib.mingw-3.8/win32com/server  copying com/win32com/server/connect.py -> build/lib.mingw-3.8/win32com/server  copying com/win32com/server/dispatcher.py -> build/lib.mingw-3.8/win32com/server  copying com/win32com/server/exception.py -> build/lib.mingw-3.8/win32com/server  copying com/win32com/server/factory.py -> build/lib.mingw-3.8/win32com/server  copying com/win32com/server/localserver.py -> build/lib.mingw-3.8/win32com/serve  r  copying com/win32com/server/policy.py -> build/lib.mingw-3.8/win32com/server  copying com/win32com/server/register.py -> build/lib.mingw-3.8/win32com/server  copying com/win32com/server/util.py -> build/lib.mingw-3.8/win32com/server  copying com/win32com/server/__init__.py -> build/lib.mingw-3.8/win32com/server  creating build/lib.mingw-3.8/win32com/servers  copying com/win32com/servers/dictionary.py -> build/lib.mingw-3.8/win32com/serve  rs  copying com/win32com/servers/interp.py -> build/lib.mingw-3.8/win32com/servers  copying com/win32com/servers/perfmon.py -> build/lib.mingw-3.8/win32com/servers  copying com/win32com/servers/PythonTools.py -> build/lib.mingw-3.8/win32com/serv  ers  copying com/win32com/servers/test_pycomtest.py -> build/lib.mingw-3.8/win32com/s  ervers  copying com/win32com/servers/__init__.py -> build/lib.mingw-3.8/win32com/servers  creating build/lib.mingw-3.8/win32com/test  copying com/win32com/test/daodump.py -> build/lib.mingw-3.8/win32com/test  copying com/win32com/test/errorSemantics.py -> build/lib.mingw-3.8/win32com/test  copying com/win32com/test/GenTestScripts.py -> build/lib.mingw-3.8/win32com/test  copying com/win32com/test/pippo_server.py -> build/lib.mingw-3.8/win32com/test  copying com/win32com/test/policySemantics.py -> build/lib.mingw-3.8/win32com/tes  t  copying com/win32com/test/testAccess.py -> build/lib.mingw-3.8/win32com/test  copying com/win32com/test/testADOEvents.py -> build/lib.mingw-3.8/win32com/test  copying com/win32com/test/testall.py -> build/lib.mingw-3.8/win32com/test  copying com/win32com/test/testArrays.py -> build/lib.mingw-3.8/win32com/test  copying com/win32com/test/testAXScript.py -> build/lib.mingw-3.8/win32com/test  copying com/win32com/test/testClipboard.py -> build/lib.mingw-3.8/win32com/test  copying com/win32com/test/testCollections.py -> build/lib.mingw-3.8/win32com/tes  t  copying com/win32com/test/testConversionErrors.py -> build/lib.mingw-3.8/win32co  m/test  copying com/win32com/test/testDates.py -> build/lib.mingw-3.8/win32com/test  copying com/win32com/test/testDCOM.py -> build/lib.mingw-3.8/win32com/test  copying com/win32com/test/testDictionary.py -> build/lib.mingw-3.8/win32com/test  copying com/win32com/test/testDynamic.py -> build/lib.mingw-3.8/win32com/test  copying com/win32com/test/testExchange.py -> build/lib.mingw-3.8/win32com/test  copying com/win32com/test/testExplorer.py -> build/lib.mingw-3.8/win32com/test  copying com/win32com/test/testGatewayAddresses.py -> build/lib.mingw-3.8/win32co  m/test  copying com/win32com/test/testGIT.py -> build/lib.mingw-3.8/win32com/test  copying com/win32com/test/testIterators.py -> build/lib.mingw-3.8/win32com/test  copying com/win32com/test/testmakepy.py -> build/lib.mingw-3.8/win32com/test  copying com/win32com/test/testMarshal.py -> build/lib.mingw-3.8/win32com/test  copying com/win32com/test/testMSOffice.py -> build/lib.mingw-3.8/win32com/test  copying com/win32com/test/testMSOfficeEvents.py -> build/lib.mingw-3.8/win32com/  test  copying com/win32com/test/testNetscape.py -> build/lib.mingw-3.8/win32com/test  copying com/win32com/test/testPersist.py -> build/lib.mingw-3.8/win32com/test  copying com/win32com/test/testPippo.py -> build/lib.mingw-3.8/win32com/test  copying com/win32com/test/testPyComTest.py -> build/lib.mingw-3.8/win32com/test  copying com/win32com/test/testROT.py -> build/lib.mingw-3.8/win32com/test  copying com/win32com/test/testServers.py -> build/lib.mingw-3.8/win32com/test  copying com/win32com/test/testShell.py -> build/lib.mingw-3.8/win32com/test  copying com/win32com/test/testStorage.py -> build/lib.mingw-3.8/win32com/test  copying com/win32com/test/testStreams.py -> build/lib.mingw-3.8/win32com/test  copying com/win32com/test/testvb.py -> build/lib.mingw-3.8/win32com/test  copying com/win32com/test/testvbscript_regexp.py -> build/lib.mingw-3.8/win32com  /test  copying com/win32com/test/testWMI.py -> build/lib.mingw-3.8/win32com/test  copying com/win32com/test/testxslt.py -> build/lib.mingw-3.8/win32com/test  copying com/win32com/test/util.py -> build/lib.mingw-3.8/win32com/test  copying com/win32com/test/__init__.py -> build/lib.mingw-3.8/win32com/test  creating build/lib.mingw-3.8/win32comext  creating build/lib.mingw-3.8/win32comext/adsi  copying com/win32comext/adsi/adsicon.py -> build/lib.mingw-3.8/win32comext/adsi  copying com/win32comext/adsi/__init__.py -> build/lib.mingw-3.8/win32comext/adsi  creating build/lib.mingw-3.8/win32comext/axscript  copying com/win32comext/axscript/asputil.py -> build/lib.mingw-3.8/win32comext/a  xscript  copying com/win32comext/axscript/__init__.py -> build/lib.mingw-3.8/win32comext/  axscript  creating build/lib.mingw-3.8/win32comext/axscript/client  copying com/win32comext/axscript/client/debug.py -> build/lib.mingw-3.8/win32com  ext/axscript/client  copying com/win32comext/axscript/client/error.py -> build/lib.mingw-3.8/win32com  ext/axscript/client  copying com/win32comext/axscript/client/framework.py -> build/lib.mingw-3.8/win3  2comext/axscript/client  copying com/win32comext/axscript/client/pydumper.py -> build/lib.mingw-3.8/win32  comext/axscript/client  copying com/win32comext/axscript/client/pyscript.py -> build/lib.mingw-3.8/win32  comext/axscript/client  copying com/win32comext/axscript/client/pyscript_rexec.py -> build/lib.mingw-3.8  /win32comext/axscript/client  copying com/win32comext/axscript/client/scriptdispatch.py -> build/lib.mingw-3.8  /win32comext/axscript/client  copying com/win32comext/axscript/client/__init__.py -> build/lib.mingw-3.8/win32  comext/axscript/client  creating build/lib.mingw-3.8/win32comext/axscript/server  copying com/win32comext/axscript/server/axsite.py -> build/lib.mingw-3.8/win32co  mext/axscript/server  copying com/win32comext/axscript/server/error.py -> build/lib.mingw-3.8/win32com  ext/axscript/server  copying com/win32comext/axscript/server/__init__.py -> build/lib.mingw-3.8/win32  comext/axscript/server  creating build/lib.mingw-3.8/win32comext/axdebug  copying com/win32comext/axdebug/adb.py -> build/lib.mingw-3.8/win32comext/axdebu  g  copying com/win32comext/axdebug/codecontainer.py -> build/lib.mingw-3.8/win32com  ext/axdebug  copying com/win32comext/axdebug/contexts.py -> build/lib.mingw-3.8/win32comext/a  xdebug  copying com/win32comext/axdebug/debugger.py -> build/lib.mingw-3.8/win32comext/a  xdebug  copying com/win32comext/axdebug/documents.py -> build/lib.mingw-3.8/win32comext/  axdebug  copying com/win32comext/axdebug/dump.py -> build/lib.mingw-3.8/win32comext/axdeb  ug  copying com/win32comext/axdebug/expressions.py -> build/lib.mingw-3.8/win32comex  t/axdebug  copying com/win32comext/axdebug/gateways.py -> build/lib.mingw-3.8/win32comext/a  xdebug  copying com/win32comext/axdebug/stackframe.py -> build/lib.mingw-3.8/win32comext  /axdebug  copying com/win32comext/axdebug/util.py -> build/lib.mingw-3.8/win32comext/axdeb  ug  copying com/win32comext/axdebug/__init__.py -> build/lib.mingw-3.8/win32comext/a  xdebug  creating build/lib.mingw-3.8/win32comext/propsys  copying com/win32comext/propsys/pscon.py -> build/lib.mingw-3.8/win32comext/prop  sys  copying com/win32comext/propsys/__init__.py -> build/lib.mingw-3.8/win32comext/p  ropsys  creating build/lib.mingw-3.8/win32comext/shell  copying com/win32comext/shell/shellcon.py -> build/lib.mingw-3.8/win32comext/she  ll  copying com/win32comext/shell/__init__.py -> build/lib.mingw-3.8/win32comext/she  ll  creating build/lib.mingw-3.8/win32comext/mapi  copying com/win32comext/mapi/emsabtags.py -> build/lib.mingw-3.8/win32comext/map  i  copying com/win32comext/mapi/mapitags.py -> build/lib.mingw-3.8/win32comext/mapi  copying com/win32comext/mapi/mapiutil.py -> build/lib.mingw-3.8/win32comext/mapi  copying com/win32comext/mapi/__init__.py -> build/lib.mingw-3.8/win32comext/mapi  creating build/lib.mingw-3.8/win32comext/ifilter  copying com/win32comext/ifilter/ifiltercon.py -> build/lib.mingw-3.8/win32comext  /ifilter  copying com/win32comext/ifilter/__init__.py -> build/lib.mingw-3.8/win32comext/i  filter  creating build/lib.mingw-3.8/win32comext/internet  copying com/win32comext/internet/inetcon.py -> build/lib.mingw-3.8/win32comext/i  nternet  copying com/win32comext/internet/__init__.py -> build/lib.mingw-3.8/win32comext/  internet  creating build/lib.mingw-3.8/win32comext/axcontrol  copying com/win32comext/axcontrol/__init__.py -> build/lib.mingw-3.8/win32comext  /axcontrol  creating build/lib.mingw-3.8/win32comext/taskscheduler  copying com/win32comext/taskscheduler/__init__.py -> build/lib.mingw-3.8/win32co  mext/taskscheduler  creating build/lib.mingw-3.8/win32comext/directsound  copying com/win32comext/directsound/__init__.py -> build/lib.mingw-3.8/win32come  xt/directsound  creating build/lib.mingw-3.8/win32comext/directsound/test  copying com/win32comext/directsound/test/ds_record.py -> build/lib.mingw-3.8/win  32comext/directsound/test  copying com/win32comext/directsound/test/ds_test.py -> build/lib.mingw-3.8/win32  comext/directsound/test  copying com/win32comext/directsound/test/__init__.py -> build/lib.mingw-3.8/win3  2comext/directsound/test  creating build/lib.mingw-3.8/win32comext/authorization  copying com/win32comext/authorization/__init__.py -> build/lib.mingw-3.8/win32co  mext/authorization  creating build/lib.mingw-3.8/win32comext/bits  copying com/win32comext/bits/__init__.py -> build/lib.mingw-3.8/win32comext/bits  creating build/lib.mingw-3.8/pythonwin  creating build/lib.mingw-3.8/pythonwin/pywin  copying pythonwin/pywin/__init__.py -> build/lib.mingw-3.8/pythonwin/pywin  creating build/lib.mingw-3.8/pythonwin/pywin/debugger  copying pythonwin/pywin/debugger/configui.py -> build/lib.mingw-3.8/pythonwin/py  win/debugger  copying pythonwin/pywin/debugger/dbgcon.py -> build/lib.mingw-3.8/pythonwin/pywi  n/debugger  copying pythonwin/pywin/debugger/dbgpyapp.py -> build/lib.mingw-3.8/pythonwin/py  win/debugger  copying pythonwin/pywin/debugger/debugger.py -> build/lib.mingw-3.8/pythonwin/py  win/debugger  copying pythonwin/pywin/debugger/fail.py -> build/lib.mingw-3.8/pythonwin/pywin/  debugger  copying pythonwin/pywin/debugger/__init__.py -> build/lib.mingw-3.8/pythonwin/py  win/debugger  creating build/lib.mingw-3.8/pythonwin/pywin/dialogs  copying pythonwin/pywin/dialogs/ideoptions.py -> build/lib.mingw-3.8/pythonwin/p  ywin/dialogs  copying pythonwin/pywin/dialogs/list.py -> build/lib.mingw-3.8/pythonwin/pywin/d  ialogs  copying pythonwin/pywin/dialogs/login.py -> build/lib.mingw-3.8/pythonwin/pywin/  dialogs  copying pythonwin/pywin/dialogs/status.py -> build/lib.mingw-3.8/pythonwin/pywin  /dialogs  copying pythonwin/pywin/dialogs/__init__.py -> build/lib.mingw-3.8/pythonwin/pyw  in/dialogs  creating build/lib.mingw-3.8/pythonwin/pywin/docking  copying pythonwin/pywin/docking/DockingBar.py -> build/lib.mingw-3.8/pythonwin/p  ywin/docking  copying pythonwin/pywin/docking/__init__.py -> build/lib.mingw-3.8/pythonwin/pyw  in/docking  creating build/lib.mingw-3.8/pythonwin/pywin/framework  copying pythonwin/pywin/framework/app.py -> build/lib.mingw-3.8/pythonwin/pywin/  framework  copying pythonwin/pywin/framework/bitmap.py -> build/lib.mingw-3.8/pythonwin/pyw  in/framework  copying pythonwin/pywin/framework/cmdline.py -> build/lib.mingw-3.8/pythonwin/py  win/framework  copying pythonwin/pywin/framework/dbgcommands.py -> build/lib.mingw-3.8/pythonwi  n/pywin/framework  copying pythonwin/pywin/framework/dlgappcore.py -> build/lib.mingw-3.8/pythonwin  /pywin/framework  copying pythonwin/pywin/framework/help.py -> build/lib.mingw-3.8/pythonwin/pywin  /framework  copying pythonwin/pywin/framework/interact.py -> build/lib.mingw-3.8/pythonwin/p  ywin/framework  copying pythonwin/pywin/framework/intpyapp.py -> build/lib.mingw-3.8/pythonwin/p  ywin/framework  copying pythonwin/pywin/framework/intpydde.py -> build/lib.mingw-3.8/pythonwin/p  ywin/framework  copying pythonwin/pywin/framework/mdi_pychecker.py -> build/lib.mingw-3.8/python  win/pywin/framework  copying pythonwin/pywin/framework/scriptutils.py -> build/lib.mingw-3.8/pythonwi  n/pywin/framework  copying pythonwin/pywin/framework/sgrepmdi.py -> build/lib.mingw-3.8/pythonwin/p  ywin/framework  copying pythonwin/pywin/framework/startup.py -> build/lib.mingw-3.8/pythonwin/py  win/framework  copying pythonwin/pywin/framework/stdin.py -> build/lib.mingw-3.8/pythonwin/pywi  n/framework  copying pythonwin/pywin/framework/toolmenu.py -> build/lib.mingw-3.8/pythonwin/p  ywin/framework  copying pythonwin/pywin/framework/window.py -> build/lib.mingw-3.8/pythonwin/pyw  in/framework  copying pythonwin/pywin/framework/winout.py -> build/lib.mingw-3.8/pythonwin/pyw  in/framework  copying pythonwin/pywin/framework/__init__.py -> build/lib.mingw-3.8/pythonwin/p  ywin/framework  creating build/lib.mingw-3.8/pythonwin/pywin/framework/editor  copying pythonwin/pywin/framework/editor/configui.py -> build/lib.mingw-3.8/pyth  onwin/pywin/framework/editor  copying pythonwin/pywin/framework/editor/document.py -> build/lib.mingw-3.8/pyth  onwin/pywin/framework/editor  copying pythonwin/pywin/framework/editor/editor.py -> build/lib.mingw-3.8/python  win/pywin/framework/editor  copying pythonwin/pywin/framework/editor/frame.py -> build/lib.mingw-3.8/pythonw  in/pywin/framework/editor  copying pythonwin/pywin/framework/editor/ModuleBrowser.py -> build/lib.mingw-3.8  /pythonwin/pywin/framework/editor  copying pythonwin/pywin/framework/editor/template.py -> build/lib.mingw-3.8/pyth  onwin/pywin/framework/editor  copying pythonwin/pywin/framework/editor/vss.py -> build/lib.mingw-3.8/pythonwin  /pywin/framework/editor  copying pythonwin/pywin/framework/editor/__init__.py -> build/lib.mingw-3.8/pyth  onwin/pywin/framework/editor  creating build/lib.mingw-3.8/pythonwin/pywin/framework/editor/color  copying pythonwin/pywin/framework/editor/color/coloreditor.py -> build/lib.mingw  -3.8/pythonwin/pywin/framework/editor/color  copying pythonwin/pywin/framework/editor/color/__init__.py -> build/lib.mingw-3.  8/pythonwin/pywin/framework/editor/color  creating build/lib.mingw-3.8/pythonwin/pywin/idle  copying pythonwin/pywin/idle/AutoExpand.py -> build/lib.mingw-3.8/pythonwin/pywi  n/idle  copying pythonwin/pywin/idle/AutoIndent.py -> build/lib.mingw-3.8/pythonwin/pywi  n/idle  copying pythonwin/pywin/idle/CallTips.py -> build/lib.mingw-3.8/pythonwin/pywin/  idle  copying pythonwin/pywin/idle/FormatParagraph.py -> build/lib.mingw-3.8/pythonwin  /pywin/idle  copying pythonwin/pywin/idle/IdleHistory.py -> build/lib.mingw-3.8/pythonwin/pyw  in/idle  copying pythonwin/pywin/idle/PyParse.py -> build/lib.mingw-3.8/pythonwin/pywin/i  dle  copying pythonwin/pywin/idle/__init__.py -> build/lib.mingw-3.8/pythonwin/pywin/  idle  creating build/lib.mingw-3.8/pythonwin/pywin/mfc  copying pythonwin/pywin/mfc/activex.py -> build/lib.mingw-3.8/pythonwin/pywin/mf  c  copying pythonwin/pywin/mfc/afxres.py -> build/lib.mingw-3.8/pythonwin/pywin/mfc  copying pythonwin/pywin/mfc/dialog.py -> build/lib.mingw-3.8/pythonwin/pywin/mfc  copying pythonwin/pywin/mfc/docview.py -> build/lib.mingw-3.8/pythonwin/pywin/mf  c  copying pythonwin/pywin/mfc/object.py -> build/lib.mingw-3.8/pythonwin/pywin/mfc  copying pythonwin/pywin/mfc/thread.py -> build/lib.mingw-3.8/pythonwin/pywin/mfc  copying pythonwin/pywin/mfc/window.py -> build/lib.mingw-3.8/pythonwin/pywin/mfc  copying pythonwin/pywin/mfc/__init__.py -> build/lib.mingw-3.8/pythonwin/pywin/m  fc  creating build/lib.mingw-3.8/pythonwin/pywin/scintilla  copying pythonwin/pywin/scintilla/bindings.py -> build/lib.mingw-3.8/pythonwin/p  ywin/scintilla  copying pythonwin/pywin/scintilla/config.py -> build/lib.mingw-3.8/pythonwin/pyw  in/scintilla  copying pythonwin/pywin/scintilla/configui.py -> build/lib.mingw-3.8/pythonwin/p  ywin/scintilla  copying pythonwin/pywin/scintilla/control.py -> build/lib.mingw-3.8/pythonwin/py  win/scintilla  copying pythonwin/pywin/scintilla/document.py -> build/lib.mingw-3.8/pythonwin/p  ywin/scintilla  copying pythonwin/pywin/scintilla/find.py -> build/lib.mingw-3.8/pythonwin/pywin  /scintilla  copying pythonwin/pywin/scintilla/formatter.py -> build/lib.mingw-3.8/pythonwin/  pywin/scintilla  copying pythonwin/pywin/scintilla/IDLEenvironment.py -> build/lib.mingw-3.8/pyth  onwin/pywin/scintilla  copying pythonwin/pywin/scintilla/keycodes.py -> build/lib.mingw-3.8/pythonwin/p  ywin/scintilla  copying pythonwin/pywin/scintilla/scintillacon.py -> build/lib.mingw-3.8/pythonw  in/pywin/scintilla  copying pythonwin/pywin/scintilla/view.py -> build/lib.mingw-3.8/pythonwin/pywin  /scintilla  copying pythonwin/pywin/scintilla/__init__.py -> build/lib.mingw-3.8/pythonwin/p  ywin/scintilla  creating build/lib.mingw-3.8/pythonwin/pywin/tools  copying pythonwin/pywin/tools/browseProjects.py -> build/lib.mingw-3.8/pythonwin  /pywin/tools  copying pythonwin/pywin/tools/browser.py -> build/lib.mingw-3.8/pythonwin/pywin/  tools  copying pythonwin/pywin/tools/hierlist.py -> build/lib.mingw-3.8/pythonwin/pywin  /tools  copying pythonwin/pywin/tools/regedit.py -> build/lib.mingw-3.8/pythonwin/pywin/  tools  copying pythonwin/pywin/tools/regpy.py -> build/lib.mingw-3.8/pythonwin/pywin/to  ols  copying pythonwin/pywin/tools/TraceCollector.py -> build/lib.mingw-3.8/pythonwin  /pywin/tools  copying pythonwin/pywin/tools/__init__.py -> build/lib.mingw-3.8/pythonwin/pywin  /tools  creating build/lib.mingw-3.8/isapi  copying isapi/install.py -> build/lib.mingw-3.8/isapi  copying isapi/isapicon.py -> build/lib.mingw-3.8/isapi  copying isapi/simple.py -> build/lib.mingw-3.8/isapi  copying isapi/threaded_extension.py -> build/lib.mingw-3.8/isapi  copying isapi/__init__.py -> build/lib.mingw-3.8/isapi  creating build/lib.mingw-3.8/adodbapi  copying adodbapi/adodbapi.py -> build/lib.mingw-3.8/adodbapi  copying adodbapi/ado_consts.py -> build/lib.mingw-3.8/adodbapi  copying adodbapi/apibase.py -> build/lib.mingw-3.8/adodbapi  copying adodbapi/is64bit.py -> build/lib.mingw-3.8/adodbapi  copying adodbapi/process_connect_string.py -> build/lib.mingw-3.8/adodbapi  copying adodbapi/remote.py -> build/lib.mingw-3.8/adodbapi  copying adodbapi/schema_table.py -> build/lib.mingw-3.8/adodbapi  copying adodbapi/setup.py -> build/lib.mingw-3.8/adodbapi  copying adodbapi/__init__.py -> build/lib.mingw-3.8/adodbapi  running build_ext  Traceback (most recent call last):    File "setup.py", line 2286, in       dist = setup(name="pywin32",    File "C:/msys64/mingw64/lib/python3.8/site-packages/setuptools/__init__.py", l  ine 153, in setup      return distutils.core.setup(**attrs)    File "C:/msys64/mingw64/lib/python3.8/distutils/core.py", line 148, in setup      dist.run_commands()    File "C:/msys64/mingw64/lib/python3.8/distutils/dist.py", line 966, in run_com  mands      self.run_command(cmd)    File "C:/msys64/mingw64/lib/python3.8/distutils/dist.py", line 985, in run_com  mand      cmd_obj.run()    File "setup.py", line 505, in run      build.run(self)    File "C:/msys64/mingw64/lib/python3.8/distutils/command/build.py", line 135, i  n run      self.run_command(cmd_name)    File "C:/msys64/mingw64/lib/python3.8/distutils/cmd.py", line 313, in run_comm  and      self.distribution.run_command(command)    File "C:/msys64/mingw64/lib/python3.8/distutils/dist.py", line 985, in run_com  mand      cmd_obj.run()    File "C:/msys64/mingw64/lib/python3.8/distutils/command/build_ext.py", line 34  1, in run      self.build_extensions()    File "setup.py", line 807, in build_extensions      self.compiler.initialize()    File "C:/msys64/mingw64/lib/python3.8/distutils/msvccompiler.py", line 259, in   initialize      self.__paths = self.get_msvc_paths("path")    File "C:/msys64/mingw64/lib/python3.8/distutils/msvccompiler.py", line 602, in   get_msvc_paths      r"\Win32 (%s)\Directories" % (self.__root, platform))  AttributeError: 'my_compiler' object has no attribute '_MSVCCompiler__root'  

Button Click code returns inconsistent results on the first click and works perfectly fine on second click

Posted: 23 Jun 2021 11:02 AM PDT

So I am creating a page in ASP.Net, in which a user needs to click a button to add as many rows of dynamically created controls as desired. I then, upon a button click want to validate the data inside these textboxes and dropdownlists and make sure it is valid.

Issue is: on the first button click, the page shows that some fields are not OK (where in fact they should be), and if I click again, everything works.

Is this yet another case of me not properly understanding the Page Life Cycle properly?

C# (for creating the dynamic controls)

            List<string> noControlos = new List<string>();                    int counter = 0;                              protected override void LoadViewState(object savedState)              {                  base.LoadViewState(savedState);                        noControlos = (List<string>)ViewState["noControlos"];                        foreach (string Id in noControlos)                  {                      counter++;                            TextBox tb1 = new TextBox();                      tb1.ID = "TextBox2_" + counter;                      tb1.CssClass = "input";                            quantidade.Controls.Add(tb1);                  }                        foreach (string Id in noControlos)                  {                      counter++;                            DropDownList ddl = new DropDownList();                      ddl.ID = "DropDownList_" + counter;                      ddl.CssClass = "input";                            medida.Controls.Add(ddl);                  }                        foreach (string Id in noControlos)                  {                      counter++;                            TextBox tb2 = new TextBox();                      tb2.ID = "TextBox3_" + counter;                      tb2.CssClass = "input";                            ingrediente.Controls.Add(tb2);                  }              }                    protected void Button1_Click (object sender, EventArgs e)              {                  TextBox tb1 = new TextBox();                  tb1.CssClass = "input";                        DropDownList ddl = new DropDownList();                  ddl.CssClass = "input";                        TextBox tb2 = new TextBox();                  tb2.CssClass = "input";                        quantidade.Controls.Add(tb1);                  medida.Controls.Add(ddl);                  ingrediente.Controls.Add(tb2);                        counter++;                  noControlos.Add(tb1.ID);                  ViewState["noControlos"] = noControlos;              }  

C# (that Validates the data in the dynamically added controls)

protected void Button2_Click(object sender, EventArgs e)          {              List<Control> listaControlos = new List<Control>();              List<bool> estadoDados = new List<bool>();                DataTable tvpIngredientes = new DataTable();              tvpIngredientes.Columns.Add("Quantidade", typeof(int));              tvpIngredientes.Columns.Add("Medida", typeof(string));              tvpIngredientes.Columns.Add("Ingrediente", typeof(string));                estadoDados.Clear();                foreach (Control control in infoReceitaDetalhes.Controls)              {                  if (control is TextBox || control is DropDownList || control is FileUpload)                  {                      listaControlos.Add(control);                  }              }              foreach (Control ctrlQtd in quantidade.Controls)              {                  if (ctrlQtd is TextBox)                  {                      listaControlos.Add(ctrlQtd);                  }              }              foreach (Control ctrlMdd in medida.Controls)              {                  if (ctrlMdd is DropDownList)                  {                      listaControlos.Add(ctrlMdd);                  }              }              foreach (Control ctrlIng in ingrediente.Controls)              {                  if (ctrlIng is TextBox)                  {                      listaControlos.Add(ctrlIng);                  }              }                foreach (Control control in listaControlos)              {                  if (control is TextBox)                  {                      TextBox txtBox = (TextBox)control;                        if (txtBox.Text.Equals(string.Empty) || string.IsNullOrWhiteSpace(txtBox.Text))                      {                          if (!txtBox.ID.Contains("TextBox4"))                          {                              txtBox.CssClass = "controloVazio";                          }                          else                          {                              txtBox.CssClass = "descricaoTxtBoxVazia";                          }                          estadoDados.Add(false);                      }                      else                      {                          foreach (char c in txtBox.Text)                          {                              if (txtBox.ID.Contains("TextBox1") || txtBox.ID.Contains("TextBox3"))                              {                                  if (char.IsLetter(c) || char.IsWhiteSpace(c))                                  {                                      txtBox.CssClass = "input";                                      estadoDados.Add(true);                                  }                                  else                                  {                                      txtBox.CssClass = "controloVazio";                                      estadoDados.Add(false);                                  }                              }                              else if (txtBox.ID.Contains("TextBox2"))                              {                                  if (char.IsDigit(c))                                  {                                      txtBox.CssClass = "input";                                      estadoDados.Add(true);                                  }                                  else                                  {                                      txtBox.CssClass = "controloVazio";                                      estadoDados.Add(false);                                  }                              }                              else                              {                                  txtBox.CssClass = "descricaoTxtBox";                              }                          }                      }                  }                  else if (control is DropDownList)                  {                      DropDownList ddl = (DropDownList)control;                        if (ddl.SelectedValue.Equals("Seleccionar opção"))                      {                          ddl.CssClass = "controloVazio";                          estadoDados.Add(false);                      }                      else                      {                          ddl.CssClass = "input";                          estadoDados.Add(true);                      }                  }                  else if (control is FileUpload)                  {                      FileUpload fu = (FileUpload)control;                        if (!fu.HasFile)                      {                          estadoDados.Add(false);                      }                      else                      {                          estadoDados.Add(true);                      }                  }              }                if (estadoDados.Contains(false))              {                  Label10.Text = "Fracasso!";              }              else              {                  Label10.Text = "Sucesso!";              }          }            

HTML (markup of the section of the page where the controls are being added. It is also enclosed in an UpdatePanel. The divs where the controls are being added have ids "quantidade", "medida", "ingrediente")

            <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>              <asp:UpdatePanel ID="UpdatePanel1" runat="server">                  <ContentTemplate>                      <div class="detalhesIngred" id="detalhesIngred" runat="server">                          <div class="qtdIng">                              <asp:Label ID="Label7" CssClass="labelIngred" runat="server" Text="Quantidade"></asp:Label>                              <div class="quantidade" id="quantidade" runat="server">                                  <asp:TextBox ID="TextBox2" CssClass="input" runat="server"></asp:TextBox>                              </div>                          </div>                          <div class="mddIng">                              <asp:Label ID="Label8" CssClass="labelIngred" runat="server" Text="Medida"></asp:Label>                              <div class="medida" id="medida" runat="server">                                  <asp:DropDownList ID="DropDownList4" CssClass="input" runat="server"></asp:DropDownList>                              </div>                          </div>                          <div class="nomeIng">                              <asp:Label ID="Label9" CssClass="labelIngred" runat="server" Text="Ingrediente"></asp:Label>                              <div class="ingrediente" id="ingrediente" runat="server">                                  <asp:TextBox ID="TextBox3" CssClass="input" runat="server"></asp:TextBox>                              </div>                          </div>                      </div>                      <br />                      <div class="btnIngredientes">                          <asp:Button ID="Button1" runat="server" CssClass="btnAdicionar" Text="Adicionar" OnClick="Button1_Click" />                          <asp:Button ID="Button3" runat="server" CssClass="btnRemover" Text="Remover" OnClick="Button3_Click" />                      </div>                  </ContentTemplate>              </asp:UpdatePanel>  

I have also attached the result after first click (with data that was deleted from the red cells upon ButtonClick) firstclick and the result after the second click secondclick, with the same exact criteria. Second click is what should be the actual result.

Please tell me the what is wrong in my code to FIND n digit Armstrong number

Posted: 23 Jun 2021 11:01 AM PDT

I am an amateur, so I apologize in advance, but pls tell me what is wrong in this code. No matter what input I give, it just shows, Not an Armstrong number. What I think is that this pow() function is creating problem but still please review this cod and tell the possible solution.

#include <stdio.h>  #include <math.h>  int order(int);  int main(void)  {      long long x, temp, sum = 0, original, rev = 0;      printf("Please enter the number which u want to check:\n");      scanf("%lli", &x);      original = x;      if (x < 10)      {          printf("Yes, the number entered is an Armstrong number.");      }      else      {          while (x != 0)          {              temp = x % 10;              sum += pow((temp), order(original)); //temp*temp*temp;  //3^3+5^3+1^3              rev = rev * 10 + temp;              x /= 10;          }          if (sum != original)          {              printf("No, the number entered is not an Armstrong number.");          }          else          {              printf("Yes, the number entered is an Armstrong number.");          }      }  }  int order(int n)  {      int count = 0;      while (n != 0)      {          count++;          n /= 10;      }      return count;  }  

Configuring websockets using AWS ALB

Posted: 23 Jun 2021 11:00 AM PDT

I'm trying to configure Ingress using an AWS ALB. Through this same Ingress, I am able to access every port I choose from my containers but the one for websockets. Here are my configurations:

apiVersion: apps/v1    kind: Deployment  metadata:    namespace: ****    name: ****-deployment  spec:    selector:      matchLabels:        app.kubernetes.io/name: ***    replicas: 3    ...      spec:        containers:        - image: **:latest          imagePullPolicy: Always          name: ***          ...          ports:          - containerPort: 9944//This is for the Websocket!  

Service:

apiVersion: v1  kind: Service  metadata:    namespace: ****    name: ***-svc  spec:    ports:      - port: 80        name: websocket        targetPort: 9944        protocol: TCP    type: NodePort    selector:      app.kubernetes.io/name: ***  

And finally the ingress:

apiVersion: extensions/v1beta1  kind: Ingress  metadata:    namespace: ****    name: ***-ing    annotations:      kubernetes.io/ingress.class: alb      alb.ingress.kubernetes.io/scheme: internet-facing      alb.ingress.kubernetes.io/group.name: wstgroup      alb.ingress.kubernetes.io/load-balancer-attributes: idle_timeout.timeout_seconds=5000      alb.ingress.kubernetes.io/auth-session-timeout: '86400'      alb.ingress.kubernetes.io/target-type: ip      alb.ingress.kubernetes.io/listen-ports: '[{"HTTP":80}, {"HTTPS":443}]'      alb.ingress.kubernetes.io/healthcheck-path: /      alb.ingress.kubernetes.io/healthcheck-port: '80'      alb.ingress.kubernetes.io/target-group-attributes: stickiness.enabled=true,stickiness.lb_cookie.duration_seconds=600      alb.ingress.kubernetes.io/certificate-arn:  ****    labels:      app: **  spec:    rules:      - host: **.**.cloud        http:          paths:            - path: /ws/              backend:                serviceName: ***-svc                servicePort: 80  

Returns 502 as an error most of the time, with curl, here is the result:

enter image description here

Thank you!

How to remove rows from a dataframe

Posted: 23 Jun 2021 11:02 AM PDT

I created a random set of 73 values in R.

randomvalues <- sample(x=1:365, size = 73)  

Now I'd like to purposely create missing values by removing the max temperature from the rows that correspond with those random values. Eg if '3' was one of the random numbers generated, then the value 26.8 should be removed.

enter image description here

This is what I've tried so far:

rawdata2 <- rawdata1[-randomvalues]  

The error message I received was:

Error: Subscript `-randomvalues` is a matrix, it must be of type logical.  

What should I do instead? Am new to R so appreciate any help from you all.

Thank you.

*Sorry, wasn't clear with my initial explanation.

Lost connection to MySQL server during query on Google Cloud MySQL server

Posted: 23 Jun 2021 11:01 AM PDT

I am aware that this question has been asked multiple times, but I haven't found a question that pertains to the same issue I am dealing with. I have a MySQL database hosted on Google Cloud SQL. I am running a python script out of a Google Cloud VM to connect to the database to run queries. Everything used to run fine, but now I am getting the following error on my initial connection to the server.

File "/usr/local/lib/python3.5/dist-packages/pymysql/__init__.py", line 94, in Connect      return Connection(*args, **kwargs)  File "/usr/local/lib/python3.5/dist-packages/pymysql/connections.py", line 327, in __init__      self.connect()  File "/usr/local/lib/python3.5/dist-packages/pymysql/connections.py", line 597, in connect      self._get_server_information()  File "/usr/local/lib/python3.5/dist-packages/pymysql/connections.py", line 966, in _get_server_information      packet = self._read_packet()  File "/usr/local/lib/python3.5/dist-packages/pymysql/connections.py", line 656, in _read_packet      packet_header = self._read_bytes(4)    File "/usr/local/lib/python3.5/dist-packages/pymysql/connections.py", line 702, in _read_bytes      CR.CR_SERVER_LOST, "Lost connection to MySQL server during query")  pymysql.err.OperationalError: (2013, 'Lost connection to MySQL server during query')  

And here is the code I am using to connect to the server

connection = pymysql.connect(host='127.0.0.1',      user='xxxxxx',      password='xxxxxx',      database='foobar',      cursorclass=pymysql.cursors.DictCursor,      max_allowed_packet=16777216,      connect_timeout=100)  

Initially, my connection code did not have the max_allowed_packet and connect_timeout, and it was working fine. After some research into my issue, these seemed to resolve others' issues, but it hasn't resolved mine.

How can I have 2 textviews on the same line and at opposite ends of the screen at the same time

Posted: 23 Jun 2021 11:01 AM PDT

I'm currently working on an app to display two text views at opposite ends of the screen.

This is the expected output: expected output

This does work on some devices but on others it creates a new line and messes things up entirely or just removes the 22 entirely like this: unexpected output

This is the xml code:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"      android:layout_width="match_parent"      android:layout_height="match_parent"      android:gravity="start">        <TextView          android:textSize="13sp"          android:textColor="@color/black"          android:gravity="start"          android:layout_marginStart="10dp"          android:layout_marginTop="10dp"          android:layout_width="wrap_content"          android:layout_height="wrap_content"          android:text="James Lingard" />        <TextView          android:textSize="13sp"          android:textColor="@color/black"          android:gravity="start"          android:layout_marginStart="410dp"          android:layout_marginTop="10dp"          android:layout_width="wrap_content"          android:layout_height="wrap_content"          android:text="22" />  </RelativeLayout>  

The name on the left is great but the number on the right keeps getting messed up. I assume it has something to with android:layout_marginStart="410dp" but I'm not sure how else I can get the 22 to be on the right and on the same line as the name.

Application Insights - Cross Table Calculation Query

Posted: 23 Jun 2021 11:01 AM PDT

I'm trying to summarize the count of exceptions, the count of requests, and then the ratio of exceptions / requests. I can't determine how to calculate the two summaries and then project the ratio and return it. I'm trying something along the following without success:

let exceptionCount = exceptions  | where type == "ShiftDigital.InventoryServices.API.GetVehicleException" and outerMessage !contains("Invalid zip code")  | count as ExceptionCount;    requests  | count as RequestCount  | extend RequestCount / exceptionCount  

Can someone please advise on the correct way to structure this query?

jQuery Daterange Picker only showing current and future dates

Posted: 23 Jun 2021 11:01 AM PDT

Need date range picker to display dates in the past. The date range picker is currently displaying today's date and dates in the future only. Dates in the past are currently hidden and non-selectable. I need to know how to make dates in the past selectable as well.

HTML

<div class="datepicker"></div>  

Currently, this code shows 3 months in the past. But it only allows the user to select today's date or dates in the future. I need the date picker range to allow users to select dates from the past as well.

JavaScript

$(".datepicker").datepicker({      minDate: 0,      numberOfMonths: [3, 1],      beforeShowDay: function(date) {          var date1 = $.datepicker              .parseDate(                  $.datepicker._defaults.dateFormat,                  $("#input1")                  .val());        var date2 = $.datepicker          .parseDate(              $.datepicker._defaults.dateFormat,              $("#input2")              .val());        return [          true,          date1 &&          ((date              .getTime() == date1              .getTime()) || (date2 &&              date >= date1 && date <= date2)) ? "dp-highlight" :          ""      ];  },  onSelect: function(dateText,      inst) {      var date1 = $.datepicker          .parseDate(              $.datepicker._defaults.dateFormat,              $("#input1")              .val());      var date2 = $.datepicker          .parseDate(              $.datepicker._defaults.dateFormat,              $("#input2")              .val());      var selectedDate = $.datepicker          .parseDate(              $.datepicker._defaults.dateFormat,              dateText);        if (!date1 || date2) {          $("#input1").val(              dateText);          $("#input2").val("");          $(this).datepicker();      } else if (selectedDate < date1) {          $("#input2").val(              $("#input1")              .val());          $("#input1").val(              dateText);          $(this).datepicker();      } else {          $("#input2").val(              dateText);          $(this).datepicker();      }  }  });  

SSIS Custom Connection Manager not working in Script Component

Posted: 23 Jun 2021 11:02 AM PDT

I am creating a very simple connection manager for working with our SharePoint online list. The connection manager is working fine when I access it through a script task. However when I try to access it through a script component in a data flow I get the following error.

Object reference not set to an instance of the object.

I do have the Connection Manager added to the 'Connection Managers' tab of the script component.

I do not think this is due to how I've coded the connection manager since it works with script tasks and is very basic code mostly written by Microsoft. The code in my script component is also very basic and mostly from the the instructions on Microsoft's site. I will include the code for the script component as well as the connection manager.

Connection Manager

using System;  using System.Security;  using System.Collections.Generic;  using System.Linq;  using System.Text;  using System.Threading.Tasks;  using Microsoft.SqlServer.Dts.Runtime;  using Microsoft.SharePoint.Client;      namespace SharePointConnectionManager  {      [DtsConnection(          ConnectionType = "SPOWEB",          DisplayName = "SharePoint Online Web Connection",          Description = "Connection Manager for SharePoint Online")]      public class SharePointConnectionManager : ConnectionManagerBase      {          public string SiteUrl { get; set; }          public string UserName { get; set; }          public string Password { get; set; }            public SharePointConnectionManager()          {              SiteUrl = "xxxxxxxxxxxxxxxxxxxxxxx";              UserName = "xxxxxxxxxxxxxxxxxxxx";              Password = "xxxxxxxxxxxxxxxxx";          }            public override object AcquireConnection(object txn)          {              ClientContext ctx = new ClientContext(SiteUrl);                SecureString securePassword = new SecureString();              Password.ToList().ForEach(securePassword.AppendChar);                ctx.Credentials = new SharePointOnlineCredentials(UserName, securePassword);                Web web = ctx.Web;              ctx.Load(web);              ctx.ExecuteQuery();                return web;          }            public override void ReleaseConnection(object connection)          {              if (connection != null)              {                  base.ReleaseConnection(connection);              }          }            public override DTSExecResult Validate(IDTSInfoEvents infoEvents)          {              if (string.IsNullOrEmpty(SiteUrl))              {                  infoEvents.FireError(0, "SharePoint Connection Manager", "Site URL is mandatory.", string.Empty, 0);                  return DTSExecResult.Failure;              }              else if (string.IsNullOrEmpty(UserName))              {                  infoEvents.FireError(0, "SharePoint Connection Manager", "UserName is mandatory.", string.Empty, 0);                  return DTSExecResult.Failure;              }              else if (string.IsNullOrEmpty(Password))              {                  infoEvents.FireError(0, "SharePoint Connection Manager", "Password is mandatory.", string.Empty, 0);                  return DTSExecResult.Failure;              }              return DTSExecResult.Success;          }      }  }  

Script Component

#region Namespaces  using System;  using System.Data;  using System.Windows.Forms;  using Microsoft.SqlServer.Dts.Pipeline.Wrapper;  using Microsoft.SqlServer.Dts.Runtime.Wrapper;  using Microsoft.SharePoint.Client;  

No comments:

Post a Comment