Understanding the output log's auto layout data - ios8

I'm debugging a crash that I believe is auto layout related. When the crash occurs, I get an enormous dump of information on the output area that begins like this:
2015-06-04 13:23:44.158 SpeedySend[22084:861374] Objective: {objective
0x7f99e06b3730: <500:242.5, 250:18443.5> +
<500:1>*0x7f99e061e570.negError{id: 4899} +
<500:1>*0x7f99e061e570.posErrorMarker{id: 4898} + <500:1,
250:-1>*0x7f99e061f940.negError{id: 4913} + <500:1,
250:1>*0x7f99e061f940.posErrorMarker{id: 4912} + <500:1,
250:-1>*0x7f99e061fb40.negError{id: 4915} + <500:1,
250:1>*0x7f99e061fb40.posErrorMarker{id: 4914} + <500:1,
250:-2>*0x7f99e0620890.negError{id: 4807} + <500:1,
250:2>*0x7f99e0620890.posErrorMarker{id: 4806} +
<500:2>*0x7f99e06496f0.posErrorMarker{id: 4916} +
<500:2>*0x7f99e0649f40.posErrorMarker{id: 4920} + <50 ...
and then runs on for a very long time and ends like this:
... 250:-1>*0x7f99e1d77ec0.negError{id: 5023} + <800:1,
250:1>*0x7f99e1d77ec0.posErrorMarker{id: 5022} + <500:1,
250:-1>*0x7f99e1d78150.negError{id: 5025} + <500:1,
250:1>*0x7f99e1d78150.posErrorMarker{id: 5024} +
<500:1>*0x7f99e1d78310.negError{id: 5027} +
<500:1>*0x7f99e1d78310.posErrorMarker{id: 5026} +
<500:1>*0x7f99e1d78620.negError{id: 5045} +
<500:1>*0x7f99e1d78620.posErrorMarker{id: 5044} +
<500:1>*0x7f99e1d788c0.negError{id: 5031} +
<500:1>*0x7f99e1d788c0.posErrorMarker{id: 5030} +
<500:1>*0x7f99e1d78d30.negError{id: 5033} +
<500:1>*0x7f99e1d78d30.posErrorMarker{id: 5032} +
<500:1>*0x7f99e1d790a0.negError{id: 5035} +
<500:1>*0x7f99e1d790a0.posErrorMarker{id: 5034} +
<500:1>*0x7f99e1d79460.negError{id: 5037} +
<500:1>*0x7f99e1d79460.posErrorMarker{id: 5036} +
<500:1>*0x7f99e1d79840.negError{id: 5039} +
<500:1>*0x7f99e1d79840.posErrorMarker{id: 5038} +
<500:1>*0x7f99e1d79c50.negError{id: 5041} +
<500:1>*0x7f99e1d79c50.posErrorMarker{id: 5040} +
<500:1>*0x7f99e1d7a080.negError{id: 5043} +
<500:1>*0x7f99e1d7a080.posErrorMarker{id: 5042} +
<500:1>*0x7f99e1d7aa60.negError{id: 5047} +
<500:1>*0x7f99e1d7aa60.posErrorMarker{id: 5046} +
<500:-7.45058e-08>*0x7f99e1f7ae60.negError{id: 3600}}
I would like to understand this data better as an aid to debugging my problem.
Is there a document or a posting that I can access that explains the format and meaning of this data?
Like, for instance, what does something like <500:1,250:-1> represent?
What is a negError?
And, most importantly, can something like {id: 3600} be tied back to a specific control that auto layout is laying out for me?
I'm particularly interested in the last questions because I've read here that very small numbers, when seen in these dumps, can indicate a crash due to accumulated loss of floating point precision in the auto layout engine.
You'll note that I have such a number on the very last line of my output data. So, if I can relate {id: 3600} back to one of my controls, I hope that will put me close to the origin of the problem.

Related

Why isn't Laravel timing out?

