Search Results

Search found 208 results on 9 pages for 'anders svensson'.

Page 6/9 | < Previous Page | 2 3 4 5 6 7 8 9  | Next Page >

  • Jquery grid overlay in wordpress

    - by Anders Kitson
    I am adding this simple plugin that I have working in a static html site, and am trying to add it to a wordpress development site based off of 960 gs. The jquery code links are correct but the console gives me this error "Uncaught TypeError: Cannot call method 'addGrid' of null" I got the code from this turtorial http://www.badlydrawntoy.com/2009/04/21/960gs-grid-overlay-a-jquery-plugin/ Here is the code I am using /*<![CDATA[*/ // onload $(function() { $("body").addGrid(12, {img_path: 'img/'}); }); /*]]>*/ Here is the code for the plugin /* * @ description: Plugin to display 960.gs gridlines See http://960.gs/ * @author: badlyDrawnToy sharp / http://www.badlydrawntoy.com * @license: Creative Commons License - ShareAlike http://creativecommons.org/licenses/by-sa/3.0/ * @version: 1.0 20th April 2009 */ (function($){$.fn.addGrid=function(cols,options){var defaults={default_cols:12,z_index:999,img_path:'/images/',opacity:.6};var opts=$.extend(defaults,options);var cols=cols!=null&&(cols===12||cols===16)?cols:12;var cols=cols===opts.default_cols?'12_col':'16_col';return this.each(function(){var $el=$(this);var height=$el.height();var wrapper=$('<div id="'+opts.grid_id+'"/>').appendTo($el).css({'display':'none','position':'absolute','top':0,'z-index':(opts.z_index-1),'height':height,'opacity':opts.opacity,'width':'100%'});$('<div/>').addClass('container_12').css({'margin':'0 auto','width':'960px','height':height,'background-image':'url('+opts.img_path+cols+'.png)','background-repeat':'repeat-y'}).appendTo(wrapper);$('<div>grid on</div>').appendTo($el).css({'position':'absolute','top':0,'left':0,'z-index':opts.z_index,'background':'#222','color':'#fff','padding':'3px 6px','width':'40px','text-align':'center'}).hover(function(){$(this).css("cursor","pointer");},function(){$(this).css("cursor","default");}).toggle(function(){$(this).text("grid off");$('#'+opts.grid_id).slideDown();},function(){$(this).text("grid on");$('#'+opts.grid_id).slideUp();});});};})(jQuery);

    Read the article

  • Permission denied to access property 'toString'

    - by Anders
    I'm trying to find a generic way of getting the name of Constructors. My goal is to create a Convention over configuration framework for KnockoutJS My idea is to iterate over all objects in the window and when I find the contructor i'm looking for then I can use the index to get the name of the contructor The code sofar (function() { constructors = {}; window.findConstructorName = function(instance) { var constructor = instance.constructor; var name = constructors[constructor]; if(name !== undefined) { return name; } var traversed = []; var nestedFind = function(root) { if(typeof root == "function" || traversed[root]) { return } traversed[root] = true; for(var index in root) { if(root[index] == constructor) { return index; } var found = nestedFind(root[index]); if(found !== undefined) { return found; } } } name = nestedFind(window); constructors[constructor] = name; return name; } })(); var MyApp = {}; MyApp.Foo = function() { }; var instance = new MyApp.Foo(); console.log(findConstructorName(instance)); The problem is that I get a Permission denied to access property 'toString' Exception, and i cant even try catch so see which object is causing the problem Fiddle http://jsfiddle.net/4ZwaV/

    Read the article

  • Accessing a Clip Inside Another Clip in a Loaded SWF-File

    - by Anders
    I'm writing a card game in AS3. The artist I'm working with has produced (in Flash CS4) a single swf-file containing all the card graphics and animations. The structure of the fla working file looks something like this: - Scene - CardGraphics (Movie Clip) - CardFront - CardBack - CardValueImage (Movie Clip) ... In the program I create 52 instances of my Card class, each having a MovieClip instance created from the loaded swf. The idea is to set the frame of the CardValueImage MovieClip to correspond to the Card instance's suit and rank member variables. However, I can't figure out how I access CardValueImage and call gotoAndStop (or whatever method I will need to call). This is basically what I want to do: // Card Class [Embed(source = 'CardGraphics.swf')] private static var CardsClip:Class; private var clip:MovieClip = new CardsClip; // Card Constructor this.valueImageFrame = suit * 13 + rank; // Calculate which frame contains the // graphical representation of this card this.clip.CardValueImage.gotoAndStop(valueImageFrame);

    Read the article

  • Using fopen and str_replace to auto fill a select option

    - by Anders Kitson
    Hi Everyone, I have this file 'gardens.php', which pulls data from a table called 'generalinfo' and I use fopen to send that data to a file called 'index.html'. Here is the issue, only one option is filled. I have a demo running here Garden Demo <-- this is a new updated page and location, there are more errors than I have locally If anyone could help me fix them Username:stack1 Password:stack1 Is there a better way to achieve what I want to? Thanks! Always. GARDENS.PHP <?php include("connect.php"); $results = mysql_query("SELECT * FROM generalinfo"); while($row = mysql_fetch_array($results)){ $country = $row['country']; $province = $row['province']; $city = $row['city']; $address = $row['address']; //echo $country; //echo $province; //echo $city; //echo $address; } $fd = fopen("index.html","r") or die ("Can not fopen the file"); while ($buf =fgets($fd, 1024)){ $template .= $buf; } $template = str_replace("<%country%>",$country,$template); echo $template; ?> INDEX.PHP SNIPPET <form name="filter" method="get" action="filter.php"> <select class="country" name="country"> <option><%country%></option> </select> </form>

    Read the article

  • Best tool(s) for working with DocBook XML documents?

    - by Anders Sandvig
    I experimented with DocBook XML a while back, and also used it professionally for documenting a few software projects, but since the tool support at the time was not very good, I soon abandoned it in favor of hand-written LaTeX, and later LyX. Now I'm considering taking another look at DocBook, and I was wondering, what are the best tools for working with DocBook XML documents today?

    Read the article

  • Wordpress is_front_page if statement

    - by Anders Kitson
    I have the following code below. I am trying to get rid of the box articles div when I am on the home page the code works when the html is outside of the else portion of the IF statement, as soon as I put it inside the page goes blank, I can't seem to figure out where I have broken the code. Any help would be great. <?php if(is_front_page()) { if(function_exists('wp_content_slider')) { wp_content_slider(); } } else{ ?> <div class="box articles"> <div class="block" id="articles"> <h2><?php the_title(); ?></h2> <div class="article"> <div class="entry"> <?php the_content(); ?> </div> <?php edit_post_link('Modifca Contenuto.', '<p>', '</p>'); ?> </div> </div> </div> <?php endwhile; endif; ?> <? } ?>

    Read the article

  • (NOT) NULL for NVARCHAR columns

    - by Anders Abel
    Allowing NULL values on a column is normally done to allow the absense of a value to be represented. When using NVARCHAR there is aldready a possibility to have an empty string, without setting the column to NULL. In most cases I cannot see a semantical difference between an NVARCHAR with an empty string and a NULL value for such a column. Setting the column as NOT NULL saves me from having to deal with the possibility of NULL values in the code and it feels better to not have to different representations of "no value" (NULL or an empty string). Will I run into any other problems by setting my NVARCHAR columns to NOT NULL. Performance? Storage size? Anything I've overlooked on the usage of the values in the client code?

    Read the article

  • Using a function found in a different file in a loop

    - by Anders
    This question is related to BuddyPress, and a follow-up question from this question I have a .csv-file with 790 rows and 3 columns where the first column is the group name, second is the group description and last (third) the slug. As far as I've been told I can use this code: <?php $groups = array(); if (($handle = fopen("groupData.csv", "r")) !== FALSE) { while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { $group = array('group_id' = 'SOME ID', 'name' = $data[0], 'description' = $data[1], 'slug' = groups_check_slug(sanitize_title(esc_attr($data[2]))), 'date_created' = gmdate( "Y-m-d H:i:s" ), 'status' = 'public' ); $groups[] = $group; } fclose($handle); } foreach ($groups as $group) { groups_create_group($group); } With http://www.nomorepasting.com/getpaste.php?pasteid=35217 which is called bp-groups.php. The thing is that I can't make it work. I've created a new file with the code written above called groupgenerator.php uploaded the .csv file to the same folder and opened groupgenerator.php in my browser. But, i get this error: Fatal error: Call to undefined function groups_check_slug() in What am I doing wrong?

    Read the article

  • mysql_query where statment help

    - by Anders Kitson
    I am retrieving values from the url with the GET method and then using a if statement to determine of they are there then query them against the database to only show those items that match them, i get an unknown error with your request. here is my code $province = $_GET['province']; $city = $_GET['city']; if(isset($province) && isset($city) ) { $results3 = mysql_query("SELECT * FROM generalinfo WHERE province = $province AND city = $city ") or die( "An unknown error occurred with your request"); } else { $results3 = mysql_query("SELECT * FROM generalinfo"); } /*if statement ends*/

    Read the article

  • Scheduling jobs from a web environment on Linux

    - by Anders Feder
    Hi. I am developing an application in PHP on Linux/Apache. I want to be able to schedule PHP jobs (scripts) for execution at some specific time in the future from within the application. I know that many people will recommend cron and at, but first of all I don't need recurrence (cron) and secondly and most importantly, I need the solution to be able to scale. At was not designed with race condititions in mind, and if two users try to add a job at the same time one or both may fail. It's also important that jobs are executed at their specified time, and not just 'polled' once per minute or so. Can anyone please suggest solutions for this task? Thank you.

    Read the article

  • Win32 script environment for testing http redirects?

    - by Anders Lindahl
    The past few days I've been working with setting up an Apache server on Windows. The server is supposed to host several .htaccess files, each redirecting (or, in some cases, proxying) to different hosts. I want to create tests for these redirectons, and the solution I'm currently considering is a CGI script running on the same server, sending GET requests to it and verifying that it gets the correct redirection headers back. A scripting solution (vscript/jscript) seems worth exploring, but so far I've only managed to rule out Microsoft.XMLHTTP because it follows the redirect "behind the scenes". Are there any libraries or other solutions already present on a reasonably standard Windows Server that can do this kind of low-level HTTP work? If not, any other suggestions of simple environments to set up for verifying redirects?

    Read the article

  • Tying in .addClass() with other functions?

    - by Anders H
    Assuming an accordion dropdown with the standard form of: <ul> <li> <a href="#">Main Element</a> <ul> <li> <a href="#">Dropdown Element</a> </li> </ul> </li> </ul> I'm using jQuery to expand when the parent element link is clicked: var $j = jQuery.noConflict(); function initMenus() { $j('ul.menu ul').hide(); $j.each($j('ul.menu'), function(){ $j('#' + this.id + '.expandfirst ul:first').show(); }); $j('ul.menu li a').click( function() { var checkElement = $j(this).next(); var parent = this.parentNode.parentNode.id; if($j('#' + parent).hasClass('noaccordion')) { $j(this).next().slideToggle('normal'); return false; } if((checkElement.is('ul')) && (checkElement.is(':visible'))) { if($j('#' + parent).hasClass('collapsible')) { $j('#' + parent + ' ul:visible').slideUp('normal'); } return false; } if((checkElement.is('ul')) && (!checkElement.is(':visible'))) { $j('#' + parent + ' ul:visible').slideUp('normal'); checkElement.slideDown('normal'); return false; } } ); } $j(document).ready(function() {initMenus();}); To add a class to the Main Element when clicked (aka the class is enabled anytime the dropdown is expanded) I'm trying to use .toggleClass(className) without luck, most likely to my positioning. Where can I add this element to get the desired effect?

    Read the article

  • Html image link, not working

    - by Anders Metnik
    Hey I'm doing some testing while learning js + html5 and other web/mobile frameworks. I have a problem with one of my picture links, which I also need to change the picture dynamically and the target(hopefully). But it won't work. HTML: <div data-role="content" id="firstPageContent"> <p>I'm first in the source order so I'm shown as the page.</p> <p>View internal page called <a href="#second">second</a></p> <a href = "#second" id="mapLink" name="mapLink"><img id="mapLinkImage" alt="a map which links to the mapPage" src="images/main_header.png"/></a> <Button id="loadButton" onClick="load()"/> </div><!-- /content --> js: importScripts(dataManager.js); var mapLink=second; function load(){ alert('called'); document.getElementById('mapLinkImage').src="images/store.map.png"; document.getElementById('mapLink').href = "http://google.com"; } problem: It ain't showing the image as a link, just as a plain image. i think this will work now.

    Read the article

  • Turning a spreadsheet into array and loop and call a function

    - by Anders
    This is related to generate groups in BuddyPress. I have a spreadsheet with (in this case) a group name, group description and slug. I need to grab the information from the file, turn it into an array, then loop through it and call groups_create_group() every time. I can find that function in bp-groups.php (http://www.nomorepasting.com/getpaste.php?pasteid=35217). It tells me all the parameters you need to fill in. I'm quite new to this and looking for how I can do this. Do you know how I can grab this information and turn it into an array? An loop it through and call groups_create_group() every time?

    Read the article

  • AS3: How can I require a method argument to implement multiple interfaces?

    - by Anders
    The argument to my method func() must implement the two unrelated interfaces IFoo and IBar. Is there a better way of doing this than declaring another interface only for this purpose that inherits from IFoo and IBar and using that interface as the argument type? public interface IFooBar implements IFoo, IBar { } public function func(arg:IFooBar):void { } I'm developing for Flash Player 9.

    Read the article

  • Index for wildcard match of end of string

    - by Anders Abel
    I have a table of phone numbers, storing the phone number as varchar(20). I have a requirement to implement searching of both entire numbers, but also on only the last part of the number, so a typical query will be: SELECT * FROM PhoneNumbers WHERE Number LIKE '%1234' How can I put an index on the Number column to make those searchs efficient? Is there a way to create an index that sorts the records on the reversed string? Another option might be to reverse the numbers before storing them, which will give queries like: SELECT * FROM PhoneNumbers WHERE ReverseNumber LIKE '4321%' However that will require all users of the database to always reverse the string. It might be solved by storing both the normal and reversed number and having the reversed number being updated by a trigger on insert/update. But that kind of solution is not very elegant. Any other suggestions?

    Read the article

  • Wordpress is_front_page if statment

    - by Anders Kitson
    I have the following code below. I am trying to get rid of the box articles div when I am on the home page the code works when the html is outside of the else portion of the IF statement, as soon as I put it inside the page goes blank, I can't seem to figure out where I have broken the code. Any help would be great. <?php if(is_front_page()) { if(function_exists('wp_content_slider')) { wp_content_slider(); } } else{ ?> <div class="box articles"> <div class="block" id="articles"> <h2><?php the_title(); ?></h2> <div class="article"> <div class="entry"> <?php the_content(); ?> </div> <?php edit_post_link('Modifca Contenuto.', '<p>', '</p>'); ?> </div> </div> </div> <?php endwhile; endif; ?> <? } ?>

    Read the article

  • Avoid slowdowns while using off-site database

    - by Anders Holmström
    The basic layout of my problem is this: Website (ASP.NET/C#) hosted at a dedicated hosting company (location 1) Company database (SQL Server) with records of relevant data (location 2). Location 1 & 2 connected through VPN. Customer visiting the website and wanting to pull data from the company database. No possibility of changing the server locations or layout (i.e. moving the website to an in-office server isn't possible). What I want to do is figure out the best way to handle the data acces in this case, minimizing the need for time-expensive database calls over the VPN. The first idea I'm getting is this: When a user enters the section of the website needing the DB data, you pull all the needed tables from the database into a in-memory dataset. All subsequent views/updates to the data is done on this dataset. When the user leaves (logout, session timeout, browser closed etc) the dataset gets sent to the SQL server. I'm not sure if this is a realistic solution, and it obviously has some problems. If two web visitors are performing updates on the same data, the one finishing up last will have their changes overwriting the first ones. There's also no way of knowing you have the latest data (i.e. if a customer pulls som info on their projects and we update this info while they are viewing them, they won't see these changes PLUS the above overwriting issue will arise). The other solution would be to somehow aggregate database calls and make sure they only happen when you need them, e.g. during data updates but not during data views. But then again the longer a pause between these refreshing DB calls, the bigger a chance that the data view is out of date as per the problem described above. Any input on the above or some fresh ideas would be most welcome.

    Read the article

  • How to resize a image with jquery

    - by Anders Kitson
    I want to resize a img on a click function. Here is my code that is currently not working. I am not sure if I am doing this correctly at all, any help would be great. <script> $(document).ready(function(){ $("#viewLarge").click( function(){ $("#newsletter").width("950px"); }); }); </script> <a id="viewLarge" class="prepend-7" href="#">View Larger(+)</a> <img id='newsletter' width='630px' src='images/news/hello.jpg'>

    Read the article

  • uploading different types of files mostly pdfs

    - by Anders Kitson
    I would like to upload different types of files pressumably pdfs to a certain directory I am currently trying to get this one script working that I found on snipplr but it is not working as I assumed it would, here is my code. <?php if( isset($_POST['submit']) ) { $target_path = "../downloads/"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name'])." has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; } } ?> <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post" enctype="multipart/form-data"> <input type="file"> <input type="submit" name="submit" value="submit" /> </form>

    Read the article

  • DeleteOnSubmit doesnt exist?

    - by Anders Metnik
    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data; Thats my namespaces.. i was looking for System.Data.Linq; but it doesnt seem to be anywhere, and i guess that is what have been moved to System.Linq, since i have access to most other things in Linq. EDIT: found System.Data:Linq, no difference Here is my method: public void deleteStudienummer(int studienummer) { dbcontent = new DBEntities(); var dQry = from members in dbcontent.Medlemmer where members.Studienummer == studienummer select members; foreach (var member in dQry) { dbcontent.*** } dbcontent.AcceptAllChanges(); Console.WriteLine("delete member should have occured"); } The * was supposed to be DeleteOnSubmit, but i only have DeleteDatabase and DeleteObject, i tried with object but it doesnt work.. Have also tried dbcontent.Medlemmer.* but still not present. And AcceptAllChanges() was supposed to be .submitChanges() but that wasnt present either.

    Read the article

  • Strange difference between optimized/non optimized microsoft c++ code

    - by Anders Forsgren
    I have a c++ program with a method that looks something like this: int myMethod(int* arr1, int* arr2, int* index) { arr1--; arr2--; int val = arr1[*index]; int val2 = arr2[val]; doMoreThings(val); } With optimizations enabled (/O2) the first line where the first pointer is decremented is not executed. I assume the compiler believes that the arr1 array is not used since it thinks it can remove the decrement. Am I violating some convention in the above code? What could cause this behavior? It is a very old piece of f2c-translated code, the pointer decrement is due to the 1-based indexing of the original code.

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9  | Next Page >