w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Restore document with embedded documents on ODM
How I ended up solving the issue of lazy-loading: // parent jsonSerialize method public function jsonSerialize(){ $o = new StdClass(); $o->property = $this->some_property; $a = []; foreach($this->attributes as $attr){ $a[] = $attr; } $o->attributes = $a; return $o; } This forces the PersistentCollection object to spit our one by one the proper instances, and then the jsonSerializable methods respond well cascaded through. Ugly IMO, but solves the issue. Sadly, you have to apply this on every Embedded Object dependency you have. Hole it helps!

Categories : PHP

Sorry, we are unable to generate a view of the document at this time showing by google document viewer
It is getting downloaded. use this link https://docs.google.com/viewer and add the full address of the file. Then add the iframe link into your webpage. I too had the same problem but it is working fine for me now. See mine: http://microlabz.in/MyResume.php

Categories : PHP

spacing and margin settings in word document using Apache POI docx
Got the answer.. documentTitle.setAlignment(ParagraphAlignment.CENTER); // This does the trick documentTitle.setSpacingBefore(100); It lefe me 100pt space between each line of the text If you want to add custom margins to your document. use this code. CTSectPr sectPr = document.getDocument().getBody().addNewSectPr(); CTPageMar pageMar = sectPr.addNewPgMar(); pageMar.setLeft(BigInteger.valueOf(720L)); pageMar.setTop(BigInteger.valueOf(1440L)); pageMar.setRight(BigInteger.valueOf(720L)); pageMar.setBottom(BigInteger.valueOf(1440L));

Categories : Java

ImportError: Could not import settings 'company.foo.settings' (Is it on sys.path?): No module named foo.settings
Have you tried setting the DJANGO_SETTINGS_MODULE environment variable to "company.foo.settings"? From the Djanjo Documentation; https://docs.djangoproject.com/en/dev/topics/settings/#designating-the-settings When you use Django, you have to tell it which settings you’re using. Do this by using an environment variable, DJANGO_SETTINGS_MODULE. The value of DJANGO_SETTINGS_MODULE should be in Python path syntax, e.g. mysite.settings. Note that the settings module should be on the Python import search path. EDIT: Can you also add the following to the top of your manage.py file? import sys sys.path.append('/path/to/folder/containing/company') EDIT2: In response to your clarification, you can try relative imports: http://www.python.org/dev/peps/pep-0328/#guido-s-decision

Categories : Python

Debugging JSF java.lang.ClassCastException in Restore View Phase
I've been able to resolve this problem as there was another link (call it CmdLinkA2) on Page A (in a different tab) which when followed: A, CmdLinkA2 => B, CmdLink => C doesn't cause the above error message, and Page C is displayed correctly. Comparing the different backing bean action methods used for the problematic <h:commmandLink> and the working one (CmdLinkA2) on Page A, the String returned to the problematic CmdLink was missing ?faces-redirect=true on the end, i.e. equivalent to: 1) <h:commandLink value="Next page" action="nextpage.xhtml" /> instead of: 2) <h:commandLink value="Next page" action=nextpage.xhtml?faces-redirect=true" /> where (1) leads to the error message occurring instead of Page C. However, since Page A does not have any form data to submi

Categories : Java

jsf Life Cycle:storing component tree and form value in Restore View
How can I see what is saving in ui component tree in restore view phase? This question is ultimately confusing. There's nothing being saved during restore. Instead, the state is being restored. The save of the state happens during render response phase. You can see it happen in the saveView() method of the JSF-implementation specific implementation of StateManager. In case of Mojarra, it's StateManagerImpl#saveView(). Where does form values(like form input field value) are saved in restore view phase? The view state does not contain any form values. The submitted values are just obtained as HTTP request parameters the usual way during apply request values phase. If you're familiar with basic Servlet API, you surely understand how that works. And how ui component tree ext

Categories : JSF

Switching from View 1 to Bluetooth settings..can't possible?
Apps cannot open the settings application to a specific screen. The reason that apps like MapMyFitness open preferences is because they ask for permission to use Bluetooth Low Energy. Asking for permission is managed by CBCentralManager on first usage. These popups are shown automatically by the system framework. The message can be customized using the purpose property for location services, that is not possible in case of Bluetooth. No private API was used for this, so there's no reason for the app to be rejected. Credit goes to this bellow SO question how some apps can open setting app programmatically within their app que 2. At previous we are opening Setting Page from app Using Bellow line of Code:- [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs://

Categories : Iphone

Set or View "Advanced Wi-fi" Settings programatically
There are two more settings that might work for you: From the API documentation: Settings.ACTION_WIRELESS_SETTINGS startActivity(new Intent(android.provider.Settings.ACTION_WIRELESS_SETTINGS)); Settings.ACTION_WIFI_IP_SETTINGS startActivity(new Intent(android.provider.Settings.ACTION_WIFI_IP_SETTINGS)); Try those two and see if they open what you're after.

