I have a Python class:
class PatientParamStruct:
output_folder = ''
condition_timestamps = None # list cannot be initialized here!
lag_time = 0
lead_time = 0
feature_numbers = None
input_feature_folder = ''
input_folder_validation = ''
patient_number = 0
lag_number_of_windows = 0
samples_per_second = 0
prediction_window = 0
moving_window_time = 0
subwindow_lag_time = 0
Can I sort alphabetically a bunch of lines in Eclipse PyDev?
In this case the output would be:
class PatientParamStruct:
condition_timestamps = None # list cannot be initialized here!
feature_numbers = None
input_feature_folder = ''
input_folder_validation = ''
lag_number_of_windows = 0
lag_time = 0
lead_time = 0
moving_window_time = 0
output_folder = ''
patient_number = 0
prediction_window = 0
samples_per_second = 0
subwindow_lag_time = 0
Yes, you can use:
Ctrl+Shift+O
It's the same binding used for the organize imports, but if some text is selected it'll sort the text (and if no text is selected it'll organize imports and try to add new imports for unresolved tokens).
Related
I have macCatalyst app that recently gets some random crashes. Searched everywhere but without finding any good leads. My guess is that it's related to memory or too many views visible on the screen. I do not get a good stack trace, but this it what's showing in the log:
-[MTLDebugDevice notifyExternalReferencesNonZeroOnDealloc:]:2951: failed assertion `The following Metal object is being destroyed while still required to be alive by the command buffer 0x7f8cd811c600 (label: <no label set>):
<MTLToolsObject: 0x7f8b0f9e3d60> -> <MTLIGAccelTexture: 0x7f8cd8566a00>
label = CAMetalLayer Drawable
textureType = MTLTextureType2D
pixelFormat = MTLPixelFormatBGRA8Unorm_sRGB
width = 772
height = 1372
depth = 1
arrayLength = 1
mipmapLevelCount = 1
sampleCount = 1
cpuCacheMode = MTLCPUCacheModeDefaultCache
storageMode = MTLStorageModeManaged
hazardTrackingMode = MTLHazardTrackingModeTracked
resourceOptions = MTLResourceCPUCacheModeDefaultCache MTLResourceStorageModeManaged MTLResourceHazardTrackingModeTracked
usage = MTLTextureUsageShaderRead MTLTextureUsageShaderWrite MTLTextureUsageRenderTarget MTLTextureUsagePixelFormatView
shareable = 0
framebufferOnly = 0
purgeableState = MTLPurgeableStateNonVolatile
swizzle = [MTLTextureSwizzleRed, MTLTextureSwizzleGreen, MTLTextureSwizzleBlue, MTLTextureSwizzleAlpha]
isCompressed = 0
parentTexture = <null>
parentRelativeLevel = 0
parentRelativeSlice = 0
buffer = <null>
bufferOffset = 0
bufferBytesPerRow = 0
iosurface = 0x600002533060
iosurfacePlane = 0
allowGPUOptimizedContents = YES'
-[MTLDebugDevice notifyExternalReferencesNonZeroOnDealloc:]:2951: failed assertion `The following Metal object is being destroyed while still required to be alive by the command buffer 0x7f8cd811c600 (label: <no label set>):
<MTLToolsObject: 0x7f8b0f9e3d60> -> <MTLIGAccelTexture: 0x7f8cd8566a00>
label = CAMetalLayer Drawable
textureType = MTLTextureType2D
pixelFormat = MTLPixelFormatBGRA8Unorm_sRGB
width = 772
height = 1372
depth = 1
arrayLength = 1
mipmapLevelCount = 1
sampleCount = 1
cpuCacheMode = MTLCPUCacheModeDefaultCache
storageMode = MTLStorageModeManaged
hazardTrackingMode = MTLHazardTrackingModeTracked
resourceOptions = MTLResourceCPUCacheModeDefaultCache MTLResourceStorageModeManaged MTLResourceHazardTrackingModeTracked
usage = MTLTextureUsageShaderRead MTLTextureUsageShaderWrite MTLTextureUsageRenderTarget MTLTextureUsagePixelFormatView
shareable = 0
framebufferOnly = 0
purgeableState = MTLPurgeableStateNonVolatile
swizzle = [MTLTextureSwizzleRed, MTLTextureSwizzleGreen, MTLTextureSwizzleBlue, MTLTextureSwizzleAlpha]
isCompressed = 0
parentTexture = <null>
parentRelativeLevel = 0
parentRelativeSlice = 0
buffer = <null>
bufferOffset = 0
bufferBytesPerRow = 0
iosurface = 0x600002533060
iosurfacePlane = 0
allowGPUOptimizedContents = YES'
I'm running on a Intel Mac mini with 32Gb memory. It often crashes often when showing a MapView on screen. But also in some other cases.
Edit: Could be related to programatically zooming in animated in a MapView on MacCatalyst. A workaround is for now to disable the animation. Will research more.
I try to add a language menu with typoscript, but the files I want to add as images ar not working.
my typoscript looks like this:
## Localization menu:
temp.langMenu = HMENU
temp.langMenu.special = language
temp.langMenu.special.value = 0,2
temp.langMenu.1 = GMENU
temp.langMenu.1.NO {
XY = [5.w]+4, [5.h]+4
backColor = white
5 = IMAGE
5.file = fileadmin/bilder/DE-flag-32.png || fileadmin/bilder/US-flag-32.png
5.offset = 2,2
}
temp.langMenu.1.ACT < lib.langMenu.1.NO
temp.langMenu.1.ACT = 1
temp.langMenu.1.ACT.backColor = black
temp.langMenu.1.USERDEF1 < lib.langMenu.1.NO
temp.langMenu.1.USERDEF1 = 1
temp.langMenu.1.USERDEF1.5.file = fileadmin/bilder/DE-flag-32.png || fileadmin/bilder/US-flag-32.png
temp.langMenu.1.USERDEF1.noLink = 1
Cache is clean ...
result is this:
links are working but no image. in Site-source code the image got this path:
<img src="/typo3temp/menu/4baf3d2e70.gif" width="36" height="36" alt="Home">
Whats my Mistake in this case
I usually have a similar approach:
temp.language = HMENU
temp.language {
special = language
// 0 = Deutsch, 1 = Englisch
special.value = 0,1
wrap = <ul class="langmenu">|</ul>
1 = GMENU
1 {
NO = 1
NO {
format = png
// size of flag grafics
XY = 38,17
transparentColor = #00FFFF
backColor = #00FFFF
10 = IMAGE
10.file = fileadmin/flags/de.png || fileadmin/flags/uk.png
10.offset = 10,0
10.file.width = 28
10.file.height = 17
wrap = <li>|</li>
}
ACT < .NO
ACT {
20 = IMAGE
20.file = fileadmin/flags/arrow.gif
20.format = png
20.offset = 0,3
noLink = 1
wrap = <li class="act">|</li>
}
// if translation is not available:
USERDEF1 < .NO
USERDEF1 {
// the grayscale effectdoes not work with some IM versions
30 = EFFECT
30.value = gray | gray=1 | grey | grey=1
// the same flags like above, bleached
40 = EFFECT
40.value = gamma=5
// naturally this should not be linked either
noLink = 1
}
}
}
differences which might be important:
I use constant values for the generated images and no blank after the comma
I give explicit sizes for the used images
I use color values instead of color names
I use transparent color
Image generation on the server (the install tool checks) is working in general? Pay special attention to the GDlib tests
install of imagemagick does the job
I have created a crontab with this command in my Ubuntu Server and Plesk 12.5 :
MAILTO=""
SHELL="/bin/bash"
*/1 * * * * php -c -f /var/www/vhosts/system/domainname.com/etc/php.ini /var/www/vhosts/domainname.com/httpdocs/store/bin/magento cron:run > /var/www/vhosts/domainname.com/httpdocs/store/var/log/magento.cron.log&
MAILTO=""
SHELL="/bin/bash"
*/1 * * * * php -c -f /var/www/vhosts/system/domainname.com/etc/php.ini /var/www/vhosts/domainname.com/httpdocs/store/update/cron.php > /var/www/vhosts/domainname.com/httpdocs/store/var/log/update.cron.log&
MAILTO=""
SHELL="/bin/bash"
*/1 * * * * php -c -f /var/www/vhosts/system/domainname.com/etc/php.ini /var/www/vhosts/domainname.com/httpdocs/store/bin/magento setup:cron:run > /var/www/vhosts/domainname.com/httpdocs/store/var/log/setup.cron.log&
When run it creates three files (magento.cron.log; update.cron.log; setup.cron.log). And three files cotains the same text:
; ATTENTION! ; ; DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED
AUTOMATICALLY, ; SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE
FILE IS GENERATED.
[PHP] soap.wsdl_cache_limit = 5 cli_server.color = On
mysql.allow_persistent = On mysqli.max_persistent = -1
mysql.connect_timeout = 60 session.use_only_cookies = 1
register_argc_argv = Off mssql.min_error_severity = 10 open_basedir =
"/var/www/vhosts/mydomainname.com/:/tmp/" session.name = PHPSESSID
mysqlnd.collect_statistics = On session.hash_function = 0
session.gc_probability = 0 log_errors_max_len = 1024
mssql.secure_connection = Off pgsql.max_links = -1 variables_order =
"GPCS" ldap.max_links = -1 sybct.allow_persistent = On max_input_time
= 60 odbc.max_links = -1 session.save_handler = files session.save_path = "/var/lib/php5" mysqli.cache_size = 2000
pgsql.auto_reset_persistent = Off error_reporting = E_ALL &
~E_DEPRECATED & ~E_STRICT auto_prepend_file =
sybct.min_client_severity = 10 pgsql.max_persistent = -1
auto_globals_jit = On soap.wsdl_cache_ttl = 86400 allow_url_fopen = On
zend.enable_gc = On mysqli.allow_persistent = On tidy.clean_output =
Off display_startup_errors = Off user_dir = session.cookie_lifetime =
0 mysqli.max_links = -1 default_socket_timeout = 60
session.serialize_handler = php session.hash_bits_per_character = 5
unserialize_callback_func = pdo_mysql.cache_size = 2000
default_mimetype = "text/html" session.cache_expire = 180
max_execution_time = 30 mail.add_x_header = On upload_max_filesize =
2M ibase.max_links = -1 zlib.output_compression = Off
ignore_repeated_errors = Off odbc.max_persistent = -1 file_uploads =
On ibase.max_persistent = -1 mysqli.reconnect = Off
mssql.allow_persistent = On mysql.max_persistent = -1 mssql.max_links
= -1 session.use_trans_sid = 0 mysql.default_socket = always_populate_raw_post_data = -1 mysql.max_links = -1
odbc.defaultbinmode = 1 sybct.max_persistent = -1 output_buffering =
4096 ibase.timeformat = "%H:%M:%S" doc_root = log_errors = On
mysql.default_host = default_charset = "UTF-8" request_order = "GP"
display_errors = Off mysqli.default_socket = mysqli.default_pw =
html_errors = On mssql.compatibility_mode = Off ibase.allow_persistent
= 1 sybct.min_server_severity = 10 mysql.allow_local_infile = On post_max_size = 8M asp_tags = Off memory_limit = 512M short_open_tag =
Off SMTP = localhost precision = 14 session.use_strict_mode = 0
session.gc_maxlifetime = 1440 allow_url_include = Off
mysqli.default_host = mysqli.default_user = session.referer_check =
pgsql.log_notice = 0 mysql.default_port = pgsql.ignore_notice = 0
mysql.trace_mode = Off ibase.timestampformat = "%Y-%m-%d %H:%M:%S"
engine = On odbc.allow_persistent = On ibase.dateformat = "%Y-%m-%d"
track_errors = Off max_file_uploads = 20 pgsql.allow_persistent = On
session.auto_start = 0 auto_append_file = disable_classes =
pdo_mysql.default_socket = mysql.default_password =
url_rewriter.tags =
"a=href,area=href,frame=src,input=src,form=fakeentry" smtp_port = 25
sql.safe_mode = Off session.cookie_path = / expose_php = On
report_memleaks = On session.gc_divisor = 1000 mssql.max_persistent =
-1 serialize_precision = 17 odbc.check_persistent = On sybct.max_links = -1 mysqlnd.collect_memory_statistics = Off session.cookie_domain = session.cookie_httponly = session.cache_limiter = nocache enable_dl =
Off mysqli.default_port = 3306 disable_functions = odbc.defaultlrl =
4096 soap.wsdl_cache_enabled = 1 soap.wsdl_cache_dir = "/tmp"
mssql.min_message_severity = 10 session.use_cookies = 1
mysql.default_user = mysql.cache_size = 2000 implicit_flush = Off
ignore_repeated_source = Off bcmath.scale = 0
But when I enter magenta manager keeps giving the message "One or more indexers are invalid. Make sure your Magento cron job is running."
I do not understand. What Is It that is not working?
Thanks
You have gotten the flags for php wrong. It should be
*/1 * * * * php -c /var/www/vhosts/system/domainname.com/etc/php.ini -f /var/www/vhosts/domainname.com/httpdocs/store/bin/magento cron:run > /var/www/vhosts/domainname.com/httpdocs/store/var/log/magento.cron.log&
Also provide full path to php, which can be figured out with which php command.
Here is my circus.ini
[circus]
check_delay = 5
endpoint = tcp://127.0.0.1:5555
pubsub_endpoint = tcp://127.0.0.1:5556
stats_endpoint = tcp://127.0.0.1:5557
httpd = False
debug = False
[watcher:sample1]
cmd = /worker/sample1.php
warmup_delay = 0
numprocesses = 10
[watcher:sample2]
cmd = /worker/sample2.php
warmup_delay = 0
numprocesses = 10
[plugin:flapping]
use = circus.plugins.flapping.Flapping
retry_in = 3
max_retry = 2
I am trying to increase the number of processes by 2(nbprocess) for sample1. I tried
circusctl incr sample1 2
But circus always increases it by 1, not by 2(nbprocess). Any ideas?
Fixed by the author. Here is the reported bug.
I have an array that I want to show on a mapvew, the forloop iterates fine but the index of thew array is always 0.
self.clientTable = [ClientDatabase database].clientTable;
ClientTable *info = nil;
[_nameLabel setText:info.name];
[_stateLabel setText:info.state];
int countArray = [self.clientTable count];
for (int i=0;i<countArray;i++) {
info.uniqueId=i;
NSLog(#" i = %d ; id = %d",i, info.uniqueId);
}
however the results are always
24
i = 0 ; id = 0
i = 1 ; id = 0
i = 2 ; id = 0
i = 3 ; id = 0
i = 4 ; id = 0
i = 5 ; id = 0
I know the array has data as it displays in the tableview fine.
Any ideas?
The reason for the above is displaying each item in a mapview.
Thankyou!
Before this line
info.uniqueId=i;
are you missing something like
info = [self.clientTable objectAtIndex:i]
?? In the code you've provided you set info to nil, but never to anything else.
Because you set info to nil, right up there.