w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
PyCharm Code Inspection doesn't include PEP 8
PEP8 inspections are not reported from Code | Inspect Code, there is a known issue about it, please vote. UPDATE: the issue was fixed, should be available starting from 3.0.2 release.

Categories : Python

How to get PyCharm to check PEP8 code style?
For me I found that the best way for me was to include pep8 checking as an external script, something along the lines of this: http://blog.saturnlaboratories.co.za/archive/2012/09/10/running-pylint-pycharm The advantage of doing this is that the errors appear as sort of a todo list the bottom of the frame. This way I don't have to look around the code for errors.

Categories : Python

gcc for ARM - move code and stack
vectors.s .cpu cortex-m3 .thumb .word 0x20008000 /* stack top address */ .word _start /* Reset */ .word hang .word hang /* ... */ .thumb_func hang: b . .thumb_func .globl _start _start: bl notmain b hang notmain.c extern void fun ( unsigned int ); void notmain ( void ) { fun(7); } fun.c void fun ( unsigned int x ) { } Makefile hello.elf : vectors.s fun.c notmain.c memmap arm-none-eabi-as vectors.s -o vectors.o arm-none-eabi-gcc -Wall -O2 -nostdlib -nostartfiles -ffreestanding -mthumb -mcpu=cortex-m3 -march=armv7-m -c notmain.c -o notmain.o arm-none-eabi-gcc -Wall -O2 -nostdlib -nostartfiles -ffreestanding -mthumb -mcpu=cortex-m3 -march=armv7-m -c fun.c -o fun.o arm-none-eabi-ld -o hello.elf -T memmap vectors.o notmain.o fun.o a

Categories : Gcc

Move to previous given line in code
Try this: top: try { //Code } catch (Exception ex) { if (ex.Message.Substring(1, 5) == "error") { goto top: //Error - Can not resolve symbol `top` goto bottom: //OK } } bottom: //Code }

Categories : C#

Why won't this code move from my main activity to the next?
You didn't put any extras into Your intent. Bundle gotFeeling = getIntent().getExtras(); gotTheFeeling = gotFeeling.getString("aFeeling"); but You try to get one. String feeling = feelingsList.get(arg2).toString(); Bundle basket = new Bundle(); basket.putString("aFeeling", feeling); Intent gotoNeeds= new Intent(FeelingsMain.this, Needs.class); startActivity(gotoNeeds); I believe You have confused Your basket Bundle with extras You try to send. try this instead. String feeling = feelingsList.get(arg2).toString(); Intent gotoNeeds= new Intent(FeelingsMain.this, Needs.class); gotoNeeds.putExtra("aFeeling", feeling); startActivity(gotoNeeds);

Categories : Android

Move SWF shape points with as3 code
Employ readGraphicsdata() to read the GraphicsPath of your shape, it contains commands and control/anchor points. You can then parse that vector to find out the point you want to alter, then you change it, then you feed the path back into your shape via graphics.clear(); graphics.drawPath(path);, or use drawGraphicsData() instead to draw the complete set of graphics shape. The manual on readGraphicsData() The manual on GraphicsPath class format

Categories : Actionscript

How do I move my Knockout code out of my View and still be able to map the ViewModels?
In your first samaple: var model = @Html.Raw(Json.Encode(Model)) indexViewModel.serverViewModel = ko.mapping.fromJS(model); the model variable holds a JS object which can be mapped with ko.mapping.fromJS(model). However in your second example: var model = $('#Model').val(); the model now contains a JSON string which need to mapped differenlty with ko.mapping.fromJSON method: So the following should work: var model = $('#Model').val(); indexViewModel.serverViewModel = ko.mapping.fromJSON(model); See also the documentation, Working with JSON strings section.

Categories : C#

If I move a WinForms form using VB.NET code... its height also changes. But why oh why?
I was able to replicate similar behavior by setting AutoSize to True and AutoSizeMode to GrowAndShrink. Check if these settings were turned on inadvertently.

Categories : Vb.Net

Why this two code snippet for using Move semantic but the next doesn't?
You got all your reasons wrong. There's nothing about "saving addresses". (Anyone can write any manner of horribly broken code by randomly storing addresses. That's not an argument.) The simple reason is that in the first snippet, t continues living and can be used, so you can't move from it: Thing t; work_on(t); t.x = 12; foo(t); In the second snippet, though, the temporary value Thing() only lives on that one line, till the end of the full-expression, so nobody can possibly refer to that value after the end of the statement. Thus it's perfectly safe to move from (i.e. mutate) the object.

