Search Results

Search found 369 results on 15 pages for 'nadav bg'.

Page 6/15 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • Django + jquery : getting 301

    - by llazzaro
    Hello, I have tabs that calls via javascript urls of django to complete the "container" But i am getting 301, any idea why this is happening? Server misconfiguration? urls.py urlpatterns = patterns('', (r'^admin/', include(admin.site.urls)), (r'^list/', 'carsproj.cars.views.list'), ) view def list(request): if request.is_ajax(): return render_to_response('templates/generic_list.html', { 'items' : Cars.objects.all(), 'name' : 'List - Cars' }, context_instance = RequestContext(request)) javascript the_tabs.click(function(e){ var element = $(this); if(element.find('#overLine').length) return false; var bg = element.attr('class').replace('tab ',''); $('#overLine').remove(); $('<div>',{ id:'overLine', css:{ display:'none', width:element.outerWidth()-2, background:topLineColor[bg] || 'white' }}).appendTo(element).fadeIn('slow'); if(!element.data('cache')) { $('#contentHolder').html('<img src="/media/img/ajax_preloader.gif" width="64" height="64" class="preloader" />'); $.get(element.data('page'),function(msg){ $('#contentHolder').html(msg); element.data('cache',msg); }); } else $('#contentHolder').html(element.data('cache')); e.preventDefault(); }) Please tell me what more information you need, js code? template? url.py? I WILL EDIT THIS POST FOR ADD MORE DATA

    Read the article

  • access settings from whole jquery component

    - by Pacuraru Daniel
    I am trying to develop a jquery component for dialog modals and i dont know how to access the settings from all component functions. I need to access settings,zIndex from open function and it seems to not work. (function($) { var methods = { init: function(options) { var defaults = { bgClass: "fancy-dialog-bg", bgShow: null, zIndex: 100, show: null }; var settings = $.extend(defaults, options); return this.each(function() { var obj = $(this).hide().css("position", "fixed").css("z-index", settings.zIndex).css("left", "300px").css("top", "200px"); }); }, open: function() { // alert(settings.zIndex); not working var tes = $("<div></div>").css("backgroundColor", "#f00").css("position", "fixed").css("z-index", "99").css("width", "50%").css("height", "100%").css("left", "0").css("top", "0"); $('body').append(tes); var obj = $(this); obj.show(); }, close: function() { var obj = $(this); $("#fancy-dialog-bg-" + obj.attr('id')).remove(); obj.hide(); } }; $.fn.fancyDialog = function(method) { if (methods[method]) { return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); } else if (typeof method === 'object' || !method) { return methods.init.apply(this, arguments); } else { $.error('Method ' + method + ' does not exist.'); } }; })(jQuery);

    Read the article

  • Child divs not taking parent height

    - by Hiral
    I want height of children div .cell to take up 100% height of parent. But it is not happening. HTML: <div class="header"> header </div> <div class="wrapper"> <div class="padding"> <div class="table bg"> <div class="cell"> hello world </div> <div class="cell"> dummy text </div> </div> </div> </div> <div class="footer"> footer </div> CSS: html,body{height:100%;} body{margin:0;padding:0;} .footer,.header{background:black;height:30px;color:white;} .wrapper{min-height:calc(100% - 60px);height:auto !important;} .padding{padding:20px;} .table{display:table;width:100%;} .cell{display:table-cell;} .bg{background:#ccc;} I think it is not happening because I have .wrapper{min-height:calc(100% - 60px);height:auto !important;} It happens if I change .wrapper to .wrapper{height:calc(100% - 60px);} then it is happening. Here is the fiddle.

    Read the article

  • jquery lightbox multiple items to look like mac dashboard

    - by Don
    Hope the title says it all... I'm wondering if it's possible in any existing lightbox to pop up a look similar to the mac dashboard where multiple divs could be "on" in the front with the main webpage with a gray overlay. Basically something where a user clicks an icon on the main webpage to call, and then 4 separate content boxes are popped on top, but not in a window like a gallery. I'm thinking the top background used could be set to transparent and the individual items could be divs on the popped area, but before I reinvent the wheel, I thought I'd see if there's something like this that I just haven't found in my searches. UPDATE: 1/7/2011 I ended up using colorbox with a background behind my divs. It doesn't look like the mac with items having the bg behind them showing between them, but after talking to the designer I'm working with, that wasn't something they really needed anyhow. I think it MAY be possible changing some of the CSS though for the bg of the "popped" window. Colorbox seems to be pretty nice about making it clear what the CSS is doing and there are multiple example skins. Just my $0.02...

    Read the article

  • position of View on asp.net mvc site master page

    - by ognjenb
    How fix data table to open only in Main Content Frame? Structure of my site.master page is: left content, main content and right content. When open View page in main content she goes to the right content if it is large. Is this CSS problem? My problem is similar to this http://www.inq.me/post/ASPNet-MVC-Extension-method-to-create-a-Security-Aware-HtmlActionLink.aspx This is my CSS(come with template): /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PRIMARY LAYOUT STYLES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ .content-container { position:relative; _height:1px; min-height:1px; width:900px; /* background:url(images/bg-column-left.png) repeat-y;*/ } .content-container-inner { /*background:url(images/bg-column-right.png) repeat-y right;*/ _height:1px; min-height:1px; /*padding:0 200px;*/ position:relative; /*width:900px;*/ } .content-main { padding :15px 0% 0px 2%; /*position:relative;*/ min-height:1px; _height:1px; float:left; position:relative; /*width:96%;*/ /*width:900px;*/ } .content-left { padding:20px 10px; float:left; width:180px; margin-top:-1px; position:relative; margin-left:-100%; right:200px; _left:200px; border-top:1px dotted #797979; } .content-right { padding :15px 10px 10px 10px; float:left; width:160px; position:relative; margin-right:-200px; } .ads { text-align:center; margin:20px 0; } /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Read the article

  • Why might this work on my server but not my schools?

    - by Doug
    I created a captcha just now, and it works PERFECTLY on my own server. On the school's server, it doesn't generate an image. Why might this be? The difference in code is one line. *Edit:*Originally, it was working, but I deleted the directory by mistake and I do not know why did it suddenly work in the first place. Source code on school server: <?php session_save_path("/ichanged/this/path/for/this/post/"); session_start(); $img=imagecreatefromjpeg("bg.jpg"); if( empty($_SESSION['captcha_numbers']) ) { $captcha_numbers = 'error'; } else { $captcha_numbers = $_SESSION['captcha_numbers']; } $image_numbers=$captcha_numbers; $red=rand(100,150); $green=rand(100,255); $blue=rand(100,255); $color=imagecolorallocate($img,255-$red,255-$green,255-$blue); $text=imagettftext($img,12,rand(-7,7),rand(10,20),rand(20,30),$color,"fonts/M04.TTF",$image_numbers); header("Content-type:image/jpeg"); header("Content-Disposition:inline ; filename=secure.jpg"); imagejpeg($img); ?> Source code on my server: <?php session_start(); $img=imagecreatefromjpeg("bg.jpg"); if( empty($_SESSION['captcha_numbers']) ) { $captcha_numbers = 'error'; } else { $captcha_numbers = $_SESSION['captcha_numbers']; } $image_numbers=$captcha_numbers; $red=rand(100,150); $green=rand(100,255); $blue=rand(100,255); $color=imagecolorallocate($img,255-$red,255-$green,255-$blue); $text=imagettftext($img,12,rand(-7,7),rand(10,20),rand(20,30),$color,"fonts/M04.TTF",$image_numbers); header("Content-type:image/jpeg"); header("Content-Disposition:inline ; filename=secure.jpg"); imagejpeg($img); ?>

    Read the article

  • Clear button at uisearchbar not working at all

    - by kevin.ng
    I created a search bar programmatically and added to my view using the codes below: - (void)viewDidLoad { searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(xPositionForSearchBar, yPositionForSearchBar, widthForSearchBar, heightForSearchBar)]; UIView *bg = [[searchBar subviews] objectAtIndex:0]; searchBar.delegate = self; searchBar.placeholder = @"Search record"; for(UIView *view in searchBar.subviews){ if([view isKindOfClass:[UITextField class]]){ UITextField *tf = (UITextField *)view; tf.delegate = self; break; } } [bg removeFromSuperview]; [self.view addSubview: searchBar]; } The code is implemented with UISearchBarDelegate and UITextFieldDelegate. I have tried using - (void)searchBarCancelButtonClicked:(UISearchBar *)aSearchBar { NSLog(@"cancel clicked"); searchBar.text = @""; [aSearchBar resignFirstResponder]; } - (BOOL)textFieldShouldClear:(UITextField *)textField { NSLog(@"clear"); [self performSelector:@selector(searchBarCancelButtonClicked:) withObject:searchBar afterDelay: 0.1]; return YES; } and yet, the text inside the searchBar is not cleared at all when i click on the "clear button" - a circle with a "X" inside. The clear button works when I implemented it in IB. Wonder why? Kindly advice, many thanks.

    Read the article

  • i want to move div back left

    - by user1280074
    i have my BG image set to center & i wanna move my main content's div back to the left a little on that BG image. changing the width of the div wont do it. that just allows me to scroll more to the right. but i need it to move back left a little. but i still need that image center. how do i code this? bada-bing <style> body { background-image:url; background-repeat:no-repeat; background-position:center top; } </style> bada-boom <center> <div style="position: relative; left: 0px; top: 0px; width: 1200px; height: 1511px;"> <img src=""position: relative; top: 100px; left: -350px;"/> </div> </center> help me please

    Read the article

  • Blackberry UI tool bar : fields alignment

    - by Galaxy
    i am developing custom toolbar manager, but i want to adjust the fields alignment to be centered not aligned to the left , any advice below is the code of toolbar package galaxy.bb.ui.container; import net.rim.device.api.ui.Color; import net.rim.device.api.ui.Graphics; import net.rim.device.api.ui.XYEdges; import net.rim.device.api.ui.container.HorizontalFieldManager; import net.rim.device.api.ui.decor.Background; import net.rim.device.api.ui.decor.BackgroundFactory; import net.rim.device.api.ui.decor.Border; import net.rim.device.api.ui.decor.BorderFactory; public class ToolBarManager extends HorizontalFieldManager { private int bgColor = Color.BLACK; private int borderColor = Color.WHITE; private int borderStyle= Border.STYLE_FILLED; public ToolBarManager(){ super(USE_ALL_WIDTH); } public ToolBarManager(int bgColor) { super(USE_ALL_WIDTH); this.bgColor = bgColor; } public ToolBarManager(int bgColor, int borderStyle) { super(USE_ALL_WIDTH); this.bgColor = bgColor; this.borderStyle = borderStyle; } public int getBgColor() { return bgColor; } public void setBgColor(int bgColor) { this.bgColor = bgColor; } public int getBorderColor() { return borderColor; } public void setBorderColor(int borderColor) { this.borderColor = borderColor; } public int getBorderStyle() { return borderStyle; } public void setBorderStyle(int borderStyle) { this.borderStyle = borderStyle; } protected void paint(Graphics graphics) { super.paint(graphics); XYEdges padding = new XYEdges(5, 5, 5, 5); Border roundedBorder = BorderFactory.createRoundedBorder(padding, borderColor, borderStyle); this.setBorder(roundedBorder); Background bg = BackgroundFactory.createSolidBackground(bgColor); this.setBackground(bg); } }

    Read the article

  • visibility false, XML, as3

    - by pixelGreaser
    Hey, I'm using external XML to set flash vars. Alpha works, but not Visibility. How do I get my swf to respond to visibility? Thanks. XML <?xml version="1.0" encoding="utf-8"?> <SESSION> <BGv TITLE="visible true">false</BGv> <BGa TITLE="alpha 50 percent">.5</BGa> </SESSION> SWF //LISTEN AND LOAD XML var myXML:*; var myLoad:URLLoader = new URLLoader(); myLoad.load(new URLRequest("visible.xml")); myLoad.addEventListener(Event.COMPLETE, parseXML); //PARSE XML function parseXML(e:Event):void { myXML = new XML(e.target.data); //MY TEST var bgA:*; var bgV:*; trace(myXML.BGa.text()); trace(myXML.BGv.text()); bgA =(myXML.BGa.text()); bgV =(myXML.BGv.text()); //MY OBJECT bg.alpha = bgA;//This works great bg.visible = bgV;//This has no effect } OUTPUT .5 false

    Read the article

  • what this json must work?

    - by user1772630
    hi i search alot for get a respone from php back and if that respone is ok do someting and if its false do something else(!!!!!!!! WHENE I HAVE OTHER OUTPUT FROM THAT PHP !!!!!!) this is my index file <head> <script src="jquery-1.7.2.js" type="text/javascript"></script> <script src="js.js" type="text/javascript"></script> </head> <body> <p> click </p> <input type="text" id="who"> <br> <input type="text" id="why"> <div id="bg" align="center"> </div> </body> this is my JS file $(document).ready(function(){ $('p').click(function(){ var who = $('input#who').val(); var why = $('input#why').val(); $.post('file.php',{who:who,why:why},function(data) { if(data.success){ alert(data.message); } else{ alert('ERROR:' + data.message); } }); }); }); and this is my file.php <?php $response = array('success' => 'true', 'code' => "jQuery('#bg').html('\"Javascript\", \"json\", \"PHP\"');"); echo json_encode($response); ?> my question : 1- why this is not work i get alert (error:undifined) 2- how i can get some result from that php file when its have other output like this: <?php echo "1"; echo "2"; echo "3"; and now echo that json ?> thanks :(

    Read the article

  • absolute positioned element not getting 100% height

    - by vitto
    hi here's my code (a bit simplified) <div id="wrapper" style="width:960px; margin:0 auto; position: relative;"> <img src="img/bg/wrapper.jpg" alt="" width="960" id="bg" style="position:absolute; top:0; left:0; z-index:0; height:100%;" /> <some more div></div> </div> here's my problem: if i give my image 100% height it works correctly in firefox/chrome (it stretches all allong its wrapper) while in explorer it inherits the page height!! causing an overheighted page. I tried with height=inherit but in firefox/chrome image doesn't stretch at all, in explorer the problem remains the same. Height=auto: the same as above in F/C + explorer doesn't stretch too. Any idea? Thanks Vitto

    Read the article

  • Config files for xterm

    - by petersohn
    Is there any config files for xterm for default settings? For example, on my system, xterm start with black text on white background, and I want it the other way around. I can do it by starting it with: xterm -bg black -fg white. I want to set in a config file that if I run it without arguments, it will start with these options.

    Read the article

  • Put a task to the background with bash

    - by zneak
    Hey guy, I know that you can start a background job with Bash doing foo &. However, the best way I know to put a foreground job to the background is to do Ctrl+z to pause it then bg 1 to resume it in the background. Is there a faster way? Some Ctrl+Something key combination I'm not aware of? Thanks!

    Read the article

  • "pull" process/job into the background

    - by Mustafa Ismail Mustafa
    I know of terminating a command with & and then moving it into the background by pressing Ctrl-Z and then bg [pid], and I also know of nohup. But say you started a process that turned out to take much longer than one expected, is there a way of pulling, so to speak, this process from another terminal screen into the background so that even if I log off from the server the process would continue?

    Read the article

  • Django doesn't refresh my request object when reloading the current page.

    - by Boris Rusev
    I have a Django web site which I want ot be viewable in different languages. Until this morning everything was working fine. Here is the deal. I go to my say About Us page and it is in English. Below it there is the change language button and when I press it everything "magically" translates to Bulgarian just the way I want it. On the other hand I have a JS menu from which the user is able to browse through the products. I click on 'T-Shirt' then a sub-menu opens bellow the previously pressed containing different categories - Men, Women, Children. The link guides me to a page where the exact clothes I have requested are listed. BUT... When I try to change the language THEN, nothing happens. I go to the Abouts Page, change the language from there, return to the clothes catalog and the language is changed... I will no paste some code. This is my change button code: function changeLanguage() { if (getCookie('language') == 'EN') { setCookie("language", 'BG'); } else { setCookie("language", 'EN'); } window.location.reload(); } These are my URL patterns: urlpatterns = patterns('', # Example: # (r'^enter_clothing/', include('enter_clothing.foo.urls')), # Uncomment the admin/doc line below and add 'django.contrib.admindocs' # to INSTALLED_APPS to enable admin documentation: # (r'^admin/doc/', include('django.contrib.admindocs.urls')), # Uncomment the next line to enable the admin: (r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': '/home/boris/Projects/enter_clothing/templates/media', 'show_indexes': True}), (r'^$', 'enter_clothing.clothes_app.views.index'), (r'^home', 'enter_clothing.clothes_app.views.home'), (r'^products', 'enter_clothing.clothes_app.views.products'), (r'^orders', 'enter_clothing.clothes_app.views.orders'), (r'^aboutUs', 'enter_clothing.clothes_app.views.aboutUs'), (r'^contactUs', 'enter_clothing.clothes_app.views.contactUs'), (r'^admin/', include(admin.site.urls)), (r'^(\w+)/(\w+)/page=(\d+)', 'enter_clothing.clothes_app.views.displayClothes'), ) My About Us page: @base def aboutUs(request): return """<b>%s</b>""" % getTranslation("About Us Text", request.COOKIES['language']) The @base method: def base(myfunc): def inner_func(*args, **kwargs): try: args[0].COOKIES['language'] except: args[0].COOKIES['language'] = 'BG' resetGlobalVariables() initCollections(args[0]) categoriesByCollection = dict((collection, getCategoriesFromCollection(args[0], collection)) for collection in collections) if args[0].COOKIES['language'] == 'BG': for k, v in categoriesByCollection.iteritems(): categoriesByCollection[k] = reduce(lambda a,b: a+b, map(lambda x: """<li><a href="/%s/%s/page=1">%s</a></li>""" % (translateCategory(args[0], x), translateCollection(args[0], k), str(x)), v), "") else: for k, v in categoriesByCollection.iteritems(): categoriesByCollection[k] = reduce(lambda a,b: a+b, map(lambda x: """<li><a href="/%s/%s/page=1">%s</a></li>""" % (str(x), str(k), str(x)), v), "") contents = myfunc(*args, **kwargs) return render_to_response('index.html', {'title': title, 'categoriesByCollection': categoriesByCollection.iteritems(), 'keys': enumerate(keys), 'values': enumerate(values), 'contents': contents, 'btnHome':getTranslation("Home Button", args[0].COOKIES['language']), 'btnProducts':getTranslation("Products Button", args[0].COOKIES['language']), 'btnOrders':getTranslation("Orders Button", args[0].COOKIES['language']), 'btnAboutUs':getTranslation("About Us Button", args[0].COOKIES['language']), 'btnContacts':getTranslation("Contact Us Button", args[0].COOKIES['language']), 'btnChangeLanguage':getTranslation("Button Change Language", args[0].COOKIES['language'])}) return inner_func And the catalog page: @base def displayClothes(request, category, collection, page): clothesToDisplay = getClothesFromCollectionAndCategory(request, category, collection) contents = "" pageCount = len(clothesToDisplay) / ( rowCount * columnCount) + 1 matrixSize = rowCount * columnCount currentPage = str(page).replace("page=", "") currentPage = int(currentPage) - 1 #raise Exception(request) # this is for the clothes layout for x in range(currentPage * matrixSize, matrixSize * (currentPage + 1)): if x < len(clothesToDisplay): if request.COOKIES['language'] == 'EN': contents += """<div class="clothes">%s</div>""" % clothesToDisplay[x].getEnglishHTML() else: contents += """<div class="clothes">%s</div>""" % clothesToDisplay[x].getBulgarianHTML() if (x + 1) % columnCount == 0: contents += """<div class="clear"></div>""" contents += """<div class="clear"></div>""" # this is for the page links if pageCount > 1: for x in range(0, pageCount): if x == currentPage: contents += """<a href="/%s/%s/page=%s"><span style="font-size: 20pt; color: black;">%s</span></a>""" % (category, collection, x + 1, x + 1) else: contents += """<a href="/%s/%s/page=%s"><span style="font-size: 20pt; color: blue;">%s</span></a>""" % (category, collection, x + 1, x + 1) return """%s""" % (contents) Let me explain that you needn't be alarmed by the large quantities of code I have posted. You don't have to understand it or even look at all of it. I've published it just in case because I really can't understand the origins of the bug. Now this is how I have narrowed the problem. I am debuging with "raise Exception(request)" every time I want to know what's inside my request object. When I place this in my aboutUs method, the language cookie value changes every time I press the language button. But NOT when I am in the displayClothes method. There the language stays the same. Also I tried putting the exception line in the beginning of the @base method. It turns out the situation there is exactly the same. When I am in my About Us page and click on the button, the language in my request object changes, but when I press the button while in the catalog page it remains unchanged. That is all I could find, and I have no idea as to how Django distinguishes my pages and in what way. P.S. The JavaScript I think works perfectly, I have tested it in multiple ways. Thank you, I hope some of you will read this enormous post, and don't hesitate to ask for more code excerpts.

    Read the article

  • Compiler error: Variable or field declared void [closed]

    - by ?? ?
    i get some error when i try to run this, could someone please tell me the mistakes, thank you! [error: C:\Users\Ethan\Desktop\Untitled1.cpp In function `int main()': 25 C:\Users\Ethan\Desktop\Untitled1.cpp variable or field `findfactors' declared void 25 C:\Users\Ethan\Desktop\Untitled1.cpp initializer expression list treated as compound expression] #include<iostream> #include<cmath> using namespace std; void prompt(int&, int&, int&); int gcd(int , int , int );//3 input, 3 output void findfactors(int , int , int, int, int&, int&);//3 input, 2 output void display(int, int, int, int, int);//5 inputs int main() { int a, b, c; //The coefficients of the quadratic polynomial int ag, bg, cg;//value of a, b, c after factor out gcd int f1, f2; //The two factors of a*c which add to be b int g; //The gcd of a, b, c prompt(a, b, c);//Call the prompt function g=gcd(a, b, c);//Calculation of g void findfactors(a, b, c, f1, f2);//Call findFactors on factored polynomial display(g, f1, f2, a, c);//Call display function to display the factored polynomial system("PAUSE"); return 0; } void prompt(int& num1, int& num2, int& num3) //gets 3 ints from the user { cout << "This program factors polynomials of the form ax^2+bx+c."<<endl; while(num1==0) { cout << "Enter a value for a: "; cin >> num1; if(num1==0) { cout<< "a must be non-zero."<<endl; } } while(num2==0 && num3==0) { cout << "Enter a value for b: "; cin >> num2; cout << "Enter a value for c: "; cin >> num3; if(num2==0 && num3==0) { cout<< "b and c cannot both be 0."<<endl; } } } int gcd(int num1, int num2, int num3) { int k=2, gcd=1; while (k<=num1 && k<=num2 && k<=num3) { if (num1%k==0 && num2%k==0 && num3%k==0) gcd=k; k++; } return gcd; } void findFactors(int Ag, int Bg, int Cg,int& F1, int& F2) { int y=Ag*Cg; int z=sqrt(abs(y)); for(int i=-z; i<=z; i++) //from -sqrt(|y|) to sqrt(|y|) { if(i==0)i++; //skips 0 if(y%i==0) //if i is a factor of y { if(i+y/i==Bg) //if i and its partner add to be b F1=i, F2=y/i; else F1=0, F2=0; } } } void display(int G, int factor1, int factor2, int A, int C) { int k=2, gcd1=1; while (k<=A && k<=factor1) { if (A%k==0 && factor1%k==0) gcd1=k; k++; } int t=2, gcd2=1; while (t<=factor2 && t<=C) { if (C%t==0 && factor2%t==0) gcd2=t; t++; } cout<<showpos<<G<<"*("<<gcd1<<"x"<<gcd2<<")("<<A/gcd1<<"x"<<C/gcd2<<")"<<endl; }

    Read the article

  • PHP: How to automate building a 100 <UL>/<LI> menuitems, while keeping the Menu Structure File Flat / Simply Managable?

    - by Sam
    Above: current "stupid" menu. (entire ul/li menu for javascript menu system) + (some li lines as page-specific submenu) Hi folks! With passion for automation and elegancy, but limited knowledge/knowhow, im stuck with "my hands in my hair" as we Dutch say, for my current menu system works perfectly, but is a pain in the a*s to update! So, i would appreciate it greatly, if you can suggest how to automate this in php: how to let the php generate the html menu code basing on a flat menu input file with TABS indented. OLD SITUATION <ul> <!-- about 100 of these <li>....</li> lines --> <li><a href="carrot.php"><p class="mnu" style="background-position:0 -820px"><? echo __("carrot juice") ?></p></a></li> <!-- lots of data, with only little bit thats really the menu itself--> </ul a javascript file reads a ul/li structure as input to build menu of format in that ul/li, the items with a hyperlink and sprite-bg position represent webpages, (inside LI) while items without hyperlink and sprite-bg are just headers of that menusection, (inside H6) to highlight the current page in the menu, the javascript menumaker uses an id number. this number corresponds to the consequtive li that is a webpage, skips h6 headers correctly. these h6 headers are only there for when importing sections of the same menu as submenu. non-li headers are not shown in menu, nore counted by the javascript menu for their ID. to know which page should be shown, i have to count from ID 0, the li items till finding the current webpage in the li structure and then manually put it in each webpage! BUT: changing an item in li order, means stupidly re-counting their entire li again! each webpage has an icon (= sprite bg-position numer), which is also used in the webpage. INTENDED RESULT I dream of, once setting what the current webpage is (e.g carrot.php) the menu system automatically "finds" and "counts" the li's and returns the id nr (for proper highlight of main menu); generates the entire menu html, and depending on which headings are set for submenu, (e.g. meals, drinks) generates those submenu (entire section below each given header); ginally adds h5 highlight inside the li of that submenu item. For the menu, i wish an easily readable, simple plain txt menu that is indented with tabs, (each tab is one depth for example) and further tabs follow for url and sprite position of icon. MY DREAM MENU-MANAGEMENT FILE |>TAB SEPARATED/INDENTED FLATMENU FILE |MUST BE CALCULATED BY PHP: |>MENUTEXT============URL=============SPRITE=====|ID===TAG================== |>about "#" -520 |00 li |> INFORMATION |—— h6 |> physical state "physical.php" -920 |01 li |> mental health "mental.php" -10 |02 li |> |>apetite "#" -1290 |03 li |> meals "#" -600 |04 li |> COLD MEAL |—— h6 |> egg salade "salad.php" -1040 |05 li |> salmon fish "salmon.php" -540 |06 li |> HOT MEAL |—— h6 |> spare ribs "spareribs.php" -120 |07 li |> di macaroni "macaroni.php" -870 |08 li |> |> drinks "#" -230 |09 li |> JUCY DRINK |—— h6 |> carrot juice "carrot.php" -820 |10 li |> mango hive "mango.php" -270 |11 li DESIRED CHRONOLOGY php outputs the entire ul/li html so the javascript can show the menu: webpage items go inside li tags, and header items go inside h6 tags, e.g. <h6>JUCY DRINK</h6> Each website page has a url filename [eg: salad.php]. Based on this given fact, the php menu generator detects the pagename, gives the IDnr of the position of that page according to the li-item nr and sets variable for javascript to highlight current menu item. the menu items below the specified headers are loaded as submenu in which the current page.php is wrapped inside h5 to highlight current page in submenu: e.g. (<li><h5><a href="carrot.php"><p>..etc..</p></h5></li> Question Which methods / steps / (chronological)ways are there for doing this? I am no good in php programming, but am learning it so please dont write any code without a line of comment why I should use that method etc. Where do I start? If I am unclear in my question, please ask. Thanks. Much appreciated!! Concrete Task List from the provided Comments/Answers, sofar: (RobertB) First, get some PHP code working that can read through a tab-delimited file and put the data into an appropriate data structure. NOW WORKING AT THIS

    Read the article

  • Display date/time in Ubuntu lock screen (cinnamon-like)

    - by 3l4ng
    I was using Ubuntu 13.04 till a few days ago. I had installed Nemo and I guess cinnamon got installed too (I was still using Unity nonetheless). One of the good things about that was the lock screen somehow changed to mimick cinnamon's (with the background as a darkened version of desktop background and date/time displayed), something like this: I have no idea how this happened, but it looked great. It does not seem to work on Ubuntu 13.10. Anyone has any ideas to get a similar lock screen? I just need to display the date/time on one side with the bg as a darkened version of my desktop wallpaper

    Read the article

  • Alert visualization recipe: Get out your blender, drop in some sp_send_dbmail, Google Charts API, add your favorite colors and sprinkle with html. Blend till it’s smooth and looks pretty enough to taste.

    - by Maria Zakourdaev
      I really like database monitoring. My email inbox have a constant flow of different types of alerts coming from our production servers with all kinds of information, sometimes more useful and sometimes less useful. Usually database alerts look really simple, it’s usually a plain text email saying “Prod1 Database data file on Server X is 80% used. You’d better grow it manually before some query triggers the AutoGrowth process”. Imagine you could have received email like the one below.  In addition to the alert description it could have also included the the database file growth chart over the past 6 months. Wouldn’t it give you much more information whether the data growth is natural or extreme? That’s truly what data visualization is for. Believe it or not, I have sent the graph below from SQL Server stored procedure without buying any additional data monitoring/visualization tool.   Would you like to visualize your database alerts like I do? Then like myself, you’d love the Google Charts. All you need to know is a little HTML and have a mail profile configured on your SQL Server instance regardless of the SQL Server version. First of all, I hope you know that the sp_send_dbmail procedure has a great parameter @body_format = ‘HTML’, which allows us to send rich and colorful messages instead of boring black and white ones. All that we need is to dynamically create HTML code. This is how, for instance, you can create a table and populate it with some data: DECLARE @html varchar(max) SET @html = '<html>' + '<H3><font id="Text" style='color: Green;'>Top Databases: </H3>' + '<table border="1" bordercolor="#3300FF" style='background-color:#DDF8CC' width='70%' cellpadding='3' cellspacing='3'>' + '<tr><font color="Green"><th>Database Name</th><th>Size</th><th>Physical Name</th></tr>' + CAST( (SELECT TOP 10                             td = name,'',                             td = size * 8/1024 ,'',                             td = physical_name              FROM sys.master_files               ORDER BY size DESC             FOR XML PATH ('tr'),TYPE ) AS VARCHAR(MAX)) + '</table>' EXEC msdb.dbo.sp_send_dbmail @recipients = '[email protected]', @subject ='Top databases', @body = @html, @body_format = 'HTML' This is the result:   If you want to add more visualization effects, you can use Google Charts Tools https://google-developers.appspot.com/chart/interactive/docs/index which is a free and rich library of data visualization charts, they’re also easy to populate and embed. There are two versions of the Google Charts Image based charts: https://google-developers.appspot.com/chart/image/docs/gallery/chart_gall This is an old version, it’s officially deprecated although it will be up for a next few years or so. I really enjoy using this one because it can be viewed within the email body. For mobile devices you need to change the “Load remote images” property in your email application configuration.           Charts based on JavaScript classes: https://google-developers.appspot.com/chart/interactive/docs/gallery This API is newer, with rich and highly interactive charts, and it’s much more easier to understand and configure. The only downside of it is that they cannot be viewed within the email body. Outlook, Gmail and many other email clients, as part of their security policy, do not run any JavaScript that’s placed within the email body. However, you can still enjoy this API by sending the report as an email attachment. Here is an example of the old version of Google Charts API, sending the same top databases report as in the previous example but instead of a simple table, this script is using a pie chart right from  the T-SQL code DECLARE @html  varchar(8000) DECLARE @Series  varchar(800),@Labels  varchar(8000),@Legend  varchar(8000);     SET @Series = ''; SET @Labels = ''; SET @Legend = ''; SELECT TOP 5 @Series = @Series + CAST(size * 8/1024 as varchar) + ',',                         @Labels = @Labels +CAST(size * 8/1024 as varchar) + 'MB'+'|',                         @Legend = @Legend + name + '|' FROM sys.master_files ORDER BY size DESC SELECT @Series = SUBSTRING(@Series,1,LEN(@Series)-1),         @Labels = SUBSTRING(@Labels,1,LEN(@Labels)-1),         @Legend = SUBSTRING(@Legend,1,LEN(@Legend)-1) SET @html =   '<H3><font color="Green"> '+@@ServerName+' top 5 databases : </H3>'+    '<br>'+    '<img src="http://chart.apis.google.com/chart?'+    'chf=bg,s,DDF8CC&'+    'cht=p&'+    'chs=400x200&'+    'chco=3072F3|7777CC|FF9900|FF0000|4A8C26&'+    'chd=t:'+@Series+'&'+    'chl='+@Labels+'&'+    'chma=0,0,0,0&'+    'chdl='+@Legend+'&'+    'chdlp=b"'+    'alt="'+@@ServerName+' top 5 databases" />'              EXEC msdb.dbo.sp_send_dbmail @recipients = '[email protected]',                             @subject = 'Top databases',                             @body = @html,                             @body_format = 'HTML' This is what you get. Isn’t it great? Chart parameters reference: chf     Gradient fill  bg - backgroud ; s- solid cht     chart type  ( p - pie) chs        chart size width/height chco    series colors chd        chart data string        1,2,3,2 chl        pir chart labels        a|b|c|d chma    chart margins chdl    chart legend            a|b|c|d chdlp    chart legend text        b - bottom of chart   Line graph implementation is also really easy and powerful DECLARE @html varchar(max) DECLARE @Series varchar(max) DECLARE @HourList varchar(max) SET @Series = ''; SET @HourList = ''; SELECT @HourList = @HourList + SUBSTRING(CONVERT(varchar(13),last_execution_time,121), 12,2)  + '|' ,              @Series = @Series + CAST( COUNT(1) as varchar) + ',' FROM sys.dm_exec_query_stats s     CROSS APPLY sys.dm_exec_sql_text(plan_handle) t WHERE last_execution_time > = getdate()-1 GROUP BY CONVERT(varchar(13),last_execution_time,121) ORDER BY CONVERT(varchar(13),last_execution_time,121) SET @Series = SUBSTRING(@Series,1,LEN(@Series)-1) SET @html = '<img src="http://chart.apis.google.com/chart?'+ 'chco=CA3D05,87CEEB&'+ 'chd=t:'+@Series+'&'+ 'chds=1,350&'+ 'chdl= Proc executions from cache&'+ 'chf=bg,s,1F1D1D|c,lg,0,363433,1.0,2E2B2A,0.0&'+ 'chg=25.0,25.0,3,2&'+ 'chls=3|3&'+ 'chm=d,CA3D05,0,-1,12,0|d,FFFFFF,0,-1,8,0|d,87CEEB,1,-1,12,0|d,FFFFFF,1,-1,8,0&'+ 'chs=600x450&'+ 'cht=lc&'+ 'chts=FFFFFF,14&'+ 'chtt=Executions for from' +(SELECT CONVERT(varchar(16),min(last_execution_time),121)          FROM sys.dm_exec_query_stats          WHERE last_execution_time > = getdate()-1) +' till '+ +(SELECT CONVERT(varchar(16),max(last_execution_time),121)     FROM sys.dm_exec_query_stats) + '&'+ 'chxp=1,50.0|4,50.0&'+ 'chxs=0,FFFFFF,12,0|1,FFFFFF,12,0|2,FFFFFF,12,0|3,FFFFFF,12,0|4,FFFFFF,14,0&'+ 'chxt=y,y,x,x,x&'+ 'chxl=0:|1|350|1:|N|2:|'+@HourList+'3:|Hour&'+ 'chma=55,120,0,0" alt="" />' EXEC msdb.dbo.sp_send_dbmail @recipients = '[email protected]', @subject ='Daily number of executions', @body = @html, @body_format = 'HTML' Chart parameters reference: chco    series colors chd        series data chds    scale format chdl    chart legend chf        background fills chg        grid line chls    line style chm        line fill chs        chart size cht        chart type chts    chart style chtt    chart title chxp    axis label positions chxs    axis label styles chxt    axis tick mark styles chxl    axis labels chma    chart margins If you don’t mind to get your charts as an email attachment, you can enjoy the Java based Google Charts which are even easier to configure, and have much more advanced graphics. In the example below, the sp_send_email procedure uses the parameter @query which will be executed at the time that sp_send_dbemail is executed and the HTML result of this execution will be attached to the email. DECLARE @html varchar(max),@query varchar(max) DECLARE @SeriesDBusers  varchar(800);     SET @SeriesDBusers = ''; SELECT @SeriesDBusers = @SeriesDBusers +  ' ["'+DB_NAME(r.database_id) +'", ' +cast(count(1) as varchar)+'],' FROM sys.dm_exec_requests r GROUP BY DB_NAME(database_id) ORDER BY count(1) desc; SET @SeriesDBusers = SUBSTRING(@SeriesDBusers,1,LEN(@SeriesDBusers)-1) SET @query = ' PRINT '' <html>   <head>     <script type="text/javascript" src="https://www.google.com/jsapi"></script>     <script type="text/javascript">       google.load("visualization", "1", {packages:["corechart"]});        google.setOnLoadCallback(drawChart);       function drawChart() {                      var data = google.visualization.arrayToDataTable([                        ["Database Name", "Active users"],                        '+@SeriesDBusers+'                      ]);                        var options = {                        title: "Active users",                        pieSliceText: "value"                      };                        var chart = new google.visualization.PieChart(document.getElementById("chart_div"));                      chart.draw(data, options);       };     </script>   </head>   <body>     <table>     <tr><td>         <div id="chart_div" style='width: 800px; height: 300px;'></div>         </td></tr>     </table>   </body> </html> ''' EXEC msdb.dbo.sp_send_dbmail    @recipients = '[email protected]',    @subject ='Active users',    @body = @html,    @body_format = 'HTML',    @query = @Query,     @attach_query_result_as_file = 1,     @query_attachment_filename = 'Results.htm' After opening the email attachment in the browser you are getting this kind of report: In fact, the above is not only for database alerts. It can be used for applicative reports if you need high levels of customization that you cannot achieve using standard methods like SSRS. If you need more information on how to customize the charts, you can try the following: Image Based Charts wizard https://google-developers.appspot.com/chart/image/docs/chart_wizard  Live Image Charts Playground https://google-developers.appspot.com/chart/image/docs/chart_playground Image Based Charts Parameters List https://google-developers.appspot.com/chart/image/docs/chart_params Java Script Charts Playground https://code.google.com/apis/ajax/playground/?type=visualization Use the above examples as a starting point for your procedures and I’d be more than happy to hear of your implementations of the above techniques. Yours, Maria

    Read the article

  • Incorrect colour blending when using a pixel shader with XNA

    - by MazK
    I'm using XNA 4.0 to create a 2D game and while implementing a layer tinting pixel shader I noticed that when the texture's alpha value is anything between 1 or 0 the end result is different than expected. The tinting works from selecting a colour and setting the amount of tint. This is achieved via the shader which works out first the starting colour (for each r, g, b and a) : float red = texCoord.r * vertexColour.r; and then the final tinted colour : output.r = red + (tintColour.r - red) * tintAmount; The alpha value isn't tinted and is left as : output.a = texCoord.a * vertexColour.a; The picture in the link below shows different backdrops against an energy ball object where it's outer glow hasn't blended as I would like it to. The middle two are incorrect as the second non tinted one should not show a glow against a white BG and the third should be entirely invisible. The blending function is NonPremultiplied. Why the alpha value is interfering with the final colour?

    Read the article

  • Usb WiFi dongle pluggin in doesnt create wlan0 interface

    - by zuba
    I use D-Link DWA-110 WiFi usb dongle. It used to be working well, but after some config changes I broke something and now when I plug the dongle in I see it in lsusb output, but wlan0 isn't created and the led on the dongle doesn't light. What to check out? ~ > uname -a Linux Distress 3.2.0-56-generic #86-Ubuntu SMP Wed Oct 23 17:31:43 UTC 2013 i686 i686 i386 GNU/Linux dmesg shows [ 667.824095] usb 1-8: new high-speed USB device number 6 using ehci-pci [ 668.117996] usb 1-8: New USB device found, idVendor=07d1, idProduct=3c07 [ 668.118007] usb 1-8: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [ 668.118015] usb 1-8: Product: 802.11 bg WLAN [ 668.118021] usb 1-8: Manufacturer: Ralink

    Read the article

  • Hide debug information when running apps from the command line

    - by tutuca
    Most of the time running a gtk application from the command line it starts dumping debug information to the stdio even though I put them in background. Example: ~$ gedit test.html # and ctrl+z to suspend zsh: suspended gedit .zshrc ~$ bg [1] + continued gedit .zshrc ~$ # do some editing (gedit:6208): GtkSourceView-WARNING **: Could not find word to remove in buffer (whoosh), this should not happen! (gedit:6208): GtkSourceView-WARNING **: Could not find word to remove in buffer (haystack), this should not happen! I want to note that the error, or warning, changes according to what I'm doing at the moment. The GtkSourceView-WARNING shown here is one of the cases. Anyway... Do you know if it's at all possible to avoid getting that information printed out?

    Read the article

  • Update drivers for TL-WN851ND

    - by Tony_GPR
    Today I bought a new PCI wireless card, TP-Link WN851ND, with Atheros AR9227 chipset. It has 2 antennas and is compatible with Wifi N so I thought it would improve the quality of the signal. But after install it on my computer the result is the opposite to expected. It doesn't connect to my network, while my old Wifi BG card connect without problems, I created an access point from my smartphone to try the card, and work, but is very slow loading pages. In Windows 7 works perfectly, so I think the problem is the driver. I have Ubuntu 12.04 LTS with kernel 3.2.0.31, is there a way to update the driver or I can apply a patch to improve the performance of the card? Otherwise, anyone know if there is a work in progress to improve compatibility with this chipset, or is it better to change the card and buy one with better driver compatibility. And finally, which wireless N compatible chipsets have good support under Linux/Ubuntu?

    Read the article

  • Duplicating content from another site and adding value (summaries, statistics) - ranking and courtesy

    - by Krastanov
    I am working on a site that takes a governmental data base, provides a number of statistical and other summaries and also post the original data. However this data (mostly long pieces of text) is also published on the official governmental site (without the added value of summaries). Should I worry about google ranking due to this duplication? What is the preferred way to point to the official source of the information? There is no advertisement on my site. My site is ".com". The governmental site is ".bg".

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >