w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to access current Sitecore item in layout .aspx, while in preview pane in the Sitecore content editor?
Sitecore.Context.Item to get the item for the current page on Preview mode and on Normal mode. To check if you are on preview you can use : if (Sitecore.Context.PageMode.IsPreview) and if is normal page you can use : if (Sitecore.Context.PageMode.IsNormal )

Categories : Asp Net

eclipse example template with an editor or multi-page editor not running due to following errors
Those are NOT ERRORS. Do not overreact. As it said, it's looking for the environmental variable HOME to have been set, but you can just go fill in information that it would guess from that in the Git preferences. These messages do not appear in newer versions of eGit. And just because you opened a Runtime Workbench does not mean your editor will be automatically opened. If it's not opening when you try to open one of its supported fie types, open a question with the stack traces of its failures.

Categories : Java

How to show result of python script in a console when running from ST editor?
SublimeREPL for is a plugin for SublimeText It does not open a cmd instance but can provide you a REPL, where You can provide input, which you usually cannot give on default console. Installation Install Package Control. http://wbond.net/sublime_packages/package_control Install SublimeREPL Preferences | Package Control | Package Control: Install Package Choose SublimeREPL Restart SublimeText2 Configure SublimeREPL (default settings in Preferences | Package Settings | SublimeREPL | Settings - Default should be modified in Preferences | Package Settings |SublimeREPL | Settings - User, this way they will survive package upgrades! Note from the documentation: ctrl+, , f means: press Ctrl and Comma, release all, press F. The keybinding above is used to Evaluate in REPL If Sublim

Categories : Python

find last editor aka author of Item in Sitecore
Try to use contentItem.Statistics.UpdatedBy You can check more members of the ItemStatistics class here.

Categories : Asp Net

jQuery mobile stop running the script in the current page used after moving to the next page
As, Omar suggested I want to give an id instead of $(document). Using pagebeforeshow or pageshow , pagehide and Clearing the interval will solve this issue. The following code works for me, var auto_refresh; $("#light-page").on('pagebeforeshow', function(){ auto_refresh = setInterval(function () { // code }, 3000); }); $('#light-page').on('pagehide', function () { clearInterval(auto_refresh); }); Adding id in Html: <div data-role="page" id="light-page"> </div>

Categories : Javascript

Running a PHP Script without redirecting or refreshing the page
Instead of <a href>, use ajax to pass the values to your php and get the result back- $.post('updateRCstatus/test.html', { 'rxdtime': <?php ecdho $time ?>, OTHER_PARAMS }, function(data) { alert(data); });

Categories : PHP

Page load image size/position script randomly not running
Don't forget that if the image has not been loaded yet, the height will be 0. Let's try this for a more comprehensive coverage: function redraw() { var height = $('#logo').height(); $('#logo').css('margin-top', (height / -2) + 'px'); } $(document).ready(function(){ $(window).load(redraw).resize(redraw); $('#logo, #logo img').ready(redraw); redraw(); });

Categories : Jquery

Can a JS error on the original page prevent a chrome content script from running?
The only thing different about this page is that its original code run with an error An error can cause your JavaScript program from running. Also, the location of your script might be an issue. Just like HTML, JavaScript runs top-to-bottom. It's a little hard to tell without seeing your code. To fix it, you can try moving your js higher up on your html file or solve your error with the help of your browser's error console.

Categories : Javascript

First dynamically-added TinyMCE editor displays, others do not
You should add class for the new text area, then apply tinymce on that class every 5 sec Here is an update to your jsfiddle that works function timerElapsed(){ // limit this example so we don't fill up the page with too many textareas if( $('#textareaContainer').find('textarea').length < 4 ){ addTextArea(); } // define some configuration settings for the editor var editorConfig = { // Location of TinyMCE script script_url: 'http://tinymce.cachefly.net/4.0/tinymce.min.js', // setup parameters menubar: false, statusbar: false, toolbar: 'bold italic underline | bullist numlist | undo redo | removeformat' } $('.tinymce-txt').tinymce(editorConfig); } function addTextArea(){ // find where the textareas w

Categories : Javascript

Need Example for Setup of Sitecore Lucene Search for Sitecore v6, to index the production database
Here is example search index configuration. You should put this inside Web.config (under configuration/indexes) in section <index id="help_pages_index" type="Sitecore.Search.Index, Sitecore.Kernel"> <param desc="name">$(id)</param> <param desc="folder">help_pages_index</param> <Analyzer ref="search/analyzer" /> <locations hint="list:AddCrawler"> <web-help type="Sitecore.Search.Crawlers.DatabaseCrawler,Sitecore.Kernel"> <Database>web</Database> <Root>/sitecore/content/Pages/Help</Root> <templates hint="list:IncludeTemplate"> <helparticle>{FF48919D-393C-4F8D-9D1A-AC6B58CEC896}</helparticle> <helpfaq>{E66F

Categories : Search

Sitecore Analytics: Trigger Event from REST service (Sitecore 6.5)
The issue was with using the Fiddler, as they say "Half knowledge is extremely dangerous". I instead switched to Simple REST client extension of Chrome to make the requests and I could see the events in the Page Events Table.

Categories : C#

Unique fields added to Wordpress Pages editor
Advanced Custom Fields is a great plugin for this. You can target a particular page to display fields on and then output your fields in the front end templates using: the_field('field_name'); See here: http://www.advancedcustomfields.com/

Categories : PHP

How to separate script editor from document (google apps script)
Yes, when you create a new document in Drive you can select Script. If you don't see the script option, try going here. You will, however, need to call your document using getByID. There my be other complexities if you are using onEdit type triggers. A lot more information can be found under the Types of Scripts heading at Google Apps Scripts Documentation. You could go advanced and pull your script in behind the Document as a Library and then using the script behind the Doc to make the calls to the library, but that's a bigger discussion.

Categories : Google Apps Script

type="mce-text/javascript" gets added in tiny mce editor html
This just happened to me as well. The replacement happens when you go to your editing page, and then hit refresh. I think that what's happening is that on the first page load, script tags are being replaced with type="mce-text/javascript", which should then be stripped out on save. Then on page refresh, this text is inserted by your browser, and then TinyMCE sees that the type is already present, so flags the script tag as not needing cleanup when you save. The only solution I've found is to realise that you shouldn't hit refresh when editing the page. I realise that this isn't a great solution, but at least it should allow you to reproduce the issue.

Categories : Jquery

Rich Text Editor (YUI Simple Text Editor used) not sending data to next page
The saveHTML() method you used does not seem to save the value to the textarea element. And because the browser doesn't care about YUI Editor and just submits what is there already in the textarea (which is null), it submits the input as null.. You should set the value of the textarea to the editor value so the browser will submit that value instead of null.. Which can be achieved using this little line: document.getElementsById("msgpost").value = html; See this working JsFiddle I made for you. However you had HTML syntax errors too. The onSubmit attribute should be on the form element not the submit button. And listening to the event is not practical when you can simply call a function when the form submits.. (See the JsFiddle)

Categories : Javascript

Sitecore mvc handling multiple forms in the same page
i found some clue from https://bitbucket.org/demoniusrex/launch-sitecore-mvc-demo/src basically in order that Sitecore render the whole layout when doing a POST. in the controller action we need to return an ActionResult by calling the Index() - your controller need to inherit the SitecoreController. The Index() method is responsible to render the whole layout, and initialize all the renderings and associated models. See how the model classes get initialized in the link above on how this is done.

Categories : Asp Net Mvc

How can I change the messaging on the Sitecore login page?
The need to override this sort of behavior in Sitecore is common. Reflector is your best friend. Find the class in the code-behind for the login page and look it up. In most cases you don't have to actually try to recreate it by cutting and pasting a lot of code. You can just create a new class of the same type that inherits the login class, then just override the one method where the action is happening. When finished, change the .aspx file to reference your new class, which will build into your own assembly instead of the Sitecore .dll. However, sometimes if you just want to change something cosmetic like an error message (that doesn't truely require any back-end logic), you might be much better served by a one-shot piece of javascript on the page that hides the default error message wh

Categories : C#

Toggle cell editor after record programmatically added to grid in ExtJS
Your row is a model config object, not a model instance, therefore store.indexOf returns -1. Try: var inst = store.add(row)[0]; ... var index = store.indexOf(inst);

Categories : Extjs

Sitecore - Webforms for Marketers 2.3 - Inserting a new form into a page
You need to set up which placeholders a form may be added to using the Restricted Placeholders window accessible from the Sitecore Desktop. Steps First, open the sitecore desktop and go to All Applications -> Web Forms for Marketers -> Restricting Placeholders: Next, use the resulting window to configure the placeholders to which forms may be added. At least one of the selected placeholders must be present for you to add a form to the item. I hope this helps. Good luck! :)

Categories : Asp Net

Custom 404 error page in Sitecore don't appears when file (.pdf and other) not found
I think this will help you. <system.web> <customErrors defaultRedirect="Error.aspx" mode="On"> <error statusCode="500" redirect="Error.aspx"/> </customErrors> </system.web> U can add additional tags and mention available error codes and the page where you want to redirect.

Categories : Asp Net

Running a .py script from bash, how can I pass a python variable back to the terminal once the .py is done running?
You can write your variable and its value into an ini file from the python script. In Values.ini file my_var="value" After executing python script, just invoke Values.ini using . operator . Values.ini Now your shell variable $my_var will be having the assigned value. The advantage with this method is that you can assign any number of variables like this. var1="value1" var2="value2" var3="value3"

Categories : Python

Running pig script gives the error as: job has failed. Stop running all dependent jobs
After some research, I found that the problem here is LeaseExpiredException. This might be because the output of mapper was removed. One of the reason for this might be due to the quota allocated for the user. In my case, I was running this script in a very large data, and my quota was insufficient to process/store the data. We can check the quota by the following command: hadoop fs -count -q /user/username Thank you.

Categories : Hadoop

Custom Script Editor
Here is some code: http://www.codeproject.com/Articles/161871/Fast-Colored-TextBox-for-syntax-highlighting It looks like you want 'idea[s] for [an] algorithm.' Therefore, the difference in language should not matter much.

Categories : Java

Running python script on crontab is causing permissions errors but running via terminal is fine
@Lucas Ou-Yang @Hyperboreus as Hyperboreus said it depends on the user privilege who run it . i think that if you give the /tmp/ dir a 777 permission from the root account it'll be fixed : chmod 777 -R /tmp/ okay try with : chmod 777 /tmp/ if the error still check if the directory /tmp/ exist !

Categories : Python

Include script once and only once in a custom Editor
Well, you can do following: Add @RenderSection("MaskedInput", false) to your master layout. That'l render @section MaskedInput{} on each page that has that section; On a page you need to add maskedInput.js you put: @section MaskedInput { @*Include scripts, styles or whatever you need here*@ }

Categories : Asp Net Mvc

Is a spotify app always running once added by a user
Your app is loaded when the user opens it. It doesn't matter if it is through the App Finder, by typing the apps' URI into the search box or reaching it through http://open.spotify.com/app/ (e.g. http://open.spotify.com/app/soundrop/). It will stay loaded as long as it is open or has started playback. For example, if a user opens your app, starts playback using a List view component in the app, and switches app to Discover without starting to play music from there, your app will still be loaded and able to listen to events. Your app will unload about 30 seconds after the user has navigated away from it without app playback, or 30 seconds after another app has taken over playback.

Categories : Api

Run SQL Azure Powershell script in query editor
You can't execute powershell scripts on the SQL Azure machine because of security related issues. Why do you want to execute a powershell script, what does the script do? Perhaps there is another way of achieving your objective.

Categories : Sql Server

Script in my browser is different from file I have in my code editor. Why?
1) this in your case is not jquery object. Use $(this) 2) Update cache of your application if browser shows code different from what you have in actual directory. 3) what you see in your browser debugger is actual code your browser getting. If you're sure that the code with $this instead of $(this) is actual code, just replace $this with $(this)

Categories : Javascript

Re-installing Linux O.S. and then running bunch of commands in a .sh script , how to stop the script if something fails?
You can check the error code from commands you run #!/bin/bash function test { "$@" status=$? if [ $status -ne 0 ]; then echo "error with $1" exit 255 fi return $status } test ls test ps -ef test not_a_command taken from here for more information Bash Beginner Check Exit Status

Categories : Linux

How to run a script that it has to connect 3 solaris servers, do some operations and create files in the machine where the script is running?
Use sshfs to mount the needed directories of your three servers. Afterwards you can run the script locally accessing the remote data as local files.

Categories : Bash

sys module giving different output when running Python script through IDLE and by double-clicking the script
print os.path.dirname(sys.executable) is what you should use. When you click it it is probably running through python.exe so you are removing the extra char from the w.

Categories : Python

Cron not running Python script is script not in home folder
cron is running crontab(5) entries from the home directory of the user. You need to change appropriately the directory i.e. to call the chdir(2) syscall (either thru the cd shell builtin, or inside your python script using os.chdir). You should query the current directory (using getcwd(3), or the pwd command, or the os.getcwd in Python) in your script. Also check your PATH if running commands.

Categories : Python

How do I run a Ruby script created in text editor in the Mac OS Terminal?
First things first: cd stands for "Change directory". Normally the terminal should open in "~", which is the home directory where most of your things are. In OS X it will be /Users/[username]. It's also possible possible that in OS X, it will save the location of the last session. I also recommend, since you're starting to install, "Iterm2", which is a nice terminal to use. It supports multiple tabs, etc. Ruby, the interpreter, is the command "ruby". To call a script you have to call Ruby with a filename: ruby /Users/rexrose/Desktop/Rubycode/c2f/c2f.rb That is almost the equivalent of: cd /Users/rexrose/Desktop/Rubycode/c2f/ ruby c2f.rb It's almost equivalent, but for now the difference shouldn't bother you. Let say that the second way to call the script is more favorable than the

Categories : Ruby

Is there an option to allow script or embed code in PageDown editor?
To answer my own question: I have found out that in PageDown we have an option to use the converter without sanitizing. var converter = new Markdown.Converter(); var editor = new Markdown.Editor(converter); editor.run();

Categories : Javascript

Is it bad to let CSS3 infinite animations running, and leave the page. Is the animation still running invisibly?
If the user leaves the page completely (e.g. navigates to a whole new page or closes that tab) then the animations shouldn't keep running. If they somehow do keep being updated, it's because of a browser bug and you shouldn't worry about it anyway. However, CSS3 animations for hidden elements (display: none;, for instance) still get evaluated, since they are keyframe-based, and there might be a keyframe sometime in the future that would cause the element to become visible again. Imagine wanting to animate a box by first hiding it, then showing it again and making it flash. If CSS transitions would suddenly become disabled when the box is hidden, the animation would stop and the box would never appear again. And that's not what you want. Note: profiling your web page can be done e.g. in

Categories : CSS

Goals added to compile phase are not running in war package
You have declared the plugins under <pluginManagement> which means you are defining the plugins for any pom which inherits from this pom (making this pom the parent). You would need to have <plugins> defined directly under <build> if you want to use the plugins for this pom directly. <build> <pluginManagement/> <plugins> <plugin> ..... </plugin> <plugin> ..... </plugin> </plugins> </build>

Categories : Java

error with global name when running a script from another script - python
This is a pretty interesting problem. First a quick workaround, you can provide dictionaries to use as the local and global namespace when calling execfile(), using an empty dictionary for globals works fine: # test_fun1.py a = 1 def test1(): print a execfile('test_fun2.py', {}) test1() Alternatively, if you want the code to execute within the global scope of your module you can use globals() instead of {}. Now on to why this isn't working... from the documentation on execfile(): If both dictionaries are omitted, the expression is executed in the environment where execfile() is called. Here "both dictionaries" is referring to the optional globals and locals arguments to execfile(). In this case "the environment where execfile() is called" is the local scope of the fun

Categories : Python

Fix Kate text editor line limit via bash script
With permission of Ansgar Wiechers, I post a sed solution that seems to work for me: sed -i.bak -e 's/^Line Length Limit=.*$/##& Line Length Limit=0/' ~/.kde4/share/config/katerc It comments current value adding ## at the beginning of the line and appending after that the same with 0 as value. I use the -i switch that appends a .bak suffix as backup to the original file. Use sed -i -e ... (note the space between both switches) to modify the file in place. Be careful with this last option. In my case, I prefer to modify files in-place with vim, so as extra I will post a one-liner that does the same than the previous sed command, only that its backup file is suffixed with ~: vim +'/^vclines+lengths+limit' -u NONE -N -c 'set backup | yank | s/v^/##/ | put | s/v(

Categories : Bash

How to reset the Registry Editor view back to root using VB script?
By deleting the "LastKey" which holds the last key viewed in the Registry Editor, the view returns to the root view. WshShell.RegDelete "HKLMSOFTWAREMicrosoftWindowsCurrentVersionAppletsRegeditLastKey"

Categories : Windows

Row added by script not deleting
you have to use event delegation since you have to deal with dynamic elements, .one() supports a event delegation $(function() { $('table.listtable').one('click', '.closeseats', function() { $(this).closest('tr.seating').remove(); }); });

Categories : Jquery



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