Categories : C++

Episerver 7 upgraded from 6, move page types to code
Take a look at Alf's re-work of Erik's tool here: http://talk.alfnilsson.se/2013/03/08/creating-page-type-classes-from-page-types-in-episerver-cms-7/ Download here: https://github.com/alfnilsson/pagetypeclasses

Categories : C#

Move JS code from HTML to source in HEAD section
You need to wrap this in $(document).ready(...) Also, it has unusual indentation. It would probably be better to format it like this: $(document).ready(function() { $("[data-slider]").each(function () { var input = $(this); $("<span>").addClass("output").insertAfter($(this)); }).bind("slider:ready slider:changed", function (event, data) { $(this).nextAll(".output:first").html(data.value); }); }); I personally don't like chaining so many commands like this in a row. It might be SLIGHTLY more efficient, but it makes it much more difficult to debug and fix problems. I personally would break the .each() and the .bind() into separate statements. But I suppose it's a matter of preference.

Categories : PHP

I want to move GRect. I used mouseMotionListener, but it doesn't work. Check the code, and try to help. Thanks
Use addMouseMotionListeners rather than addMouseMotionListener to register implemented MouseListeners for GraphicsProgram addMouseMotionListeners();

Categories : Java

Move source code from existing repo to new with keeping history
Create a repo on Github, then using the command line cd /path/to/your/repo git remote set-url origin <github URL> git pull origin master git push -u origin master Basically you're changing the default origin remote URL to point to the Github one.

Categories : GIT