I'm using Laravel 8.x on Windows 10 and am developing a CRUD that uses Vuetify on a Vue component that is trying to display the data in a small array of objects - just 11 items with four fields each - in a v-data-table. Most of the functionality is working now and I'm just doing the last bits of the code.
Everything has been going fine for several days but something has gone very wrong tonight. I changed a line or two of code, let npm run watch recompile the module I changed and hit refresh on my browser to see if the changes are working better than the original code. The refresh happened an hour and a half ago and I'm STILL waiting for it to render something!
It shows no sign of ending and I can't find any error messages anywhere. Apparently something is seriously wrong even though I've only changed a couple of lines of code. I'm completely baffled. I've never touched the default timeout settings and, honestly, don't even know where they are.
I have had timeouts before, in fact I manage to have two or three a day. For no reason I know, the first refresh after I've been away from the computer for an hour or two will tend to timeout while subsequent ones will go very quickly and let me get back to work coding. When I do get a timeout, the message says the timeout happened after 60 seconds. Of course that is not elapsed time - elapsed time is more like 5 to 10 minutes - but surely my current process should have timed out long ago.
Why am I getting timeouts when I get them? Why am I NOT getting one despite my last refresh having been over 90 minutes ago now? I should mention that I've rebooted the entire computer and even that did not help.
How can I get Laravel working better?
Update
As per Maarten's suggestion, I've reverted my code. Well, not exactly reverted it but it solved the problem. I had this:
deleteRow() {
this.deleteRowFlag = false;
this.deleteMessage = "Task deleted";
console.log(this.name + ".deleteRow() - deleteID: " + this.deleteID);
console.log(this.name + ".deleteRow() - deleteDescription: " + this.deleteDescription);
var index = -1;
for (let todo of this.todos) {
if (todo.id == deleteID) index = todo.index;
}
// const index = this.todos.indexOf(this.deleteDescription);
console.log(this.name + ".deleteRow() - index: " + index);
var deletedItemsArray = this.todos.splice(index, 1);
console.log(this.name + ".deleteRow() - deletedItemsArray.length: " + deletedItemsArray.length);
console.log(this.name + ".deleteRow() - deletedItemsArray[0].id: " + deletedItemsArray[0].id);
console.log(this.name + ".deleteRow() - deletedItemsArray[0].description: " + deletedItemsArray[0].description);
//FIX: Isn't actually deleting the row!
this.showDeleteSnackbar = true;
},
I couldn't imagine any of that being a problem and the little for loop was the last thing I added so I simply commented it out like so:
deleteRow() {
this.deleteRowFlag = false;
this.deleteMessage = "Task deleted";
console.log(this.name + ".deleteRow() - deleteID: " + this.deleteID);
console.log(this.name + ".deleteRow() - deleteDescription: " + this.deleteDescription);
// var index = -1;
// for (let todo of this.todos) {
// if (todo.id == deleteID) index = todo.index;
// }
// const index = this.todos.indexOf(this.deleteDescription);
console.log(this.name + ".deleteRow() - index: " + index);
var deletedItemsArray = this.todos.splice(index, 1);
console.log(this.name + ".deleteRow() - deletedItemsArray.length: " + deletedItemsArray.length);
console.log(this.name + ".deleteRow() - deletedItemsArray[0].id: " + deletedItemsArray[0].id);
console.log(this.name + ".deleteRow() - deletedItemsArray[0].description: " + deletedItemsArray[0].description);
//FIX: Isn't actually deleting the row!
this.showDeleteSnackbar = true;
},
I gave npm run watch a moment to compile the code, cloned the browser window, and refreshed. This time, the page rendered immediately. It looks as if I created an infinite loop and Laravel apparently failed to detect it and shut it down! I am astonished. I thought all professional development software for decades monitored for that kind of thing at compile time and execution time. I've been coding for multiple decades and I haven't seen a runaway loop since very early in my coding days.
I can see immediately that I need a this in front of deletedID in the loop. I'm surprised that the compiler didn't jump on that! (Actually, I think the logic still wouldn't work with that change so I'm going to take a few minutes to relearn how to manipulate arrays of objects in Javascript.)
As for the network tab in the browser, there was nothing in it. There was nothing in most of the tabs. And there was nothing in the npm run watch terminal window after I'd written the bad code.

boost log text_file_backend performance

