Quickfixj- Custom FIX msg - 35=F not working for Multileg - quickfixj

I am using quickfixJ 2.3
To parse the FIX message , we have used
MessageUtils.parse(msgFactory,dd,inPutFixMsg, false)
I am able to place the list order ,multileg - 35= AB, AC order.
Now when I want to cancel the multileg order created by AB,
I just replaced 35=F, added 41 tag.
Now I am getting error while parsing in Message.parse : tag 600 appears more than once.
I am interested to know ,the other cancel( new order cancel, future cancel) working fine. Even I have mentioned the dd, then still why m I getting the error?
Or is there any other approach ?

You can't just change the message type (tag 35) and assume all the other tags are going to be compatible!
AB and F messages have different tags in their body. They are totally different messages!
The amount of stuff about FIX that you need to know exceeds what is appropriate for a StackOverflow answer. You really need to read some docs about how FIX messages are structured and decoded.

Related

This document requires 'TrustedScriptURL' assignment in Google Sheets

I have a Google Spreadsheet where I have the following information on specific cells in the sheet:
Cell B1: Has the URL http://www.google.com.co/search?q=NASA+watching+now%3A+site%3Awww.youtube.com
Cell B2: has the following formula: =IMPORTXML(B1,"//title")
Here is the link of the Google spreadsheet - if you want to test from your side.
And here is the Google Spreadsheet I'm working on - which, I want to get the specific data:
Title: Text (in the h3 HTML tag of the result item).
Url: Link (in the <a> HTML tag of the result item)
Description: Text next to the thumbnail of the result item.
See screenshot with the data to get using IMPORTXML:
The previous code returns the title of the given URL - in this case, the URL stored in the B1 cell.
It was working without problems (since 12/02/2022 - dd/MM/yyyy) until today (13/02/2022 - dd/mm/yyyy).
I checked the Chrome console "F12 Developer tools" and I get this error:
This document requires 'TrustedScript' assignment.
injectIntoContentWindow # VM364:27
By clicking the # VM364:27 line, the following code is shown:
function injectIntoContentWindow(contentWindow)
{
if (contentWindow && !injectedFramesHas(contentWindow))
{
injectedFramesAdd(contentWindow);
try
{
contentWindow[eventName] = checkRequest;
contentWindow.eval( /* ERROR with and (X) is shown here. */
"(" + injectedToString() + ")('" + eventName + "', true);"
);
delete contentWindow[eventName];
}
catch (e) {}
}
}
Searching on the internet, I barely could get the causes of this error:
Google Chrome update - making security stricter.
Chrome extensions - try to disable such extensions and try again.
CPS (Content-Security-Policy) - must be honest = I don't understand this point; it's from the website to scrape the data OR from Google Sheets the CPS is the root cause?
The solutions given to this problem are in Python - with the use of DOMPurify - as is described in this answer, but, I don't know and neither have found any clues about this problem and its solution in Google Spreadsheets.
I've tried:
Recover previous working Google Spreadsheet version - the result is that the formula re-evaluates and no result is returned; looking in Console, the This document requires 'TrustedScriptURL' assignment message shows.
Disable Google Chrome installed extensions - I only have AdBlock (this code was working without issues), anyway, I turned off, reload the spreadsheet and the error mentioned above raises in Console.
Using another page - I tried with Wikipedia and Wiki.fandom and it works - i.e. data is returned. Probably in this case, Google injected in their searcher an script for avoid injection? - I'm really not sure, only speculating/rambling here.
Another possible cause I consider is maybe my IP was blacklisted or blocked, but, I'm not sure.
My browser information:
Chrome version: 98.0.4758.82 (Build oficial) (64 bits) (cohort: Stable)
Windows 10 Version 21H2 (Build 19044.1466)
Is there any way to solve this error in Google Sheets?
PS: I'm interested in know the workaround using google sheets and/or custom scripts - via script editor/Apps Script. The use of IMPORTXML function is not mandatory - I find curious that it was working and then today, not anymore.
I will just leave this here:
=INDEX(UNIQUE(REGEXREPLACE(QUERY(IMPORTXML(A1, "//a/#href"),
"where Col1 contains 'youtube.com/'"), "\/url\?q=|&sa=.*", )))
=IMPORTXML(A1, "//title")
=IMPORTXML(A1, "//h3")
TL;DR: This document requires 'TrustedScript' assignment error is not the root cause of the delay of the IMPORTXML function - probably there is other cause(s) (outside of the developer's handling), but, after all, the code works - see working google spreadsheet - just, wait until the results are shown or use another way to web-scrapping the desired data.
Since the This document requires 'TrustedScript' assignment message stays appearing in the Console of the browser, but, the code I posted on my question (and the code posted by SO user player0 in their answer) works, it seems to me that the delay of the response using IMPORTXML might be due its buggy functionality and/or some restriction Google detected by doing multiple requests.
So, here are my tips about this:
Check very closely how the page where the data will be extracted from and its structured before doing excessive requests - or you might face a significant delay in the response of the IMPORTXML function - as I experienced it.
Get more familiar with XPath and check if the data is dynamically generated in the page - this makes even harder to get the desired data using this way of scrapping.
This is the spreadsheet with the desired results - if anyone is interesed1.
1 Check the "Results-mix" sheet (which contains both the code I manage to create and the code provided by player0 in their answer).
If you really want to get similar results in a less convoluted way, consider use another strategy for web-scrapping or use official APIs - when available.

I'm using ComputerCraft, a minecraft mod that adds computers, modems, and other peripherals. In this mod, you can write code using Lua

This is my first time using Lua, and with following a tutorial, Im making a chat program, allowing two players to send and receive messages to each other. The receiving is called chatreceive.lua. The script is:
rednet.open("right")
sender, message = rednet.receive()
print("computer " .. sender .. " has sent :")
print(message)
I keep getting an error saying
chatreceive.lua:3: attempt to concatenate global 'sender' (a nil value)
Any solutions? Ive been trying for a while now
That means that the variable 'sender' was nil. This probably means that there was some sort of error with rednet. You should add a lot of checks to make sure your programs don't fail in critical situations:
if sender==nil then
print("SENDER IS NIL!!!")
end
Also, what version of CC are you using? You shoud be more specific, to get better answers...

Why the email I send via the INSTRUCTOR > EMAILS is truncated?

1) Given my email, produced via a mailchimp online editor.
2) I go to my openEdX, log in as administrator of the MOOC. Then got to My MOOC > INSTRUCTOR > EMAILS, in order to send my email. First a test to myself, later to my 2000 mooc students.
3) The email I receive in my inbox is CUT HALF WAY. The bottom part is all missing.
QUESTION : What is going on there ? How to fix this ?
Look into your code for the first paragraph which disapeared. It's likely the buggy part.
For this case, I can see the first disappeared sentence is :
💡 Astuce : Pensez à inviter NudiMooc à suivre votre BLOG
My eyes are catched up by the strange 💡 sign, which is a rare unicode character.
Delete this exotic 💡 sign from your email / html5 code, and it will work again. I tested it by sending to myself. Horray ! The corrected code without the lightbulb was complete !! :D
OpenEdX processing may crash on this string. But because there are some witty security, the previous, valid text is kept.

