Search Results

Search found 4286 results on 172 pages for 'spliced news'.

Page 90/172 | < Previous Page | 86 87 88 89 90 91 92 93 94 95 96 97  | Next Page >

  • need help figuring out dynamic menu generation in django

    - by photographer
    I need to dynamically generate a code like this in the resulting html: <p>>> gallery one</p> <p><a href="../gallery2">gallery two</a></p> <p><a href="../about">about the author</a></p> <p><a href="../news">our news</a></p> I do have menu_code string variable created in views.py (it is generated depending on an item number of the current page passed — 1 in the case above), which contains that long string with the code shown above. It is (well, supposed to) passed by locals() into the html template (all other variables are passed that way successfully): return render_to_response('gallery_page.html', locals()) I have this: {% include menu_code %} inside the template html. But instead of being interpreted as code it is just shown as text in the browser. What am I doing wrong? How to make it work as a dynamically generated menu?

    Read the article

  • How to add class to selective <li> in a generated menu

    - by Vikram
    Hi I am looking for a solution to add a class to every list item <li> which has a child item with a class of <span class="separator"> and a different class to <li> with an anchor link. I use Joomla and the menu is being generated somewhat like this: <ul class="menu"> <li class="item1"><a href="<!-- link goes here -->"><span>Home</span></a></li> <li class="parent item59"><span class="separator"><span>Demo</span></span></li> <li class="item62"><a href="<!-- link goes here -->"><span>Article</span></a></li> <li id="current" class="parent active item27"><a href="<!-- link goes here -->"><span>CMS</span></a> <ul> <li class="item50"><a href="<!-- link goes here -->"><span>The News</span></a></li> <li class="item48"><a href="<!-- link goes here -->"><span>Web Links</span></a></li> <li class="item65"><span class="separator"><span /></span></li> <li class="item49"><a href="<!-- link goes here -->"><span>News Feeds</span></a></li> <li class="item66"><span class="separator"><span /></span></li> <li class="item67"><span class="separator"><span /></span></li> <li class="item68"><span class="separator"><span /></span></li> </ul> </li> <li class="item71"><span class="separator"><span>Help</span></span></li> </ul> What I want is to add class "anclink" or "seplink" to the <li> depending on their child item so that the final output looks like below. <ul class="menu"> <li class="item1 anclink"><a href="<!-- link goes here -->"><span>Home</span></a></li> <li class="parent item59 seplink"><span class="separator"><span>Demo</span></span></li> <li class="item62 anclink"><a href="<!-- link goes here -->"><span>Article</span></a></li> <li id="current" class="parent active item27" anclink><a href="<!-- link goes here -->"><span>CMS</span></a> <ul> <li class="item50 anclink"><a href="<!-- link goes here -->"><span>The News</span></a></li> <li class="item48 anclink"><a href="<!-- link goes here -->"><span>Web Links</span></a></li> <li class="item65 seplink"><span class="separator"><span /></span></li> <li class="item49 anclink"><a href="<!-- link goes here -->"><span>News Feeds</span></a></li> <li class="item66 seplink"><span class="separator"><span /></span></li> <li class="item67 seplink"><span class="separator"><span /></span></li> <li class="item68 seplink"><span class="separator"><span /></span></li> </ul> </li> <li class="item71 seplink"><span class="separator"><span>Help</span></span></li> </ul> How can I achieve this using PHP or even a jQuery solution will be fine. Kindly help.

    Read the article

  • how should I order my divs?

    - by aslum
    Here's the basic layout of a page I'm working on: What would be the best/easiest way to order the divs? C may or may not be visible (it's a news alert that only displays when there is news). A = Header, B = Menu, E&F = standard content columns, D = latest blog post. I'm thinking ABCEFD might make the most sense, but I could also see ABCDEF. Either of those should be fairly easy to do right using floats... is there a better way? Maybe put CEF inside a "middle column" div?

    Read the article

  • replace string in preg_replace

    - by zahir hussain
    <?php $a="php.net s earch for in the all php.net sites this mirror only function list online documentation bug database Site News Archive All Changelogs just pear.php.net just pecl.php.net just talks.php.net general mailing list developer mailing list documentation mailing list What is PHP? PHP is a widely-used..."; ?> I want to highlight specific words. For example php, net and func: php.net s earch for in the all **php**.**net** sites this mirror only **func**tion list online documentation bug database Site News Archive All Changelogs just pear.**php**.**net** just pecl.**php**.**net** just talks.php.net general mailing list developer mailing list documentation mailing list What is **PHP**? **PHP** is a widely-used... Thanks advance.

    Read the article

  • [Python] Detect destination of shortened, or "tiny" url

    - by conradlee
    I have just scraped a bunch of Google Buzz data, and I want to know which Buzz posts reference the same news articles. The problem is that many of the links in these posts have been modified by URL shorteners, so it could be the case that many distinct shortened URLs actually all point to the same news article. Given that I have millions of posts, what is the most efficient way (preferably in python) for me to detect whether a url is a shortened URL (from any of the many URL shortening services, or at least the largest) Find the "destination" of the shortened url, i.e., the long, original version of the shortened URL. Does anyone know if the URL shorteners impose strict request rate limits? If I keep this down to 100/second (all coming form the same IP address), do you think I'll run into trouble?

    Read the article

  • More pythonic way to iterate

    - by fmark
    I am using a module that is part of a commercial software API. The good news is there is a python module - the bad news is that its pretty unpythonic. To iterate over rows, the follwoing syntax is used: cursor = gp.getcursor(table) row = cursor.Next() while row: #do something with row row = cursor.next() What is the most pythonic way to deal with this situation? I have considered creating a first class function/generator and wrapping calls to a for loop in it: def cursor_iterator(cursor): row = cursor.Next() while row: yield row row = cursor.next() [...] cursor = gp.getcursor(table) for row in cursor_iterator(cursor): # do something with row This is an improvement, but feels a little clumsy. Is there a more pythonic approach? Should I create a wrapper class around the table type?

    Read the article

  • SharePoint 2007 Publishing site and Audience Targeting in Web Part

    - by Robert Vukovic
    In a Publishing site I have web part that has to show news items from the list that has Audience Targeting field. I am using CAML query to retrieve small number of last news items. Is it possible to specify Target Audience in the CAML query ? If not, how should I do it ? Retrieve all results and than apply filter in a loop ? I am practically duplicating Content Query Web Part and I need Audience Targeting in my custom web part.

    Read the article

  • Sorting By Multiple Conditions in Ruby

    - by viatropos
    I have a collection of Post objects and I want to be able to sort them based on these conditions: First, by category (news, events, labs, portfolio, etc.) Then by date, if date, or by position, if a specific index was set for it Some posts will have dates (news and events), others will have explicit positions (labs, and portfolio). I want to be able to call posts.sort!, so I've overridden <=>, but am looking for the most effective way of sorting by these conditions. Below is a pseudo method: def <=>(other) # first, everything is sorted into # smaller chunks by category self.category <=> other.category # then, per category, by date or position if self.date and other.date self.date <=> other.date else self.position <=> other.position end end It seems like I'd have to actually sort two separate times, rather than cramming everything into that one method. Something like sort_by_category, then sort!. What is the most ruby way to do this?

    Read the article

  • ASP.NET MVC authorization & permission to use model classes

    - by Tomek
    Hi, This is my first post here, so hello :) Okey, let's get to the point... I am writing my first app in ASP.NET MVC Framework and i have a problem with checking privileges to use instances of model classes (read, edit). Sample code looks like this: // Controller action [CustomAuthorize(Roles="Editor, Admin")] public ActionResult Stats(int id) { User user = userRepository.GetUser(id); if (user == null || !user.Activated || user.Removed) return View("NotFound"); else if (!user.IsCurrentSessionUserOwned) return View("NotAuthorized"); return View(user); } So far authorize attribute protects only controller actions, so my question is: how to make (custom) authorize attribute to check not only user role, usernames but also did i.e. resources instantiated in action methods (above: User class, but there are other ORM objects like News, Photos etc.) All of these object to check have their unique ID's, so user have own ID, News have their ID and UserID field referecned to Users table (i mean these objects are LINQ2SQL classes). How should i resolve that problem?

    Read the article

  • simply way to add another webapp framework to my project.

    - by zjm1126
    one webapp project has many url and i have to change this: ('/addTopic', AddTopic), ('/delTopic', DeleteTopic), ('/addPost', AddPost), ('/delPost', DeletePost), to this: ('/tribes/addTopic', AddTopic), ('/tribes/delTopic', DeleteTopic), ('/tribes/addPost', AddPost), ('/tribes/delPost', DeletePost), but ,if i add this to my project ,i have to change the url in every py file or html file , in django it can be this : urlpatterns = patterns('', (r'^articles/2003/$', 'news.views.special_case_2003')), ) it is easy to add the url of 'news' to my peoject, but does webapp has this ? thanks updated: (1) my main page url is : ('/', MainPage), ('/sign', Guestbook), (2) the url of a webapp project that i want to add is : ('/', MainPage), ('/logout', LogoutPage), ('/login_response', LoginHandler), and i want to change (1) to this: ('/', MainPage), ('/sign', Guestbook), ('/aa/', p2.MainPage), ('/aa/logout', p2.LogoutPage), ('/aa/login_response', p2.LoginHandler), so i have to change so many url like / to /aa/ , or change /logout to /aa/logout in py file and html file , that is a hard work so any simple way to do this ?

    Read the article

  • Rails 3 time output

    - by Oluf Nielsen
    Hi, I'm now working on my output of the feeds I'm taking in from some site. What I'm currently doing is Time, and i want it to be displayed in a maybe, little be special way.. like this.. today, 14:12 yesterday, 15:34 27/12, 15:24 i have this in my code = news.entry_published.strftime("%d/%m, %H:%M") That gives me an error saying undefined method `strftime' for "2010-12-30 19:26:00.000000":String And it dosn't do what i want with the days.. Edit: - @date = DateTime.strptime(news.entry_published, "%Y-%m-%d %H:%M:%S") = @date.strftime("%d/%m, %H:%M") Now works, and gives this output 30/12, 19:26 But i still have to check if it is today, yesterday or just another day. Cheers, Oluf.

    Read the article

  • Read XML using Sencha

    - by user580950
    I am about to develop a application using Sencha touch. The issue i am facing right now is Sencha code should read the following XML ( "data.xml" and display News, Articles...), any expert that can help here please ? <ns2:categories> <category> <catId>96</catId> <title>News</title> </category> <category> <catId>97</catId> <title>Articles</title> </category> </ns2:categories> and when i click on News as an example should read that particular "recordId" element in "data_read.xml" and display "origUrl","title","data" .the data_read.xml looks like below.. <ns2:records> <record> <recordId>96</recordId> <title>123 Lifted</title> <author>|</author> <published>2010-01-20T14:36:00.000-08:00</published> <origUrl> http://www.abc.com/</origUrl> <numComments>0</numComments> <data> <![CDATA[<p>According to a report on sd asdas das asdasd asdasd hjjasd .</p> <p> </p> <p>This is a landmark vote, and a harbinger of change for this extremely traditional area that also has banned the use of metal r bolt.</p> <p> </p> <p>Check out: abc.com and xyz .com for more information.</p> <p class="modifydate">Last Updated (Wednesday, 20 January 2010 22:36)</p>]]> </data> </record> </ns2:records> IS this possible in Sencha ? Thanks for your help in advance

    Read the article

  • Getting specific data from via facebook graph api

    - by Sima
    Hi, is there any possibility how to fetch any specific type of posts from facebook news feed via graph api?For example on my news feed I have statutuses, links, photos, vidoes, and so on..I only want to get the ones with type=status over graph api..I have seen some get parameters in documentation, but nothing like ?type=link..So I have tried /me/home?type=link, but unsurprisingly it have not worked:D So does anyone know how to do that?I can filter it in my PHP app, but then I need to get some further data..When I got 20 posts and only 10 would be statuses, I need to add the 10 remaiming? It is too possible, but I dont know how to do that:D Please help..!Thanks

    Read the article

  • Publishing similar apps in AppStore

    - by John
    Hello guys, I have some questions that I think some one here can help me ... I have published 5 apps in AppStore that brings news to the users, for different countries. One app per country, because no one want's to read the news of other countrys. Now, I have submitted 3 more apps to publish and Apple reject it, because they say that I need to use "In App Purchase" because the apps are similar ... I have seen many similar apps published by the same user .. so, my question is, how can I publish many similar apps without "In App Purchase"? I have used the same "bundle Id" for all of my apps .. Is it wrong? I need the create one bundle Id per app to get this work and the ok by Apple? Thanks you very much and sorry for my limited english!!

    Read the article

  • Serving Advertisements - What should the View be responsible for?

    - by jboyd
    My requirements are that Ads have a definite size, could be different media types (although I'd like to focus on Images first) and need to have their impressions tracked I'm using Spring-MVC and will likely have a service that will retrieve all the relevant ad information adService.getAdsForPage("news"); adService.getFeaturedAd("news"); and so on... My question is, what will my view be responsible for? I need to track impressions, and I can only really think of how to do that on the server side. But what would my view look like. I'd like any example code, ideas, or a link to a page that has some in depth discussion of this topic

    Read the article

  • Starting with asp.net MVC

    - by Josemalive
    Hello, Actually im doing a home page that only have an action called Index() that returns the view Index.ascx. This index page will be composed by lastest news and lastest registered users, i think that create two partial views is the best idea (this way i could use it in other views). for other hand i have a data access class that calls to database for get stuff (get last news, get last users, etc...) My question is simple, should i call to the this data access class in the Index() action of my HomeController, and add to the ViewData the data obtained? I think that this index() action shouldnt be the responsable of passing this data to the partial views, right? Could you give me a hand? im messing too much? ;-) Thanks in advance. Best Regards. Jose

    Read the article

  • jquery masonry on ul with nested ul

    - by Adam Wright
    I'm trying to create a footer nav of a sitemap with levels nested within each other. i want to use masonry so the padding and margin is consistant and not changed depending on nested items. its firing masonry but its adding the relative style to the nested ul if i change the masonry call to select just the first() ul then nested li appear on one line. any ideas? <div id="links"> <ul ><li class="box"><a href="/Industries.aspx" >Industries</a></li><li class="box"><a href="/Services.aspx" >Services</a></li><li class="box"><a href="/Quality---Regulatory.aspx" >Quality &amp; Regulatory</a></li><li class="box"><a href="/About.aspx" >About</a><ul ><li class="box"><a href="/About/Our-Story.aspx" >Our Story</a></li><li class="box"><a href="/About/Our-Mission.aspx" >Our Mission</a></li><li class="box"><a href="/About/Our-Core-Values.aspx" >Our Core Values</a></li></ul></li><li class="box"><a href="/News.aspx" >News</a><ul ><li class="box"><a href="/News/Events.aspx" >Events</a></li></ul></li><li class="box"><a href="/Careers.aspx" >Careers</a></li><li class="box"><a href="/Contact.aspx" >Contact</a></li><li class="box"><a href="/tests.aspx" >tests</a></li></ul> </div> <script type="text/javascript"> $('#links ul').masonry({ singleMode: true, // Disables measuring the width of each floated element. // Set to true if floated elements have the same width. // default: false columnWidth: 182, // Width in pixels of 1 column of your grid. // default: outer width of the first floated element. itemSelector: '.box:visible', // Additional selector to specify which elements inside // the wrapping element will be rearranged. // Required for Infinite Scroll with window resizing. resizeable: true, // Binds a Masonry call to window resizes // so layout appears fluid. // default: true animate: false, // Animates layout rearrangements. // default: false saveOptions: true // Masonry will use the options from previous Masonry // calls by default, so you only have to enter in options once // default: true }); </script>

    Read the article

  • Google Suggest - What determines the sort order of suggested queries on google?

    - by John Himmelman
    How is this sort order determined? Is it ranked by popularity, number of results, or a mysterious google algorithm? Does there algorithm take into account the search popularity of a query (using google-trends data or something)? Edit: I found a news article dating back to when google suggest was made public in 2004. Here is an excerpt... How does it work? "Our algorithms use a wide range of information to predict the queries users are most likely to want to see. For example, Google Suggest uses data about the overall popularity of various searches to help rank the refinements it offers." Source: http://www.free-seo-news.com/newsletter138.htm

    Read the article

  • Accessing an RSS feed in Flex, works when run from Flash Builder 4, but not when the project is onli

    - by ben
    Hey guys, In my Flex 4 app, I access an RSS feed (I'm using http://news.ycombinator.com/rss as a dummy). It works okay when I run it from Flash Builder 4, but if I export the project and upload it, I get the following error when it tries to load the RSS feed: Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: my_website_url cannot load data from http://news.ycombinator.com/rss. What could be causing this error? Shouldn't RSS be able to be accessed from anywhere? Thanks for reading.

    Read the article

  • Automatic facebook login

    - by Marc Böhmer
    I manage 4 Facebook fan pages. Whenever users make a news on his website, I post it on Facebook. Now I have made it that I only have to press a button and the news were posted. I would like to automate this. How can I do this? My problem is that it is associated with my Facebook account and then it is not running in cron job or nothing is posted. Can I use my login data to a file which the Cronjob can always log in?

    Read the article

  • Forward web request for directory index ('/') to an index.htm page in JBoss 4.0.5

    - by The Pretender
    I am using JBoss 4.0.5.GA to run a set of java applications. One of them is a web frontend, using Spring 1.4. URL mappings are configured in a way that 'fake' pages from request URLs are mapped to controllers. That means that when someone requests /index.htm, there's no actual 'index.htm' on disk, and that request maps to a specific conroller which then renders a jsp view. So the problem is as follows: I need to tell JBoss to somehow forward all requests for directory indices to corresponding 'index.htm' URLs like so: / ? /index.htm; /news/ ? /news/index.htm; /foo/bar/baz/ ? /foo/bar/baz/index.htm and so on. I can't use Tomcat's welcome-file-list feature because it looks for those files on disk, while all 'index.htm's are fake and don't actually exist on disk.

    Read the article

  • why datetime.now not work when I didn't use tolist?

    - by MemoryLeak
    When I use datacontext.News .Where(p => p.status == true) .Where(p => p.date <= DateTime.Now) .ToList(); the system will return no results; When I use datacontext.News .Where(p => p.status == true) .ToList() .Where(p => p.date <= DateTime.Now) .ToList(); system will return expected results. Can anyone tell me what's up? Thanks in advance !

    Read the article

  • PHP sorting an array by mysql date.

    - by daviemanchester
    Hi I have an array that I would like to sort using a date field from a mysql database. Here is a sample of the array which is named 'news' in my class: [48] => Array ( [id] => 14 [type] => 3 [updated] => 2010-04-17 13:54:42 ) [49] => Array ( [id] => 15 [type] => 3 [updated] => 2010-04-17 13:57:21 ) I want to sort de by the 'updated' field. I have some code I have started but am unsure how to complete it and get it working. function sortNews($x) { usort($this->news, array("ProcessClass", "cmp")); //correct sort type? } function cmp($a, $b) { ...................................... missing code } Can anyone help??

    Read the article

  • How can I use javascript to convert relative href attributes into absolute paths?

    - by jhensley2
    I have a template that gets screenscraped from an outside vendor and need to include absolute paths in the navigation so the externally hosted content will properly link back to our site. Right now the page/template is driven by a global menu app written by our back end development staff... so anyone who updates our site goes in and changes the menus and their paths... Right now all of the links are linking to relative paths back to the root. For example <a href="/">Home</a> <a href="/news/">News</a> <a href="/media/">Media</a> <a href="/other/">Other</a> I need a simple way (preferably with jquery) to prepend "http://www.domain.com" to each of those links.

    Read the article

< Previous Page | 86 87 88 89 90 91 92 93 94 95 96 97  | Next Page >