Don't know why the the FIX server is throwing this error. Using Fix.4.4, I've got a client generating a Market Order. Its being received by the Server, but its returning an error.
The Logon is successful on the client and server side. Then the client sends a market order:
Header [8=FIX.4.4 | 9=130 | 35=D | 34=92 | 49=BROKER_CLIENT | 52=20121009-00:58:44.283 | 56=BROKER_SERVER | ] Body [11=0 | 21=1 | 38=100 | 40=1 | 54=1 | 55=JNJ | 59=0 | 60=20121009-00:58:44 | ] Trailer [10=035 | ]
This is received from the 'fromApp' method of the server. The server then responds with:
(Message 92 Rejected: Conditionally Required Field Missing:35)
Field35 is clearly there, can't see why the server is responding with an error.
This question was also posted to the mailing list. Turns out Mr. Flores was calling
std::string msgType = message.getField(FIX::FIELD::MsgType);
instead of
std::string msgType = message.getHeader().getField(FIX::FIELD::MsgType);
in his FromApp() call.
Related
I need to extract the HOST from millions of URLs. Some of the URLs are not formed well and return NULL. In many cases I see braces ({}) or pipes (|) causing issues, other times I see multiple hash (#) characters causing issues.
Here is my code containing URLs that I need to parse:
val b = Seq(
("https://example.com/test.aspx?doc={1A23B4C5-67D8-9012-E3F4-A5B67890CD12}"),
("https://example.com/test.aspx?names=John|Peter"),
("https://example.com/#/test.aspx?help=John#top"),
("https://example.com/test.aspx?doc=1A23B4C5-67D8-9012-E3F4-A5B67890CD12"),
).toDF("url_col")
b.createOrReplaceTempView("temp")
spark.sql("SELECT parse_url(`url_col`, 'HOST') as HOST, url_col from temp").show(false)
Expected output:
+-----------+------------------------------------------------------------------------+
|HOST |url_col |
+-----------+------------------------------------------------------------------------+
|example.com|https://example.com/test.aspx?doc={1A23B4C5-67D8-9012-E3F4-A5B67890CD12}|
|example.com|https://example.com/test.aspx?names=John|Peter |
|example.com|https://example.com/#/test.aspx?help=John#top |
|example.com|https://example.com/test.aspx?doc=1A23B4C5-67D8-9012-E3F4-A5B67890CD12 |
+-----------+------------------------------------------------------------------------+
Current output:
+-----------+------------------------------------------------------------------------+
|HOST |url_col |
+-----------+------------------------------------------------------------------------+
|null |https://example.com/test.aspx?doc={1A23B4C5-67D8-9012-E3F4-A5B67890CD12}|
|null |https://example.com/test.aspx?names=John|Peter |
|null |https://example.com/#/test.aspx?help=John#top |
|example.com|https://example.com/test.aspx?doc=1A23B4C5-67D8-9012-E3F4-A5B67890CD12 |
+-----------+------------------------------------------------------------------------+
Is there a way to force parse_url to return the host when the URL contains invalid characters or is mal-formed? Or is there a better way?
You can extract the domain using regexp_extract function (example of regex):
spark.sql("""
SELECT regexp_extract(url_col, "^(?:https?:\/\/)?(?:[^#\n]+#)?(?:www.)?([^:\/\n?]+)", 1) as HOST,
url_col
FROM temp
""").show(false)
//+-----------+------------------------------------------------------------------------+
//|HOST |url_col |
//+-----------+------------------------------------------------------------------------+
//|example.com|https://example.com/test.aspx?doc={1A23B4C5-67D8-9012-E3F4-A5B67890CD12}|
//|example.com|https://example.com/test.aspx?names=John|Peter |
//|example.com|https://example.com/#/test.aspx?help=John#top |
//|example.com|https://example.com/test.aspx?doc=1A23B4C5-67D8-9012-E3F4-A5B67890CD12 |
//+-----------+------------------------------------------------------------------------+
I have celery setup and working together with django. I have some periodic tasks that run. The celery log shows that the tasks are executed and that they return something.
[2017-03-26 14:34:27,039: INFO/MainProcess] Received task: my_webapp.apps.events.tasks.clean_outdated[87994396-04f7-452b-a964-f6bdd07785e0]
[2017-03-26 14:34:28,328: INFO/PoolWorker-1] Task my_webapp.apps.events.tasks.clean_outdated[87994396-04f7-452b-a964-f6bdd07785e0] succeeded in 0.05246314400005758s: 'Removed 56 event(s)
| Removed 4 SGW(s)
'
But the result is not showing up on django-celery-results admin page.
These are my settings:
CELERY_BROKER_URL = os.environ.get('BROKER_URL')
CELERY_ACCEPT_CONTENT = ['json']
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
CELERY_TIMEZONE = 'Europe/Stockholm'
CELERY_RESULT_BACKEND = 'django-cache'
CELERYBEAT_SCHEDULER = 'djcelery.schedulers.DatabaseScheduler'
CELERY_RESULT_DB_SHORT_LIVED_SESSIONS = True # Fix for low traffic sites like this one
I have also tried setting CELERY_RESULT_BACKEND = 'django-db'. I know the migrations are made (when using those settings), the table exists in the database:
my_webapp=> \dt
List of relations
Schema | Name | Type | Owner
--------+--------------------------------------+-------+----------------
...
public | django_celery_beat_crontabschedule | table | my_webapp
public | django_celery_beat_intervalschedule | table | my_webapp
public | django_celery_beat_periodictask | table | my_webapp
public | django_celery_beat_periodictasks | table | my_webapp
public | django_celery_results_taskresult | table | my_webapp
...
(26 rows)
Google won't give me much help, most answers is about old libraries like djcelery. Any idea how the get the results in the table?
Here is my table in the database :
id | account_name | account_number | account_type | address | email | ifsc_code | is_default_account | phone_num | User
-----+--------------+----------------+--------------+---------+------------------------------+-----------+--------------------+-------------+----------
201 | helloi32irn | 55265766432454 | Savings | | mypal.appa99721989#gmail.com | 5545 | f | 98654567876 | abc
195 | hello | 55265766435523 | Savings | | mypal.1989#gmail.com | 5545 | t | 98654567876 | axyz
203 | what | 01010101010101 | Current | | guillaume#sample.com | 6123 | f | 09099990 | abc
On form submission in the view, which only posts a single parameter which in my case is name= "activate" which corresponds to the column "is_default_account" in the table.
I want to change the value of "is_default_account" from "t" to "f". For example here in the table, for account_name "hello" it is "t". And i want to deactivate it, i.e make it "f" and activate any of the other that has been sent trough the form
This will update your table and make account 'what' default (assuming that is_default_account is BOOLEAN field):
UPDATE table
SET is_default_account = (account_name = 'what')
You may want limit updates if table is more than just few rows you listed, like this:
UPDATE table
SET is_default_account = (account_name = 'what')
WHERE is_default_account != (account_name = 'what')
AND <limit updates by some other criteria like user name>
I think to accomplish what you want to do you should send at least two values from the form. One for the id of the account you want to update and the other for the action (activate here). You can also just send the id and have it toggle. There are many ways to do this but I can't figure out exactly what you are trying to do and whether you want SQL or Playframework code. Without limiting your update in somewhere (like id) you can't precisely control what specific rows get updated. Please clarify your question and add some more code if you want help on the playframework side, which I would think you do.
Where can I find the documentation for MicroStrategy Command Manager? I've look through various docs that I have but not able to find any comprehensive list of commands. Particularly, I need to know a list of commands to create attributes and metrics.
Thanks
The best way to find the list of available commands is to use the Outlines option, available inside Command Manager.
To create an attribute use the following syntax:
CREATE ATTRIBUTE "<attribute_name>" [DESCRIPTION "<description>"] [LONGDESCRIPTION "<long_description>"] IN [FOLDER] "<location_path>" [HIDDEN (TRUE | FALSE)] ATTRIBUTEFORM "<form_name>" [FORMCATEGORY "<category_name>"] [FORMDESC "<form_description>"] [FORMTYPE (NUMBER | TEXT | DATETIME | DATE | TIME | URL | EMAIL | HTML | PICTURE | BIGDECIMAL | PHONENUMBER)] [REPORTSORT (NONE | ASC | DESC)] [BROWSESORT (NONE | ASC | DESC)] EXPRESSION "<form_expression>" [MAPPINGMODE (AUTOMATIC | MANUAL)] [EXPSOURCETABLES "<sourcetable1>" [, "<sourcetable2>" ...]] LOOKUPTABLE "<lookup_table>" FOR PROJECT "<project_name>";
and for metrics creation:
CREATE METRIC "<metric_name>" IN [FOLDER] "<location_path>" EXPRESSION "<expression>" [DESCRIPTION "<description>"] [LONGDESCRIPTION "<long_description>"] [HIDDEN (TRUE | FALSE)] [ALLOWSMARTMETRIC (TRUE | FALSE)] [REMOVEREPORTFILTERELEMENTS (TRUE | FALSE)] [TOTALSUBTOTALFUNCTION (AVERAGE | COUNT | DEFAULT| GEOMETRICMEAN | MAXIMUM | MEDIAN | MINIMUM | MODE | NONE | PRODUCT | STANDARDDEVIATION | SUM | VARIANCE)] [DYNAMICAGGREGATIONFUNCTION (AVERAGE | COUNT | DEFAULT| GEOMETRICMEAN | MAXIMUM | MEDIAN | MINIMUM | MODE | NONE | PRODUCT | STANDARDDEVIATION | SUM | VARIANCE)] [COLUMNALIAS "<columnalias>"] FOR PROJECT "<project_name>";
Some simple examples provided bellow (again from the outlines available inside command manager):
CREATE ATTRIBUTE "Day" DESCRIPTION "Duplicate of Day Attribute from folder \Time" IN FOLDER "\Schema Objects\Attributes" ATTRIBUTEFORM "ID" FORMCATEGORY "ID" FORMDESC "Basic ID form" FORMTYPE TEXT REPORTSORT ASC EXPRESSION "[DAY_DATE]" LOOKUPTABLE "LU_DAY" FOR PROJECT "MicroStrategy Tutorial";
CREATE METRIC "New Metric" IN FOLDER "\Public Objects\Metrics\Count Metrics" EXPRESSION "Count(Customer) {Country} <[Western United States Customers]>" FOR PROJECT "MicroStrategy Tutorial";
As Bruno said, the Outlines option gives you all the templates that there are in Command Manager, which you can build together and define to do what you want. If in doubt, check out the "MicroStrategy System Administration Guide" product manual, which covers all you need to know on command manager.
Here is one useful site with Command Manager documentation:
https://metacpan.org/pod/Business::Intelligence::MicroStrategy::CommandManager
After executing that query
select count(*) from tablename WHERE query=';';
that query will return count as 20.
But that table having totally 771498 records. while execute on SHOW STATUS LIKE 'sphinx_%';
it has return like this
+--------------------+--------+
| Variable_name | Value |
+--------------------+--------+
| sphinx_error | 5732 |
| sphinx_time | 837 |
| sphinx_total | 1000 |
| sphinx_total_found | 771498 |
| sphinx_word_count | 0 |
| sphinx_words | |
+--------------------+--------+
Here i have doubt .
what is sphinx_error?
what is sphinx_time?
what is sphinx_total?
what is sphinx_total_found?
what is sphinx_word_count?
what is sphinx_words?
It will be very helpful for me. Advance thanks
firstly sphinxse is not a real mysql table. Its a fake table. It accepts a query, then sphinxse forwards it to a running instance in the background, and returns the results to produce a 'table' to mysql.
So count(*) wont work. It simply runs the query and counts the rows. There are only 20 rows, unless you ask for more.
sphinx_error? - indicates an error - maybe SHOW WARNINGS would get the text.
sphinx_time? - how long in milisecons the query took
sphinx_total? - how many records you can actully retrieve (subject to max_matches)
sphinx_total_found? - how many records actully match
sphinx_word_count? - the number of words in your query
sphinx_words? - how many docs/hits match each of the words - because you have no query, its empty.