Categories
Mastering Development

How do i combine 3 queries into 1

I have 2 tables: Battles –battleId(primary)–gameId(foreign)–endTime BattleParticipants –battleParticipantId(primary)–userId(foreign)–someNumerical–score–battleId(foreign) Given userId, i want to get only ended battle data for each battle user participated in with additional player rank information and total number of player participated in battle information.Ended battle means battles only with endTime smaller than current_time returned battle data should include: battleId: endTime: gameId: […]

Categories
CMS Joomla Mastering Development

Altering the SQL custom field

If I hardwire an sql custom field, the query works as it should (for this specific userid, 305): SELECT id AS value, title AS text FROM #__content where catid = 8 and created_by = 305 What I want to do is allow the created_by clause to be dynamic : Substituted with JFactory::getUser()->id; I figured if […]

Categories
Mastering Development

How do you convert a complex “HttpResponseMessage” to a C# object?

I am using an API and sending a post request that returns a HttpResponseMessage in JSON format and I want to convert this object to C# object. when I receive the response from the app The ClientLocations object is null, nothing gets in there, but when I try it with postman I get the locations […]

Categories
Mastering Development

React Native Image upload to firebase: Possible Unhandled Promise Rejection (id:0):TypeError:undefined is not an object (evaluating this.setState)

I am new to react native. My objective is to 1.Registration screen 2.User selects a button to take picture/ select a picture from the phone 3.I want this selected picture to be stored in firebase storage The image is not getting stored Possible unhandled Promise Rejection (id:0):TypeError:undefined is not an object (evaluating “this.setState({ image:result.uri}).then import […]

Categories
Mastering Development

python pyhs2.query execution not finished

import pyhs2 with pyhs2.connect(host=’ip’, port=10000, authMechanism=”PLAIN”, user=’id’, password=’password’, database=’default’) as conn: with conn.cursor() as cur: # Show databases print cur.getDatabases() #Execute query data_sql = data_sql.format(from_date=first,to_date=last) cur.execute(data_sql) # Return column info from query col = [a[‘columnName’] for a in cur.getSchema()] df = pd.DataFrame(cur.fetch(),columns= col) df.head() i running a query in anaconda tool.. in hue site, i […]

Categories
Development

How to make php script to run insert sql Query and then get information from the inserted rows ? I am a Beginner

I have so far this script and I am aiming to run the sql insert query and fetch the results and echo some of them to appear in the web page. I want to have id and code and Period to appear in the output. Everytime, I run the script, it gives me the error […]

Categories
Development

SQL Azure Remote Procedure

We are trying to execute a remote procedure on an Azure database : INSERT INTO #temp ( ConsultantId ,UserId ,Name ,Email ,Phone ,DefaultContact ) EXEC @RemoteResult = sp_execute_remote @RemoteSource ,@SQLString ,@ParmDefinition ,@userid = @userid; Where #temp is a table with the same 6 columns as shown in the insert above. However, we always get the […]

Categories
Development

DocuSignAPI – Sign an envelope via API

We are creating an application that processes signed documents. As part of the testing process, I’d like to automate the creation and signing of sample documents. How can I sign the documents via postman? Using the Postman scripts located at the DocuSign/blog, I can authenticate: https:///restapi//login_information?api_password=true { “loginAccounts”: [ { “name”: “Personal”, “accountId”: “9”, “baseUrl”: […]

Categories
Development

Why do I get an Intermittent syntax error on this php code?

I get this error intermittently when executing the PHP code below. The query works in PHPMyAdmin everytime. I have tried changing quotation marks and changing the spotId to be a different type of variable but nothing seems to fix it. Error: Error description: You have an error in your SQL syntax; check the manual that […]

Categories
Development Linux

How can I output a string plus wild card in linux from a file?

So I have a log/text file. in that file there is a bunch of information, but I’m looking to only get a certain string. @@204,clientDisconnect,”apMac”=”60:d0:2c:3a:f2:60″,”clientMac”=”8c:45:00:84:e8:98″,”ssid”=”Th”,”userId”=””,”wlanId”=”240″,”iface”=”wlan32″,”tenantU,19″,,”userName”=”d”,”vlanId”=”512″,”radio”=”a/n/ac”,”encryption”=”WPA2-AES”,”osType”=”Android”,”hostname”=”Galaxy-S9″,”firstAuth”=”1580412687″,”associationTime”=”1580411444″,”ipAssignTime”=”1580412688″,”disconnectTime”=”1580412724″,”sessionDuration”=”37″,”disconnectReason”=”8″,”rxFrames”=”26″,”rxBytes”=”4415″,”txFrames”=”93″,”txBytes”=”22693″,”peakRx”=”4415″,”peakTx”=”22693″,”rssi”=”62″,”receivedSignalStrength”=”-43″,”Instantaneous I only want the disconnectReason = “8” . but that disconnect number can change depending how why the client disconnected. I’m not sure how to search the file and only […]