I am using boost log and I choose the text_file_backend, but I got bad performance. No matter sync or async, the boost log has a low performance. About in 6 seconds, it wrote 30M data to log file.
Follow is my code snippet, anyone can help me?
typedef boost::log::sinks::asynchronous_sink<
boost::log::sinks::text_file_backend> TextSink;
boost::log::sources::severity_logger_mt<LogSev> logger_;
boost::shared_ptr<TextSink> report_sink_;
// initialize report_sink
boost::shared_ptr<sinks::text_file_backend> report_backend =
boost::make_shared<sinks::text_file_backend>(
keywords::file_name = target + "/" + file_name
+ ".report.log.%Y_%m_%d.%N",
keywords::rotation_size = file_size, keywords::time_based_rotation =
sinks::file::rotation_at_time_point(0, 0, 0),
keywords::auto_flush = false);
boost::shared_ptr<sinks::file::collector> report_collector = CreateCollector(
target, max_use_size / 2, min_free_size);
report_backend->set_file_collector(report_collector);
report_backend->scan_for_files();
// add sink: report_sink
report_sink_ = boost::make_shared<TextSink>(report_backend);
report_sink_->set_formatter(
expr::format("[%1%]" + sep + "[%2%]" + sep + "[%3%]" + sep + "%4%")
% expr::format_date_time<boost::posix_time::ptime>(
"TimeStamp", "%Y-%m-%d %H:%M:%S.%f")
% expr::attr<LogSev>("Severity")
% expr::attr<attrs::current_thread_id::value_type>("ThreadID")
% expr::message);
report_sink_->set_filter(expr::attr<LogSev>("Severity") >= report);
logging::core::get()->add_sink(report_sink_);
logging::add_common_attributes();
BOOST_LOG_SEV(logger_, info) << "blabal...";
I think one performance issue about your implementation is about Timestamp. It needs a system-call to find Time. I encountered the same problem. So I turned to use date library. It returns UTC time very fast. Also check first answer of this question, However if you want Timestamp based on timezone, date library is slow. you should better define your timezone and add to UTC.
see the example:
#include "date.h"
#define MY_TIME std::chrono::hours(4) + std::chrono::minutes(30)
string timestamp = date::format("%F %T", std::chrono::system_clock::now() +
MY_TIME);

SELECT * INTO Incomplete Query Clause

I seem to be doing something wrong in my OleDbCommand, but I don't know what it is. I am trying to create another table in my access database that is exactly the same as the first but with a different name, by copying everything from one and using SELECT INTO. I don't know why it doesn't work.
OleDbCommand copyAttendanceCommand = new OleDbCommand("SELECT * INTO '" + "Attendance " + DateTime.Now.Day + "/" + DateTime.Now.Month + "/" + DateTime.Now.Year + "' FROM Attendance",loginForm.connection);
copyAttendanceCommand.ExecuteNonQuery();
The Error message that I get says "Syntax error in query. Incomplete query clause." Does anyone know what that means?
Table or field names with spaces are not specified with '' around them, but with square brackets.
Your command should be:
"SELECT * INTO [Attendance " + DateTime.Now.Day + "/" + DateTime.Now.Month + "/"
+ DateTime.Now.Year + "] FROM Attendance"
You may even format your date to make the code more readable:
string today = DateTime.Today.ToString("d'/'M'/'yyyy");
string sql ="SELECT * INTO [Attendance " + today + "] FROM Attendance";
OleDbCommand copyAttendanceCommand = new OleDbCommand(sql, loginForm.connection);
copyAttendanceCommand.ExecuteNonQuery();

Alternatives to macros for accessing data objects