Categories : Android

Reopening closed file: Lua
So, now the problem is that the "LoadScript" function isn't doing what you expect: Because I'm psychic, i have divined that you're writing a Crysis plugin, and are attempting to use it's LoadScript API call. (Please don't assume everyone here would guess this, or be bothered to look for it. It's vital information that must form part of your questions) The script you're writing attempts to set Backup - but your script, as written - does not separate lines with newline characters. As the first line is a comment, the entire script will be ignored. Basicallty the script you've written looks like this, which is all treated as a comment. --[[ comment ]]--Backup="Hello!" You need to write a " " after the comment (and, I'd recommend in other places too) to make it like this. In fact, you d

Categories : Windows

How to simulate a customer's IE compatibility view settings?
From this link : http://blogs.msdn.com/b/deviations/archive/2009/05/07/how-to-enable-ie-8-compatibility-view-for-your-whole-web-site-or-for-specific-web-site-directories.aspx The question many customers asked is ”How can I force the client browser to use the Compatibility View when they visit our site? So that the customer doesn’t have to activate it on the client side.” Web Developers and Site Administrators can configure IIS and their sites to tell Internet Explorer 8 to automatically Emulate Internet Explorer 7 when they visit their site or just specific WebPages. This is done by adding a custom HTTP Header to the IIS and the website web.config or to add a meta tag to specific pages. The HTTP Header is interpreted by the Internet Explorer 8 which will act

Categories : Javascript

Reflect Settings change in View on update
Not exactly sure what your question is but it seems to me that when your user changes a setting and then hits the back button to return to the fragment you are not seeing the changes? if this is the case it is because when the user goes back android reinstates the version of the fragment that was on the stack (the one before any changes were made). My suggestion would be to try moving the loading of the new shared prefs to the onResume method for the fragment. This way they should be loaded when the user goes back. Try this @Override public void onResume(){ super.onResume(); setContentView(R.layout.currentFrag); } this should reload the page with the correct changes.

Categories : Android

How to set settings.LOGIN_URL to a view function name in Django 1.5+
Django computes this url in django.contrib.auth.views:redirect_to_login function as: resolved_url = resolve_url(login_url or settings.LOGIN_URL) Therefore you should set it as string: LOGIN_URL = 'my_app.views.sign_in' Also in settings.py you can use reverse_lazy function: from django.core.urlresolvers import reverse_lazy LOGIN_URL = reverse_lazy('my_app.views.sign_in') https://docs.djangoproject.com/en/1.5/ref/urlresolvers/#reverse-lazy

Categories : Python

Best practices for designing table view for app settings?
Since you're using this for settings, have you considered InAppSettingsKit? In cases where that may be overkill, I have resorted to creating a static tableview in a storyboard where I can layout each distinct setting and have design-time control over its appearance.

Categories : IOS

Using the correct settings constant in Django view
Instead of from myproj import settings do from django.conf import settings That's why DEBUG works: https://docs.djangoproject.com/en/dev/topics/settings/#using-settings-in-python-code

Categories : Python

Table view, manual and settings in one screen: Best practice?
Apple recommends only one view controller per "screen," so that rules out option 1. I wouldn't want to even start to attempt to embed a viewcontroller in a table cell and that just smells very wrong in any case. You have three independent views that you want to scroll, and that clearly calls for a UIScrollView. As for the best way to organize this, I recommend creating modular UIView subclasses: one for the table, one for the instructions, one for the settings. See my answer on this question as to how you can package up views as reusable (not important in your case) and modular widgets: UIView and initWithFrame and a NIB file. How can i get the NIB file loaded?. Then you can create delegate interfaces for each one, and set your main view controller to implement them in order to com

Categories : IOS

Google AdMobs interstitial on reopening timed out
There are some issues with the loadAndDisplayRequest:usingWindow:initialImage: method. This blog post explains how you can achieve the same thing by using GADInterstitial's loadRequest: method. This implementation is better because you have more control over your view hierarchy.

Categories : IOS

TabHost disappears after locking the phone and reopening it:
When putting the phone to sleep onPause and onStop get called but onDestroy doesn't so that onCreate doesn't get called when turning the phone back on. onRestart, onStart and onResume do get called (checked on Nexus 7 by modifying the Activity Lifecycle training app to add Log messages in all lifecycle methods) so try to move as much code in initialiseTabHost as you can from onCreate to onStart, leaving only the minimum necessary in onCreate, or leave it there and add the relevant part of it to onRestart. Update (Emil Adz): As you suggested I added the onResume method and changed it as follows: @Override protected void onResume() { super.onResume(); if (mTabHost == null) { this.initialiseTabHost(null); } } From my check it looks as if it solved my problem, Tha

Categories : Android

app crashes when closing / reopening then pressing button
It appears that the onPause in your activity is being called, and you're releasing the Camera - this is good. However, you never re-initialize it. The Android developer guide has this exact example. Basically, you need to do something like this: @Override protected void onPause() { super.onPause(); if (camera != null) { camera.release(); camera = null; } } @Override protected void onResume() { super.onResume(); if (camera == null) { initializeCamera(); } } Then you move all the camera initialization code from your onCreate into a new initializeCamera method. Note you should not initialize the camera in onCreate, since it is being done in onResume (which is called even on first load).

Categories : Android

Blackberry simulator: can't lower graphics settings in view menu
You should be able to force the simulator not to use the graphics acceleration at all (which hopefully would work around your problem). See this BlackBerry forum thread here. Basically, just include this in your simulator config file: <?xml version="1.0" encoding="utf-8"?> <fledge-configuration> <BodyBuilder::opengl-acceleration>0</BodyBuilder::opengl-acceleration> The setting of 0 turns off graphics acceleration. You can either turn it off by default in your simulators, or just in one particular simulator, by using the fledge-saved.conf file, or 9900-saved.conf file (for example, to change the setting on the 9900 simulator). On a Windows system, these config files would be located somewhere like: C:Usersmyname et imfledge-2

Categories : Opengl

Java Comms PortInUseException when closing and reopening serial connection
To resolve conflicts over port ownership, you can register a PortOwnershipListener so that you will be told if another application wants to use the port. Then you can either close the port and the other application will get it, or ignore the request and the other program will get a PortInUseException.

Categories : Java

How can I modify my wxPython code live to avoid closing/reopening them?
You can use Python's reload() built-in functionality. Here's a fun little demo: import testApp import wx ######################################################################## class ReloaderPanel(wx.Panel): """""" #---------------------------------------------------------------------- def __init__(self, parent): """Constructor""" wx.Panel.__init__(self, parent) self.testFrame = None showAppBtn = wx.Button(self, label="Show App") showAppBtn.Bind(wx.EVT_BUTTON, self.onShowApp) reloadBtn = wx.Button(self, label="Reload") reloadBtn.Bind(wx.EVT_BUTTON, self.onReload) mainSizer = wx.BoxSizer(wx.VERTICAL) mainSizer.Add(showAppBtn, 0, wx.ALL|wx.CENTER, 5) mainSizer.Add(reloadBtn, 0, wx.ALL|wx.CENTER

Categories : Python

Primefaces Dialog not reopening when ajax close event listener included
I think updating the visible attribute is not a correct way to open/close a dialog. It should be something like this: RequestContext context = RequestContext.getCurrentInstance(); context.execute("dlg.show();"); // To open the dialog context.execute("dlg.hide();"); // To close the dialog

Categories : Java

Set PDF Document Properties Initial View
There do not appear to be pdfmarks definitions to cover what you want (or at least I can't find them in the current pdfmark specification. That being the case you cannot create a PDF with those properties via pdfmark. One of the features you want seems to be covered by the /DisplayDocTitle entry in a ViewerPreferences dictionary, but the rest I can't see anything obvious in the spec. I'm not convinced these are under control of the PDF but if they are, your best bet is to inspect one that does what you want.

Categories : Misc

MFC Document View Getting Tabbing to work
Use a CFormView as your base. You can add controls dynamically and the form will manage the tabbing for you. If you only have a small number of maximum edit controls you could also just create them on the form and then show/hide them as necessary.

Categories : Visual C++

How to return a local PDF document in a View in MVC
We put them in an iframe like this. <iframe id="external" src"yourSource" width="100%" style="background:#FFF; height:100%; margin:0; padding:0; overflow:scroll"></iframe> if that gives you a similar error probably permisions.

Categories : Asp Net Mvc

Is it possible to use 2 document.ready function in razor view
Yes, it is perfectly possible to use more than 1 document.ready calls within the same HTML document. jQuery will aggregate them into a single javascript code that will be invoked when the DOM is ready.

Categories : Javascript

How to view an XML document in the Visual Studio browser
With some more more Googling I was able to find what I was looking for. http://www.mztools.com/articles/2008/MZ2008012.aspx The code in the Initialize() method was what I wanted.

Categories : Xml

Backbone js view for entire html document
I think your approach is unnecessarily complex and using backbone isn't buying you anything useful. Why don't you just set the iframes src attribute with the model's content URL and be done with it? render: function() { this.$el.attr('src', this.model.url()); //Or whatever you need to get the right URL return this; }

Categories : Javascript

Populate combo box with Document/View separation (MFC)
Maybe the SendMessage could just pass a <type-of-list> to the View and the view could call a function in the document which returns the fields required by the view, like // define structure/class VIEWFIELDS which contain the items required by the View VIEWFIELDS ViewFields; nNextItem = 0; nNextItem = pDoc->GetNextItem(nListType, nNextItem, &ViewFields); until the function returns -1?

Categories : C++

ImproperlyConfigured: settings.DATABASES is improperly configured. Please supply the ENGINE value. Check settings documentation for more details
Did you try the stuff in the documentation at https://devcenter.heroku.com/articles/django#django-settings? import dj_database_url DATABASES['default'] = dj_database_url.config() It says Django settings Next, configure the application for the Heroku environment, including Heroku’s Postgres database. The dj-database-url module will parse the values of the DATABASE_URL environment variable and convert them to something Django can understand. Make sure ‘dj-database-url’ is in your requirements file, then add the following to the bottom of your settings.py file: settings.py # Parse database configuration from $DATABASE_URL import dj_database_url DATABASES['default'] = dj_database_url.config() # Honor the 'X-Forwarded-Proto' header for request.is_secure() SE

Categories : Django

Configure the settings page of the application in mobile device settings
How to do that? Download the Android source code. Modify the Settings app to contain this sort of feature. Compile the source code into a ROM mod, and install that ROM mod on your device. Otherwise, an SDK app cannot affect what appears on the app's page in Settings in the manner that you describe.

Categories : Android

How can I force IE10/9 into both Compatibility View and IE8 Document Mode?
I had a similar problem. I used <!DOCTYPE html> in the starting of the document and used <meta http-equiv="X-UA-Compatible" content="IE=8" > after the <head>. Then i cleared the cache of the browser, reopen the internet explorer and it is working fine.

Categories : Internet Explorer

MFC and threads. Skip Document/View and make my own solution?
Simple answer is yes, it's OK to do that. You can custom-write your own presentation completely, literally down to the pixel if you want. Doing lock->data access->unlock->paint seems wise; depending on access time, you might be able to paint inside the lock as well, or update a DIB in the lock for painting outside of your lock... you have lots of options...

Categories : C++

AngularJS document.ready doesn't work when using ng-view
You can listen in your controllers defined in routes i.e. SomeController and SomeRouteController for $viewContentLoaded event. $viewContentLoaded is emitted every time the ngView content is reloaded and should provide similar functionality as the document.ready when routing in angularjs: function SomeController($scope) { $scope.$on('$viewContentLoaded', function() {window.scrollTo(0,90);}); } The document.ready is also triggered only once when you load your index.html. It is not triggered when the partial templates defined in your route configuration are loaded.

Categories : Javascript

how to specify the view or controller for running javascript 'document.ready'
the $ -> .. on the first line, will be translated to $(function() { ... }); which is basically is a shorthand for JQuery's $(document).ready(function() { ... }); which means that the script inside of this function will only be executed once the DOM is ready. so You could save the javascript into separate file let say js/memos/index.js and within your view app/views/memo/index.html.erb' you would have the` and on the same file you can include the javascript with javascript include tag. The javascript will only be executed once DOM is ready, meaning at that point you will already have the div. More info on JQuery's ready http://api.jquery.com/ready/

Categories : Javascript

Put footer at bottom of either view or document, whichever is longer
It is a common CSS problem called "sticky footer" and also there are a lot of ways to solve it. With or without jQuery. You can google it and find which you'll like more. I'm using this simple method http://mystrd.at/modern-clean-css-sticky-footer/

Categories : Jquery

Encrypt segments of config file (Settings.settings)
You don't need to encrypt the section, only the value for the password. An example of how to encrypt/decrypt a password is shown here: http://www.codeproject.com/Questions/304187/how-to-create-password-encrypt-decrypt-in-csharp I hope this helps. Ed

Categories : C#

How to export/import settings and change advanced settings
Regarding question #2, jshint ignore list in web essentials is currently implemented (hardcoded) as a private static, see the source on GitHub (lines highlighted). Also, parsing .jshintignore files is not currently implemented.

Categories : Visual Studio

Possible to give view and download access to a document (.pdf) without revealing the full URL?
I would handle this by adding some sort of parameter to the url so that your new link would look something like www.mydomain.com/content/pdf/valuable_ebook.pdf?code=abc123 where abc123 is a new random value for each person you give the link out to. Obviously, make it much longer than 6 characters. You then store all of the codes in a database. From here you have a couple of options. You could only give them the option to download the PDF a specified number of times. When the code is used more times than that, perhaps they could contact you to download it more times, but you easily be able to stop anyone that shares the link a bunch of places.

Categories : Security

How do I override the document viewer icon to view in Full Screen in Plone?
You need to carefully blank the <div> section for 'View Document in Fullscreen' in this javascript: collective.documentviewer-2.2.1 py2.6.egg/collective/documentviewer/resources/assets/viewer.js

Categories : Python



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