Is there an easy way to strip HTML from a QString in Qt?
QString s = “<i>Test:</i><img src=\”blah.png\” /><br> A test case”; s.remove(QRegExp(“<[^>]*>”)); // s == “Test: A test case”
QString s = “<i>Test:</i><img src=\”blah.png\” /><br> A test case”; s.remove(QRegExp(“<[^>]*>”)); // s == “Test: A test case”
From the (Mac OS X, but others are similar) man page: strip removes or modifies the symbol table attached to the output of the assembler and link editor. This is useful to save space after a program has been debugged and to limit dynamically bound symbols. Note the bit about “after a program has been … Read more
Consider: /** * Returns the style for a node. * * @param n The node to check. * @param p The property to retrieve (usually ‘display’). * @link http://www.quirksmode.org/dom/getstyles.html */ this.getStyle = function( n, p ) { return n.currentStyle ? n.currentStyle[p] : document.defaultView.getComputedStyle(n, null).getPropertyValue(p); } /** * Converts HTML to text, preserving semantic newlines for … Read more
Apart from the obvious (-Os -s), aligning functions to the smallest possible value that will not crash (I don’t know ARM alignment requirements) might squeeze out a few bytes per function. -Os should already disable aligning functions, but this might still default to a value like 4 or 8. If aligning e.g. to 1 is … Read more
Write a function that takes a char and returns true if you want to remove that character or false if you want to keep it: bool my_predicate(char c); Then use the std::remove_if algorithm to remove the unwanted characters from the string: std::string s = “my data”; s.erase(std::remove_if(s.begin(), s.end(), my_predicate), s.end()); Depending on your requirements, you … Read more
I work at TestFlight. Short answer is: set it to YES. Long answer: @Kerni is correct. Before we started symbolicating server side, we needed that data to symbolicate on device. So if you upload your dSYM to TestFlight, you can strip them. If you don’t want to upload your dSYM for some reason, you can … Read more
Ok, here a big edition of my previous answer. I think I found a way now. You (still 🙂 have this specific problem: (gdb) disas main No symbol table is loaded. Use the “file” command. Now, if you compile the code (I added a return 0 at the end), you will get with gcc -S: … Read more
The ELF loader loads segments, not sections; the mapping from sections to segments is determined by the linker script used for building the executable. The default linker script does not map debug sections to any segment, so this is omitted. Symbol information comes in two flavours: static symbols are processed out-of-band and never stored as … Read more
So the solution we have for now is as follows: test.cpp #include <cmath> #include <vector> #include <typeinfo> struct private_struct { float f; }; float private_function(float f) { return std::abs(f); } void other_private_function() { std::vector<private_struct> f(1); } extern “C” void __attribute__ ((visibility (“default”))) public_function2() { other_private_function(); } extern “C” float __attribute__ ((visibility (“default”))) public_function1(float f) { … Read more
Use str.replace. >>> papa.replace(‘papa’, ”) ‘ is a good man’ >>> app.replace(‘papa’, ”) ‘app is important’ Alternatively use re and use regular expressions. This will allow the removal of leading/trailing spaces. >>> import re >>> papa=”papa is a good man” >>> app = ‘app is important’ >>> papa3 = ‘papa is a papa, and papa’ … Read more