upload file move out of public_html folder in code igniter
use this controller function target your form here function do_upload() { //set your configuration here //upload path which it contains write permission $config['upload_path'] = '/var/www/uploads/'; $config['allowed_types'] = 'gif|jpg|png'; $this->load->library('upload', $config); if ( ! $this->upload->do_upload('form_field_name')) { $error = array('error' => $this->upload->display_errors()); $this->load->view('upload_form', $error); } else { $data = array('upload_data' => $this->upload->data()); $this->load->view('upload_success', $data); } }

Categories : PHP

What's the keyboard shortcut to move between source code and debugger in RubyMine?
By default, the debug tool window is mapped to Alt+5 (⌘5). So typing that will give the debug too window focus. To return to the editor from any tool window, type Esc. You can also type Alt+5 a second time, but that will close the debug tool window and take you to the editor. You can modify the key map for a tool window in File > Settings > [IDE Settings> Keymap > Main Menu > View > Tool Windows

Categories : Intellij Idea

scanned files on array, would like to move them all into a folder with one code block
You can use the following code for copy all your files: require 'fileutils' FileUtils.mv Dir['/Users/jorgeolivero/desktop/*'], 'dest folder' You don't need to create a class for it. You can run this code on irb or put in a single file. PS: Ruby doesn't accept multiple initializers for a class.

Categories : Ruby

How to localize places for introducing move semantics in a legacy code base?
Since the standard containers have been updated to move elements whenever possible, a good place to start would be types that are stored (by value) in standard containers. If you make them MoveConstructible and MoveAssignable (and be sure to make the move operations noexcept where possible so e.g. std::vector will actually move not copy) then all code using containers of those elements can potentially benefit. Other candidates are any non-trivial types that are passed to functions or returned from functions by value. Of course another approach is the usual one for any performance issues: profile the code and find out what's slow. If it's due to lots of copying then consider if the copies can be avoided, and if not whether implementing move semantics might help. If the slowness isn't d

Categories : C++

AS3 Touch Event to make Object/Character move upwards, having difficulty with code
You have try to use TouchEvent.BEGIN and TouchEvent.END instead TouchEvent.TOUCH ? http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/TouchEvent.html#includeExamplesSummary ...maybe like the "TouchEventExample.as" Also, using constants for the amount of you movement will make future amount change easier.

Categories : Android

Access query or VBA code to move data from one table to another depending on first row unique identifier
You will need something that would link your records together. What happens if the data gets re-sorted? How would you know that all the info in your example should be in the same record? I believe the only way to do something like this would be to create a 3rd field in your first table that determines which data belongs with which, something like a UserID. Then the table would look like this: tblSurveyData FirstColumn Second Column UserID A0 John XX001 A2 Smith XX001 A3 05-01-1973 XX001 Then you could create a preliminary query like: Select DISTINCT UserID from tblSurveyData Use that as your "pointer" query and loop through the results, and then you can pull all the records with each UserID out an

Categories : SQL

Using CSS3 hover effect, how can I move the text left 5 pixels and move it back?
With just a little javascript, everything is smooth (the css below is the bare necessities): a { display: inline-block; /* this just has to be block-level */ -webkit-animation: moveAndBack 1s ease-in-out; } a.not-ready { -webkit-animation-duration: 0; } a:hover { -webkit-animation-direction: alternate; -webkit-animation-iteration-count: 2; -webkit-animation-fill-mode: forwards; } @-webkit-keyframes moveAndBack { 0% { -webkit-transform: translate(0); } 25% { -webkit-transform: translateX(5px); } 100% { -webkit-transform: translateX(5px); } } See it here And the only thing the javascript is doing is stopping the animation from running on load. Latest edit and update to fiddle takes care of an issue that would only happen if you hovered on the link lo

Categories : CSS

Why does the UIButton move the title label all the way to the right when I set content insets to move it to the bottom?
You just wrongly calculated edgeInSets.They are not there the way you think they are. Here's my test code.It did cost me a while to put image and title in the right place. UIButton *tmp_testBtn = [[UIButton alloc] initWithFrame:CGRectMake(50, 200, 60, 40)]; tmp_testBtn.backgroundColor = [UIColor grayColor]; [tmp_testBtn setImageEdgeInsets:UIEdgeInsetsMake(0, 0, 20, 0)]; [tmp_testBtn setImage:[UIImage imageNamed:@"France"] forState:UIControlStateNormal]; [tmp_testBtn setTitleEdgeInsets:UIEdgeInsetsMake(20, -258, 0, 0)]; [tmp_testBtn setTitle:@"testbutton" forState:UIControlStateNormal]; CGRect contentRect = [tmp_testBtn contentRectForBounds:tmp_testBtn.bounds]; NSLog(@"contenRect:%f,%f,%f,%f",contentRect.origin.x,contentRect.origin.y,contentRect.size.width,contentRect.size.height); CGRect

Categories : IOS

How to get event touch move of UIView when move finger from outside view
Best approach is create a uiview with necessary size(which is larger than uiimageview). Place the uiimageview inside it. Add gesture recognizer to uiview instead of uiimageview. In the delegate method of geature, move the image view.

Categories : IOS

Can the PowerShell commandlet move-item move a currently open file?
This is the classic producer-consumer problem, which is a well researched topic. Some solutions you might try are checking the file's last write time. If it is well enough in the past, it can be moved without issues. Another one would be trying to open the file with exclusive access. If it fails, the file is still being used by the producer process. Othervise, close the file and move it. Some examples are like so, # List files that were modified at least five minutes ago gci | ? { $_.lastwritetime -le (get-date).addminutes(-5) } # Try to open a file with exclusive mode try { $f1 = [IO.File]::Open("c: empfoo.txt", [IO.Filemode]::Open, [IO.FileAccess]::Read, [IO.FileShare]::None) # If that didn't fail, close and move the file to new location $f1.Close() $f1.Dispose()

Categories : Powershell

Implementing Move Constructor by Calling Move Assignment Operator
I don't think you're going to notice significant performance difference. I consider it good practice to use the move assignment operator from the move constructor. However I would rather use std::forward instead of std::move because it's more logical: *this = std::forward<MemoryBlock>(other);

Categories : C++

I'm building a car game I want to move a car through the keyevent , the algorithm is okay, but the car doesn't move
use this: @Override public boolean onKeyDown(View view, Editable arg1, int keyCode, KeyEvent event) { instead of this: public boolean onKey(View view, int keyCode, KeyEvent event) {

Categories : Java

PyCharm debug jump to
Open Run | View Breakpoints and disable the Python Exception Breakpoints: You also need to ensure that your script has no syntax errors, otherwise it will fail to load and you will step into pydevd.py instead.

Categories : Python

Import directory into pycharm
First thing to make sure is to do what Games said, you need to make sure each folder that is representing a package is done by putting a __init__.py file which is a empty python file named exactly __init__.py that tells the interpreter that the folder is a python package. Second thing to look for is that pycharm likes to complain about imported code if PyCharm does not know about that directory. Go into the Project Interpreter Configuration and go to Paths and add the path references that are not in the project or directly under the interpreter. One other thing to add, is to set the source root of your project code by right clicking the folder that represents your root and clicking the 'Mark Directory as...' > 'Source Root'.

Categories : Python

Pycharm and bitbucket plugin
I've faced the same problem, here is the solution: http://www.youtube.com/watch?v=klfLSRXUOzY The main problem here, is that no remote is added to the project by PyCharm / PHPStorm / IntelliJ. This means you have to manually add the remote via git add remote <your remote here>

Categories : GIT

Remote debugging on pycharm
For remote debug you need to copy the sources to your local machine, set up a project, configure deployment to the remote machine and add remote Python interpreter to run and debug on the remote system. It's not possible to work with the source files that are not on the machine where PyCharm is running. You can find details about deployment and remote interpreter configuration in PyCharm help.

Categories : Python

How to move a character over a display so that it appear to move with same velocity on all devices
You can get the width of the device and then just divide that by something (like divide by 10 for 10% or 100 for 100%) and then have movement happen in relation to size of the screen. The character will still move differently, but it won't be as different as a set amount. To get the width of the screen you can do this: Display display = getWindowManager().getDefaultDisplay(); Point size = new Point(); display.getSize(size); int width = size.x; int height = size.y; Then do something like: x=x+(width*.01); to add 1% of the screen

Categories : Android

Make background image move when you move the page
background-attachment? Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/CSS/background-attachment

Categories : HTML

How do I move a shared_ptr object between containers with move semantics?
You're not invoking the move constructor. Nothing about the emplace_back call makes it clear v1 is no longer needed. You probably need a std::move in there. You probably want: v2.emplace_back(std::move(v1.back())); v1.pop_back();

Categories : C++

Mongodb balancer move failed: chunk too big to move. But it's not
Looks like as known old bug https://jira.mongodb.org/browse/SERVER-9365 I have 30MB chunks about 280K docs. And mongo can not move it becouse it contain more then 250001 docs and fill error "chunk too big to move". We have situation that chuk not to big to split, and "not to small" to move. I reproduced that localy. I created collection of 1 chunk with 36b docs (8.58MiB per chunk). If docs is 250001 or less chunk moved manualy as expected. If docs 250002 or more I got a error "chunk too big to move". Chunk size in settings 64MB. Work arround: If you planed use collection with small docs - pre-split collection so that the documents were less then 250K.

Categories : Mongodb

Where to set maximum line length in pycharm
Here is screenshot of my Pycharm. Required settings is in following path: File -> Settings -> Editor -> Code Style -> General: Right margin (columns)

Categories : Python

How to configure custom PYTHONPATH with VM and PyCharm?
Well you can do this by going to the interpreter's dialogue box. Click on the interpreter that you are using, and underneath it, you should see two tabs, one called Packages, and the other called Path. Click on Path, and add your VM path to it.

Categories : Intellij Idea

Is always neccessary to rerun app on local in PyCharm?
It's not really about pycharm, it's about flask itself. Setting debug to True should do the trick: The debug flag. Set this to True to enable debugging of the application. In debug mode the debugger will kick in when an unhandled exception occurs and the integrated server will automatically reload the application if changes in the code are detected. app.run(debug=True)

Categories : Python

Execute fabric task from PyCharm
Add a "Python" run configuration with /path/to/your/env/bin/fab as the script and hello as the script parameters. Set the working directory to the directory with the fabfile. Example:

Categories : Python

Python can't find library but pycharm can
In order to use django.contrib.gis.geos you need first install GEOS library. Here are the instructions. If you'll still have problems, see Can’t find GEOS library django docs. Hope that helps.

Categories : Python

pycharm no module named redis
As per my understanding pycharm will say "No module named redis" if you haven't set up python interpreter in pycharm or in case there is no such module you are trying to use installed in the python interpreter you are currently using for pycharm. To add python interpreter to pycharm go to File -> Settings -> Python interpreter

Categories : Python

Navigate to a specific module in PyCharm
I feel your problem. All you have to do is Ctrl + CLICK on the definition. Please note, however that this does not provide the actual files. What I mean by this is that it does not re-direct you to the actual function, but rather a skeleton of the function. If you want to go to the actual function, you will need to go it it my clicking on external libraries on your sidebar and do a search. Hope this helps.

Categories : Python



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