w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Mysterious app crash after AppStore update
Our problem was connected with Core Data light migration - we were using the library called Magical Record for handling our Core Data fetches and updating it solver the problem. Also, this post was quite useful - http://pablin.org/2013/05/24/problems-with-core-data-migration-manager-and-journal-mode-wal

Categories : Iphone

Mysterious crash happening many times with strange stacktrace
It seems you have a memory and threading issue in your app. The app is trying to send a message (method) to an object that is already deallocated. Both stack traces hint at the usage of threads. It looks like you are doing some work in a background thread and then sending a message to an object (on the main thread?) which does not exist any more. So it might be helpful to check the stack traces of your background threads and see what they are doing.

Categories : IOS

How to remove mysterious whitespace from line breaks in Ruby on Rails?
I believe textarea is returning CR/LF for line separators and you're seeing one of these characters displayed between each line. See PHP displays characters when echoed in Textarea for some discussion of this. There are probably better questions out there as well.

Categories : Ruby On Rails

Crash Debugging Win32 Application
0:000> ?@esi+@edi Evaluate expression: 36278408 = 02299088 0:000> !address 02299088 ProcessParametrs 00311020 in range 00310000 00410000 Environment 02294848 in range 02290000 02390000 02290000 : 02290000 - 00100000 Type 00020000 MEM_PRIVATE Protect 00000004 PAGE_READWRITE State 00001000 MEM_COMMIT Usage RegionUsageHeap Handle 00310000

Categories : Debugging

Debugging low memory crash (threads related?)
I've finally found a solution. It was actually two separate problems. The first one was that my device (Huawei Y300) didn't log any stack trace that could be retrieved using logcat. This was likely resolved by a reboot that i did earlier today, or, less likely, by the fact that I tried to use logging via android.util.Log to log some debug info. The second one was the crash itself. After getting the stack trace from the crash, the problem was quite easy to fix. Even though the previous information I obtained using debugger pointed to some problem with threads, the real cause was the following exception: android.app.Fragment$InstantiationException: Unable to instantiate fragment cz.jirkovsky.lukas.chmupocasi.RetainFragment: make sure class name exists, is public, and has an empty construc

Categories : Android

When debugging JavaScript using the Chrome developer tools, what information can I use to diagnose a site crash?
The code you show is minified, that's why it's only one line and not readable nor directly debbugable. But you have a small button { } at the bottom left of the screen you show (the fifth from the left), it lets you beautify the code. Click on it. You can put breakpoints in this beautified code in a much precise way.

Categories : Javascript

Django Manual Debugging Process Flow
If that's really your view code, it's a simple indentation error. It should be: def user_profile(request): if request.method=='POST': form = UserProfileForm(request.POST, instance=request.user.profile) if form.is_valid(): form.save() return HttpResponseRedirect('/accounts/loggedin') else: user = request.user profile = user.profile form = UserProfileForm(instance=profile) args = {} args.update(csrf(request)) // security token args['form'] = form return render_to_response('profile.html', args) What's going on is that when request.METHOD is GET, there's no else clause on the initial if, so the view function ends without returning anything. Instead, you want to create the form, add it to the context,

Categories : Python

How to simulate process/daemon crash on OSX?
Unless you can find a legitimate bug and get it to crash that way, you can't externally crash a daemon in such a fashion that it will result in a diagnostic report. All of the quit-forcing functions are exempt from diagnostic reports as they are external issues.

Categories : Osx

The debugger cannot continue running the process. Unable to start debugging
XNA Solutions come with 2 projects, the Game project and the Content project. Make sure you have the Game Project set as the "start up project". To do this right-click the game project and click "Set as start-up project", it should now work fine.

Categories : C#