Tag appears more than once while using Quickfix market data incremental refresh

I have implemented the fix client that request for market data. I have successfully logged on to the server but when the server sends us a MarketDataIncrementalRefresh message my application rejects with the message "Tag appears more than once" tag for which it is indicating is 55. Can you please help me in resolving it?
The message it rejects is:
8=FIX.4.2 9=196 35=X 34=14 49=Xenfin 56=newchange.api -price 52=20140528-08:54:32.144 262=156 268=2 279=1 269=0 278=B 55=EUR/USD 270=1.36201 271=1000000.00 279=1 269=1 278=A 55=EUR/USD 270=1.36205 271=1000000.00 10=133
and in my config file I have used no data dictionary and set UseDataDictionary=N
This usually means you have a configuration or DataDictionary problem, or both.
Configuration problem: Your config should have UseDataDictionary=Y, and DataDictionary=path/to/xml (or AppDataDictionary= and TransportDataDictionary= if you're on FIX5).
DataDictionary problem: Your counterparty has probably added custom fields to the message, and your DD hasn't been properly updated to reflect them. When parsing repeating groups, when the QF/n parser finds a field that doesn't belong (per DD) to the group, it assumes the group has ended. Any fields after that are considered to be outside the group.
You need to edit your DD file to reflect any changes that your counterparty has made to the standard message set. This will probably include adding custom fields, and may include rearranging field orderings or adding fields to groups that they don't normally belong in. See this page for more info about editing your DD:
http://quickfixn.org/tutorial/custom-fields-groups-and-messages
That's because you have a repeating group, once for bid, once for offer
8=FIX.4.2
9=196
35=X
34=14
49=Xenfin
56=newchange.api -price
52=20140528-08:54:32.144
262=156
268=2
279=1 269=0 278=B 55=EUR/USD 270=1.36201 271=1000000.00
279=1 269=1 278=A 55=EUR/USD 270=1.36205 271=1000000.00
10=133
and you're not handling it properly.

Lua error for WoW addon (Tukui)

I don't have a lot of coding experience, did some C a few years ago, so that helps, but Lua handles things a bit differently, so I can't keep track.
I sometimes (not always) get this error when a friend or guildy logs into the game:
Date: 2013-06-14 16:57:57
ID: -1
Error occured in: Global
Count: 4
Message: ..\AddOns\Tukui\scripts\chat.lua line 335:
attempt to concatenate upvalue 'classColor' (a nil value)
Debug:
[C]: ?
Tukui\scripts\chat.lua:335: AddMessage()
..\FrameXML\ChatFrame.lua:2755: ChatFrame_MessageEventHandler()
..\FrameXML\ChatFrame.lua:2491: ChatFrame_OnEvent()
...s\WIM\Libs\LibChatHandler-1.0\LibChatHandler-1.0.lua:281:
...s\WIM\Libs\LibChatHandler-1.0\LibChatHandler-1.0.lua:252
...s\WIM\Libs\LibChatHandler-1.0\LibChatHandler-1.0.lua:308:
...s\WIM\Libs\LibChatHandler-1.0\LibChatHandler-1.0.lua:296
I have to do a reload of the ui after this happens to be able to see chat text again for that person.
Line 335 in that .lua file is this:
text = replace(text, "^|Hplayer:(.+)|h%[(.+)%]|h", "|Hplayer:%1|h|cff"..classColor.."%2|r|h")
Now I've learned that the .. indicates the concatenate function, but that isn't really helping me.
I don't know if this is enough information, but if you need it I can post the whole local function or whatever else is required.
If it makes any difference, I'm running the 3.3.5a WoW client.
You are probably using a global that gets defined from some other addon in a now deterministic way
While the (classColor or "") will get you rid of the error, you should try and find why that variable (classColor) is sometimes defined and sometimes not. Maybe it happens only for certain classes?
A simple hack would be to just replace
..classColor..
with
..(classColor or "")..
where it will select a blank string when classColor has no value assigned to it.

Resources