How to split an xml file into parts [on hold]

Uncategorized
Question: I have a big xml file (Total size 21Gb). I need to split that file and store it into separate xml files. How can I do that functional on PHP? For what I need to split the file: the problem is that "CLI has topped working", when i try to save all the data into database. PHP becomes down work. Answer: You can only limit a amount of items (information) in the XML file, because a whole file is a single structured document (unit). In a standart way you cant simple split file into chunks, because the XML parser must read a whole file (unles you will use a custom made XML parser). Read more
Read More

JMeter GUI – Can’t drag and drop to last element in hierarchy

Uncategorized
Question: JMeter GUI (Swing) has drag and drop abilities, The problem is that sometimes I need to drag component to last of the hierarchy (e.g. last request in Thread Group) and the GUI seems to allow it but when releasing the mouse key nothing happens. For example below I can't drop Request 3 to its location as the last component, I must make 2 drag and drop requests: Request 1 and 2 to make the order 1,2,3. Is it a swing limitation or JMeter have a reason to disable it? Answer: Read more
Read More

how loss and metric are calculated in cntk

Uncategorized
Question: I am new to cntk and python. I have created a python program based on TrainResNet_CIFAR10.py to train 4736 of (64x64x3) images and test 2180 images with 4 classes. After train 160 epochs, I got loss = 0.663 and metric = 29.37%. Finished evaluation metric = 18.94%. When I evaluate the train model based on CNTKLibraryCSEvalExamples.cs to test 2180 images, almost all 2180 are classified as one class (second class). My questions are:I assume loss is calculated from cross_entropy_with_softmax(z, label_var) and metric is using classification_error(z, label_var). Am I correct and how are they actually determined? What does mean of metric = 29.37% and evaluation metric = 18.94%? Are they from train and test images, respectively? what could cause totally wrong evaluate results? Any help will be greatly appreciated. Answer:…
Read More

ReadDirectoryChangesW fails with error 995 if CancelIo was called before

winapi
Question: I'm puzzled with the strange behavior of ReadDirectoryChangesW failing with error 995. Scenario explained below. FileHandle was obtained using CreateFileW. FileHandle obtained in step1 was used in ReadDirectoryChangesW. It success and sends the request to server Poll for 10 seconds and if no change notify was generated by server, cancel the chnagenotify request using cancelIo. It sends cancel & server responds. Now again setting change notify with ReadDirectoryChangesW using the file handle obtained in step1, it fails with "995 - The I/O operation has been aborted because of either a thread exit or an application request." No actual request was sent to server by this step. Immediately again call ReadDirectoryChangesW using the file handle obtained in step1 & it succeeds and sends request to server. steps 3,4,5 are repeated…
Read More

IIS URL Rewrite module buffers Transfer-Encoding: chunked

Uncategorized
Question: I have a reverse proxy setup in IIS using the URL Rewrite module with inbound rules and I'm trying to get Transfer-Encoding: chunked to work. The site behind the reverse proxy works correctly with a chunked response. I've introduced a delay between chunks for testing and can see the first part of the response is received, then a delay, then the rest of the response. This shows in dev tools as a short wait then a long download period. Getting the same page through the reverse proxy results in a long wait and tiny download period, it seems to be getting all of the content before passing it on to the client. Is there any way I can change this behaviour so it streams the content to the client…
Read More

Azure functions are slow

Uncategorized
Question: I’m testing the CPU performance of functions, so I made a function that finds the prime numbers in a number. It is triggered by Azure Service Bus. On my local machine it runs in 350ms. The function, when running in a consumption plan, takes around 1000ms. When I batch send 100 messages to the function, it does scale up to around 16 instances, but the performance of each function decreases considerably to between 3000-7000ms. When trying a standard service plan with 4 cores, the performance is better, but not that much. It is still considerably slower than my laptop. This guy here has a similar issue. Is this the performance/scaling to be expected from functions? E.q. not a great fit for batch processing of CPU intensive methods? Would Azure…
Read More

why the wrapAll in infinite-scroll, have many divs?

Uncategorized
Question: The last question is here: Wrap some divs with Two different columns -115 -91 -99 -181 -19 -135 -85 -39 If scroll down three pages result: -91 -99 -19 -39 have too many left_columns and right_columns divs how to fix this? Answer: You should to check if the .right_columns or .left_columns exists or not:$('.wrapper').each(function() { var lpost = $(this).find(".lpost"), rpost = $(this).find(".rpost"), lcol = $(this).find('.left_columns'); if(lcol.length){ var rcol = $(this).find('.right_columns'); lpost.appendTo(lcol); rpost.appendTo(rcol); }else{ lpost.wrapAll(''); rpost.wrapAll(''); } }) Read more
Read More

How to format Elasticsearch highlight data that contains html?

c#
Question: I'm using Elasticsearch 1.7 highlighting on a c# webapp but the data that's being highlighted has html in it. Currently I am stripping out the html with this regex Regex.Replace(rawHighlight, "", string.Empty) The problem comes in when the highlight does not finish a complete html tag. For example, if my pre and post tags are @highlight-- and --highlight@ I might get back a result like this: This is an @highlight--example--highlight@
Read More

jQuery show hide div based on select value with loading-how to add loading element in this code

Uncategorized
Question: How to add loading function in this code? Anyone modify this please. $(function() { $('#colorselector').change(function() { $('.colors').hide(); $('#' + $(this).val()).show(); }); }); Red Yellow Blue Ok janu i love you yellow.. blue.. Answer: Just include jQuery: $(function() { $('#colorselector').change(function(){ $('#loading').show(); $('.colors').hide(); $('#loading').hide(); $('#' + $(this).val()).show(); }); }); Red Yellow Blue //OUTPUT Ok janu i love you yellow.. blue.. Loading... Read more
Read More