OpenCV crash on OS X when reading USB cam in separate process
Your problem stems from the way python spans its subprocess using os.fork. The OpenCV video backend on Mac uses QTKit which uses CoreFoundation these parts of MacOS are not save to run in a forked subprocess, sometimes they just complain, sometimes they crash. You need to create the subprocess without using os.fork. This can be achieved with python 2.7. You need to use billiard (https://github.com/celery/billiard/tree/master/billiard) It serves as a replacement for pythons multiprocessing and has some very useful improvements. from billiard import Process, forking_enable import cv2 #does matter where this happens when you don't use fork def cam(): vc = cv2.VideoCapture(0) #modify 0/1 to toggle between USB and internal camera while True: junk,image = vc.read() forking_e

Categories : Python

Crash when process pixel after crop an image
after a long time find solution for this crash. I got an experience: - When process bitmap on iOS: if we don't notice orientation of image, maybe we got some strange crash. With my crash above: I have fixed it very simple: change UIImage *result = [UIImage imageWithCGImage:imageRef]; by UIImage *result = [UIImage imageWithCGImage:imageRef scale:self.imageInput.scale orientation:self.imageInput.imageOrientation];

Categories : Iphone

Weird JVM crash on long running process - Possible JVM bug
Your application is receiving a signal as apparent from the stack trace: JVM_handle_bsd_signal I don't know which signal it is, but you could try to install signal handlers to find out: http://www.oracle.com/technetwork/java/javase/signals-139944.html#gbzbl Some common things that come to mind are: does the app set up some ulimits ? does anything else crash, suggesting hardware errors? have you tried using another jvm release - a patch or two away might be a different behavior

Categories : Java

rails4 debugging breakpoints with ruby 1.9.3?
Use debugger. In general, do this ruby-debug - for ruby 1.8 debugger - for ruby 1.9 byebug - for ruby 2.0 and things should be fine.

Categories : Ruby

Debugging cucumber in Ruby error
Have you updated rails or ruby lately? I do not remember which version update that causes problems but I think the error message looks like some I got after an update. After which the ruby-debug is no longer supported. After some digging I found the following gems as substitution: gem 'ruby-debug-base19x' gem 'ruby-debug19' These are however outdated, so maybe look into the debugger gem

Categories : Ruby

RubyMine fails at rails 4, ruby 2.0.0-p0 debugging
Debugger gem must not be used, it conflicts with ruby-debug-ide and breaks it. UPDATE: RubyMine 6+ supports debugger gem.

Categories : Ruby

Can malloc cause a crash when detouring a function in C++ to copy a data string from ExtTextOut in a target process?
Based on the comments here are a few things you could do to try to narrow this down: Replace malloc: Instead use buffer= (char *)GlobalAlloc(GPTR, n+1); and GlobalFree(buffer). This would make sure it's not a problem with having multiple c-runtime libraries. Alternately, to make sure there are no situations where you run over the bounds of the allocated buffers, try to malloc a lot more, e.g. buffer= malloc(n+1024); and see if that fixes the problem. If that does, you'll need to comb through your code if you go beyond the valid offsets in the buffers. A similar approach (for testing) would be to use stack versions of the buffer that are longer than the input you expect, e.g. char buffer[1024]; and use them like the malloc buffers (of course don't free them) and see what difference thi

Categories : C++

Ruby - Steps in a Gem build process
Definitely use bundler to create the gem. This will give you rake tasks to automate most of the process. Also, use a CI server like Travis to automate the testing process. You could also use Jenkins to get a whole host of tools like coverage metrics, etc. By using those tools, my gem release process is: rake release And it gets built and published to rubygems.org for public consumption.

Categories : Ruby

Ruby's best way to process thousand async requests?
With the large amount of parallel requests sometimes its recommended to use Fibers instead of Threads as they are faster to fire and lighter in memory usage. The most popular solution is EM-synchrony and you can use EM::Synchrony::Iterator for job scheduling and balancing. Be aware that you should use according EM-libraries like "em-synchrony/em-http" for compatibility with EM-synchrony. You can check this blogpost for more insights.

Categories : Ruby

Redmine - ruby process eating 100% memory
Maybe you can follow the tips in this article: http://blog.phusion.nl/2012/09/21/the-right-way-to-deal-with-frozen-processes-on-unix/

Categories : Ruby On Rails

Ruby Script to Process each line in an SQL file
You're calling each_line so you're only getting one line at a time. Given that, I trust it's clear why you're seeing the results you're seeing. Since there are only a 1000 sections like this, you can read in the entire file and do a global replace with capture groups to get the result you want. I couldn't get the regex to work on regexplanet, which supports replacement, but you can see the match groups working at http://rubular.com/r/ahSEerTEnW. After doing the match, you could construct the new replacement text using literals combined with the match group references (1, 2, 3, 4), as in: 1 <ul class="navlistjdxcms"> 2 <li>3</li> <li>4</li>

Categories : Mysql

Ruby MRI 1.8.7: Spawn process directly in code?
fork is the only way to do this. However, on Linux at least, and I think on OSX too, fork is implemented as copy on write, meaning that until an area of memory is written to in the child process, it points directly to the area of the old parent process. So, no problem. Edit: Nevermind. The above is wrong. Here's what I would do: code = "puts 'hi'" result = nil popen("ruby") do |pipe| pipe.puts code pipe.close_write result = pipe.read end

Categories : Ruby

Looking to integrate a non-Ruby server process into a Rails application
The simplest way is to use nginx's Reverse Proxy on a subdirectory. For example (based on this question): location /snap { rewrite /snap/(.*) /$1 break; proxy_pass http://localhost:8000; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } Change localhost:8000 to wherever the Snap application is running. You can also change the directory name from snap to anything you want. Just make sure you change it in both places where it appears, and that it doesn't conflict with any of the routes in your RoR application. However, if you want to use Authentication/Authorization via the Ruby application in order to access the Haskell application's data, you may find it easier to implement your first suggestion of m

Categories : Ruby On Rails

How to do inter-process locking with forked Ruby processes?
Forked processes inherit their parent's resources but the memory is a copy (or copy on write): the changes made in one process have no effect on the other ones. Similarly each process has its own copy of the mutex, so the calls to synchronise don't achieve anything. If you need to communicate with your child processes, one way is to use a pipe (see the docs for IO). Each process inherits a copy of the pipe and writes from one process show up in the other process. child_in, parent_out = IO.pipe parent_in, child_out = IO.pipe Process.fork do parent_out.close parent_in.close #data written to child_out appears on parent_in in the parent process #reading from child_in returns data the parent has written to parent_out end child_read.close child_write.close #write data to parent_ou

Categories : Ruby

Process return of select from database in erb view in ruby on rails
Please try this x=@amenities.size/2 <% @amenities.each_with_index do |amenity,i|%> <% if i <= x %> <p><input type="checkbox" class="listing-check"> <%= @amenities[i].name %></p> <% end %> <%end%>

Categories : Ruby On Rails

Sublime text: Process current buffer with Ruby script?
I would try to write a .sublime-build for your Markdown files. Something like { "cmd": ["/full/path/to/ruby/ /full/path/to/process_markdown.rb", "$file"], "file_regex": "^(...*?):([0-9]*):?([0-9]*)", "selector": "source.md" }

Categories : Ruby

How can I pause execution of a Ruby script and serialize the process to disk?
TL;DR You are solving the wrong problem. If your script takes too long to run, speed up your script rather than try to serialize an OS process. Alternative Approaches If you insist on being able to freeze processes and save state to disk, you may want to consider running your processes inside a virtual machine like VirtualBox or VMware. Both of these products support the ability to pause a virtual machine and save the VM's current state to disk. I'm unaware of any way to store running OS processes on disk other than inside some sort of virtualization layer. If you really need this functionality, that's the way I'd recommend. However, you'll probably get more bang for your buck by improving the efficiency of your code (profile or benchmark for bottlenecks), scaling up your system, or sc

Categories : Ruby

process html form submission with ruby to modify local file on server
You need some way to invoke the Ruby file as a result of the web request, and to pass in all form data to the script. It looks like you can do that with Apache by treating Ruby scripts as CGI. Quoting: DocumentRoot /home/ceriak/ruby <Directory /home/ceriak/ruby> Options +ExecCGI AddHandler cgi-script .rb </Directory> At this point you can use the CGI library that ships with Ruby to handle the parameters: #!/usr/bin/ruby -w # Get the form data require 'cgi' cgi = CGI.new form_text = cgi['text'] # Append to the file path = "/var/tmp/some.txt" File.open(path,"a"){ |file| file.puts(form_text) } # Send the HTML response puts cgi.header # content type 'text/h

Categories : HTML

Stop Debugging (Shift+F5) causing debugging to restart
I too have this happen to me sometimes, and I too have disabled StickyKeys. I even see this sometimes when I have locked my computer. When this happens and I try to type in my password, the computer acts like I am pressing down control. My only suggestion is to use the menus to stop Debugging, and then gently tap the Control key twice, and then try again. It always stops when I do this. In the back of my mind, I wonder if it is due to conflicts of third-party utilities that intercept key combos for their triggers. SnagIt, Freesnap, AutoHotKey are three that I use, but when the problem is so intermittent, you can't really disable them and say, "yup, my problem went away."

Categories : Visual Studio

How can I fix an app crash which is irreproducible? Crash report and console log attached
You error message said: [__NSArrayM objectAtIndex:]: index 0 beyond bounds . The reason probably is that using an NSMUtableArray (__NSArrayM) is not thread safe, see here. Without any code provided, I suggest that you read the Threading Programming Guide cited very carefully, and correct your code accordingly.

Categories : IOS

Mysterious FileNotFoundException
For me it turns out that the server was blocking whatever the default user agent is (maybe it was nothing) and was returning 403. And this throws the FileNotFoundException on my try. I then changed to an example json from another server: http://date.jsontest.com/ This will return a json that looks like this: { "time": "05:58:38 AM", "milliseconds_since_epoch": 1400047118645, "date": "05-14-2014" } By switching to another Server everything worked great - later I figured out that there is a problem with (as I said above) the user agent - set it to something like the Chrome user agent and it also should work normally. Hope it will help you.

Categories : Java

Css: Mysterious margin
it's on fg_membersite.css line 5 : body { background-color: rgb(230, 230, 230); width: 100%; height: 100%; } change to this : body { background-color: rgb(230, 230, 230); }

Categories : HTML

Mysterious MFSourceFilter
WMP uses Media Foundation, and if unlucky, detours via DirectShow. Here is a sample WMP playback for MPEG-2 file in Windows 7. Windows Media Player built a DirectShow graph internally and picked on of the available MPEG-2 decoders. This actual playback is backed by DirectShow entirely, the source on this playback is regular File Source (Async) Filter. WMP might be using the filter in question to obtain information (esp. media types) involved in playback or for other reasons specific to its internal implementation. Possibly even trying to substitute the source of the media to play, however what I see is that this filter is removed and regular DirectShow playback remains. The bottom line is that Media Foundation DirectShow Wrapper and Source Resolver exist, but they are not documented,

Categories : Windows

Ruby script that sets environment variable fails with Invalid argument - ruby_setenv (Errno::EINVAL) when started from a Java process on Windows
The problem was that when I started the Ruby script from Eclipse I had a different environment. Specifically, I had a CLASSPATH environment variable that looked really strange. I think the cause of this is the size of the CLASSPATH variable. It is really really long before being passed on to my sub process but within the sub process it is truncated and looks broken. I am suspecting I am running into problems with the max size of the Windows environment block (see details here: http://blogs.msdn.com/b/oldnewthing/archive/2010/02/03/9957320.aspx). I will not investigate this further but have fixed my code to remove the CLASSPATH variable before starting the process. Path path = FileSystems.getDefault().getPath("c:", "temp", "rb-test"); ProcessBuilder pb = new ProcessBuilder("ruby.exe","foo

Categories : Java

mysterious c++ segmentation fault
As you want to print the integer and the new line into the file, and not to "add" them, this line resultsfile << i + " "; should be resultsfile << i << " "; Next time, compile your program with -g option and run it inside gdb. After running the program, and receiving segfault, type backtrace, so you can see where your code broke. This way segmentation fault will not be so mysterious.

Categories : C++

Python mysterious error
Most likely, start+mid in words and mid+end in words returns False and so the function, instead of passing through the if-statement, returns None (because if a function does not return something, it defaults to None). Then you're trying to do something like: start,mid,end = None What python is trying to do is split up None in those three variables. It's like doing this: one, two, three = (1, 2, 3) But you can't, because None is not an iterable.

Categories : Python

Mysterious space after img tag before href
You have a few spaces before your first <a href> By removing the spaces the problem should be fixed. If the spaces are generated from a script to html then you need to check the differences of handling doc and docx links between a few statements in your script.

Categories : HTML

My Mysterious App_Data Directory
You're using SQL Express, which creates the data file for its database in App_Data. When Entity Framework tries to create your database on production, you get that error because the trust level doesn't allow it to store the data file where it's set to. Use a real SQL Server instance in production. That'll fix this error, but it's also just what you do. Don't use SQL Express for anything but development and testing.

Categories : Asp Net Mvc

Mysterious Seg Faults with Cudamalloc
This is likely due to stack corruption of some sort. Notes: The "good" lines allocate out of the system heap, the "bad" lines allocate stack storage. Normally the amount you can allocate from the stack is quite a bit smaller than what you can allocate from the heap. The "good" and "bad" declarations are not reserving the same amount of float storage. The "bad" are allocating 4x as much float storage. Finally, cudaMemset, just like memset, is setting bytes and expects a unsigned char quantity, not a float (0.0) quantity. Since the cudaMalloc line is the first one that actually "uses" (attempts to set) any of the allocated stack storage in the "bad" case, it is where the seg fault occurs. If you added an additional declaration like so: float *d_P; float myval; //add myva

Categories : C

Mysterious `1 in XAML Datatype
http://msdn.microsoft.com/en-us/library/system.codedom.codetypereference.basetype.aspx Generic types are formatted with the name of the type followed by a grave accent ("`") followed by a count of the generic type arguments. So by removing the `1 you're actually saying the type is TreeCategoryand not TreeCategory<T>

Categories : C#

Who changed my matrix? Mysterious bug
for (int i = 0; i <= a; ++i) { for (int j = 0; j <= b; ++j) { Here's your problem. You go out of bounds, resulting in... "something". Make it <a and <b, and you should be fine. Also you are accessing the matrix itself, didn't really read through what that does there. Have you done a check on what the result SHOULD be? printf("matrix at row 1 column 2: %i ", matrix[1][2]); printf("matrix at row 2 column 1: %i ", matrix[2][1]); It should be matrix[0][1] and matrix[1][0] Note: the expected result should be 0 and 0

Categories : C++



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.