I'm about to begin implementing a new version of an Email marketing program for my company. The old version of the program program heavily depended on micros and has about 2000 lines to prepare data for an email campaign to be run. But I have read somewhere that macros are not the best solution to run such heavy tasks and it's better we keep them for simple things.
I'm quite new to QV and I'm the kind of person that likes to learn as I go and not complete a big reference book before I start a project. I'm good at C# and Java but I realized QlikView scripts are in either VBScript or JScript. I have no experience with them whatsoever but they don't look very complicated to me at first glance.
What I was wondering was whether there is a better way of handling data in QlikView? That means can I use another programming language or do you suggest I stick to the script languages provided by QV? Because one big problem I've seen is that as macros get larger they become very hard to debug.
In the old version of our program developed by one of my colleagues who has now left the company, as soon as there was an error in preparing the data, all we got was the macros window with no clue about where the error had taken place. As I would like to implement this project incrementally and little by little, I would like to have a good mechanism for trouble shooting rather than goring though a 2000-line script to understand where the problem comes from.
Your suggestions about how to bring this project to a safe shore are very welcome. So, any good plugins or 3rd party app to monitor the data and facilitate my implementation can help.
We are an outlier there. We are using the OCX and connect to it in winforms.
We have then standard c# code with everything debuggable and it makes everyone here very happy indead after using endless amount of time debugging javascripts.
The users use QV for selecting stuff and then we use the selected event in the OCX and pull the selected data from QV for postprocessing and tag the QV data with dynamic sql update.
I do not nessesarily recommend this method, but it has increased dramatically the development output for us when using QV for datamining and then processing the data selected.
Next project we are not going to use the OCX. But all the buisness logic and postprocessing is in a com visible c# dll' that we access through vbscript macro.
EDIT. More details
This is the current setup communicating with the document through OCX
Change a selection
axQlikMainApp.ActiveDocument.Fields("%UnitID").Clear();
var selSuccess = axQlikMainApp.ActiveDocument.Fields(cls.QlikView.QvEvalStr.Fields.UnitId).Select("(%UnitID)");
reset a sheet object
axQlikMainApp.ActiveDocument.ClearCache();
axQlikMainApp.ActiveDocument.GetSheetObject("Document\\MySheetObjectName").Restore();
get a string from QV
string res axQlikMainApp.ActiveDocument.Evaluate("=concat(Distinct myField1 &'|' & MyField2,'*')");
and can get horribly complicated
string res axQlikMainApp.ActiveDocument.Evaluate( "=MaxString({1 <%UnitID= {" + sUnitIds + #"}>}'<b>' & UnitName & '</b> \r\n bla bla bla:' & UnitNotesPlanning) & " +
"'\n title1: ' & Count({1 <%UnitID= {" + sUnitIds +#"},%ISODate={'" + qlickViewIsoDate + "'},Need = {'Ja'}" + MinusCalc + ">}Distinct %CivicRegNo) & " +
"'\n Title2: ' & Count({1 <%UnitID= {" + sUnitIds + #"},%ISODate={'" + qlickViewIsoDate + "'} " + recallMinusCalc + ">}DISTINCT RevGUID) & " +
"'\n Title3: ' & Count({1 <%UnitID= {" + sUnitIds + #"},%ISODate={'" + qlickViewIsoDate + "'},Need2 = {'Ja'}>}Distinct %CivicRegNo) & '" +
"\n Title4:' & MinString({1 <%UnitID= {" + sUnitIds + #"},FutureBooking = {1}>} Date(BookingStart) & ' Beh: ' & If(IsNull(ResourceDisplayedName),'_',ResourceDisplayedName)) &'" +
"\n Title5:' & MaxString({1 <%UnitID= {" + sUnitIds + #"},FutureBooking = {0}>} Date(BookingStart) & ' Beh: ' & If(IsNull(ResourceDisplayedName),'_',ResourceDisplayedName)) &''" +
" & MaxString({1 <%UnitID= {" + sUnitIds + #"}>}if(UnitGeo_isRelocatedOnSameGeo=1,'\nOBS! Multiple geo addresses. Zoom!',''))" +
""
);

How to insert line break in a return statement for D3

I have the following code d3 code:
tooltip.select("#popupCount").text(function(){
if (varToGraph == "rough_top_cost"){
return " " + textValue + ": $" + addCommas(allCountyData[countyName][varToGraph]) + "\n" +
"Count:"
}})
I want the word count to appear on a new line. However, the above code results in everything being on one line. How can I get the output to be on two lines?
Thanks,
AH
Untested answer, but FWIW this may get close;
tooltip.select("#popupCount").html(function(){
if (varToGraph == "rough_top_cost"){
return " " + textValue + ": <br/>$" + addCommas(allCountyData[countyName][varToGraph]) + "\n" +
"Count:"
}})
Working from the example provided on page 80 of D3 Tips and Tricks which includes tooltips with line breaks.
Uses html element instead of text which allows line breaks. Check out the document for more detail.

Resources