Search Results

Search found 252 results on 11 pages for 'witch'.

Page 9/11 | < Previous Page | 5 6 7 8 9 10 11  | Next Page >

  • zsh : How to list directory content with tab?

    - by Philippe CM
    I just switched from BASH to ZSH and thing are pretty good, but: when I start typing cd /usr/share/s and hit TAB, this is what I get : $ cd /usr/share/sane/ sane/ skype/ ssl-cert/ screen/ smplayer/ strigi/ seed-gtk3/ snmp/ synaptic/ sgml/ software-properties/ system-config-printer/ sgml-base/ soprano/ sysv-rc/ sgml-data/ sounds/ simple-scan/ splashy/ And this is ok. If I then hit TAB again, I get $ cd /usr/share/screen/, the next candidate, witch is also OK. (BTW, how do I cycle back to the previous candidate? Sorry, on to my question) Now what if I want to see the contents of /usr/share/screen/ now ? You now, BASH-style? The cursor is at the end of the line, will I have to ctrl-a (or home), then del del (to erase cd) then ls then ENTER? That seems like a lot of typing. (And it - possibly unnecessarily - enters the command in the history) Would not there be a key (maybe modifier-TAB? but the obvious candidates are already taken by the desktop... I digress) that would tell zsh to stop cycling through /usr/share/ and instead, just list the content /usr/share/screen/ ?

    Read the article

  • Please Help - PHP Form, when no text is entered [migrated]

    - by Joe Turner
    I'm creating a mobile landing page and I have also created a form that allows me to create more, by duplicating a folder that's host to a template file. The script then takes you to a page where you input the company details one by one and press submit. Then the page is created. My problem is, when a field is left out (YouTube for instance), the button is created and is blank. I would like there to be a default text for when there is no text. I've tried a few things and have been struggling to make this work for DAYS! <?php $company = $_POST["company"]; $phone = $_POST["phone"]; $colour = $_POST["colour"]; $email = $_POST["email"]; $website = $_POST["website"]; $video = $_POST["video"]; ?> <div id="contact-area"> <form method="post" action="generate.php"><br> <input type="text" name="company" placeholder="Company Name" /><br> <input type="text" name="slogan" placeholder="Slogan" /><br> <input class="color {required:false}" name="colour" placeholder="Company Colour"><br> <input type="text" name="phone" placeholder="Phone Number" /><br> <input type="text" name="email" placeholder="Email Address" /><br> <input type="text" name="website" placeholder="Full Website - Include http://" /><br> <input type="text" name="video" placeholder="Video URL" /><br> <input type="submit" value="Generate QuickLinks" style="background:url(images/submit.png) repeat-x; color:#FFF"/> </form> That's the form. It takes the variables and post's them to the file below. <?php $File = "includes/details.php"; $Handle = fopen($File, 'w'); ?> <?php $File = "includes/details.php"; $Handle = fopen($File, 'w'); $Data = "<div id='logo'> <h1 style='color:#$_POST[colour]'>$_POST[company]</h1> <h2>$_POST[slogan]</h2> </div> <ul data-role='listview' data-inset='true' data-theme='b'> <li style='background-color:#$_POST[colour]'><a href='tel:$_POST[phone]'>Phone Us</a></li> <li style='background-color:#$_POST[colour]'><a href='mailto:$_POST[email]'>Email Us</a></li> <li style='background-color:#$_POST[colour]'><a href='$_POST[website]'>View Full Website</a></li> <li style='background-color:#$_POST[colour]'><a href='$_POST[video]'>Watch Us</a></li> </ul> \n"; fwrite($Handle, $Data); fclose($Handle); ?> and there is what the form turns into. I need there to be a default link put in incase the field is left blank, witch it is sometimes. Thanks in advance guys.

    Read the article

  • Zend form and dynamic file upload

    - by DoomStone
    Hello there i'm trying to create a form with Zend_Form that will enable my user to upload a unlited number of files to my site, witch is done by javascript. Something like <script type="text/javascript"> $(document).ready(function(){ var image_uploade_i = 0; $('#upload_more').click(function() { image_uploade_i++; $('#upload_list').append('<div id="image_uploade_id_'+image_uploade_i+'" style="display: none;"><input type="file" name="image[]" /><br /></a>'); $('#image_uploade_id_'+image_uploade_i).slideDown('slow'); }); }); </script> <?=$this->translate('Add images')?> <form action="" method="post" enctype="multipart/form-data"> <div id="upload_list"> <input type="file" name="image[]" /><br /> <input type="file" name="image[]" /><br /> <input type="file" name="image[]" /><br /> </div> <a href="#" id="upload_more"><?=$this->translate('Upload another image')?></a><br /> <input type="submit" name="image_uploade" value="<?=$this->translate('Upload images')?>" /> </form> But i'm am unable to find out how i can create something like this with Zend_From, the only reason i want to use Zend_Form on this thoug is for validation of the uploadet files. $element = new Zend_Form_Element_File('image'); $element->setRequired(true) ->setLabel('Profile image') ->setDestination($store) ->setValueDisabled(true) ->addValidator(new Zend_Validate_File_ImageSize(array( 'minheight' => 100, 'minwidth' => 150, 'maxheight' => 1920, 'maxwidth' => 1200))) // File must be below 1.5 Mb ->addValidator(new Zend_Validate_File_FilesSize(array('max' => 1572864))) ->addValidator(new Zend_Validate_File_IsImage()); If any 1 can help me set this up would i be verry great full :D

    Read the article

  • J2ME web service client

    - by Wasim
    Hi all , I started to use the Netbeans 6.8 web service client wizard . I created a web service (.Net web service) witch return an object Data. The Data class , contains fileds with many types : int , string , double , Person object and array of Person object. I created the J2ME client code through the wizard and every thing seems ok . I see in the Netbeans project the service and the stub . When I try to call my web service method , say Data GetData() ; Then I have a problem with parsing the returned data from the web service and the client data object . As follows : After finishing to call the web service method , in the stub code : public Data helloWorld() throws java.rmi.RemoteException { Object inputObject[] = new Object[] { }; Operation op = Operation.newInstance( _qname_operation_HelloWorld, _type_HelloWorld, _type_HelloWorldResponse ); _prepOperation( op ); op.setProperty( Operation.SOAPACTION_URI_PROPERTY, "http://tempuri.org/HelloWorld" ); Object resultObj; try { resultObj = op.invoke( inputObject ); } catch( JAXRPCException e ) { Throwable cause = e.getLinkedCause(); if( cause instanceof java.rmi.RemoteException ) { throw (java.rmi.RemoteException) cause; } throw e; } return Data_fromObject((Object[])resultObj); } private static Data Data_fromObject( Object obj[] ) { if(obj == null) return null; Data result = new Data(); result.setIntData(((Integer )obj[0]).intValue()); result.setStringData((String )obj[1]); result.setDoubleData(((Double )obj[2]).doubleValue()); return result; } I debug the code and in Run time resultObj has one element witc is an array of the Data object , so in parsing the values in the Data_fromObject method it expect many cells like we see in the code obj[0] , obj[1] , obj [2] but in realtime it has obj[0][0] , obj[0][1] , obj[0][2] What can be the problem , how can check the code generation issue ? Is it a problem with the web service side. Please help. Thanks in advance...

    Read the article

  • Java & Maven generating -and using- my own archetype

    - by Random
    Hello again! I have been busy in my project creating a webapp (in struts) that manages maven, using maven-2.2.1-uber.jar link text. The problem comes when the boss says it has to use some archetypes the company has created (so no predefined archetypes for you naughty boy!). So ok, I use the -DarchetypeRepository option (with ServletWrapper I get my complete web direction, becouse the repository will be inside the app), and the log seems to find it, but then the build fails -miserably- with this little text 'Build Failure - The defined artifact is not an archetype' as simple as that. Of course I have a lot of INFO lines that say abslutily nothig related. I have read the maven definitive guide searching for some kind of help, but it has been disapointing at best. My thoughts are thatmaybe I am missing in somewhere of all the folders tree some xml that actually sais maven that my pom.xml is an archetype not a project. But I really, really, can't find anything on the net or in the manuals that explains easy-handed how the archetype:generate (with special parameters) works and where I have to put every folder and/or file. So just to say my thoughts aloud (and hopefully you understand what I am trying to ask): I have a template where I do some xml changes (variables, etc...), then I have to call maen and do an archetype:generate with a variable project. The problem seems to be that my actual confuguration doesn't like what I am doing. After the generation of the archetype, witch luckly will create some directory trees and leave me a POM.xml somewhere I still have to do some variable changes and more xml manage stuff, so it whould be very kind from maven to don't destroy anything in this process. Any ideas why this maven-thing is not happly-ever-after asuming that my archetype is defintly an archetype? Allthought I think the code is ok, it could be wrong, as I am using maven-ubber and I call the actual CSMavenCli.main(String[, ClassWorld), I don't think it is the case this time. Thanks and all! :) Random.

    Read the article

  • Monotouch or Titanium for rapid application development on IPhone?

    - by Ronnie
    As a .Net developer I always dreamed for the possibility to develop with my existing skills (c#) applications for the Iphone. Both programs require a Mac and the Iphone Sdk installed. Appcelerator Titanium was the first app I tried and it is based on exposing some Iphone native api to javascript so that they can be called using that language. Monotouch starts at $399 for beeing able to deploy on the Iphone and not on the Iphone simulator while Titanium is free. Monotouch (Monodevelop) has an Ide that is currently missing in Titanium (but you can use any editor like Textmate, Aptana...) I think both program generate at the end a native precompiled app (also if I am not sure about the size of the final app on the Iphone as I think the .Net framework calls are prelilnked at compilation time in Monotouch). I am also not sure about the full coverage of all the Iphone api and features. Titanium has also the advantage to enable Android app development but as a c# developer I still find Monotouch experience more like the Visual Studio one. Witch one would you choose and what are your experiences on Monotouch and Titanium?

    Read the article

  • Uncatchable AccesViolationException

    - by Roy
    Hi all, I'm getting close to desperate.. I am developing a field service application for Windows Mobile 6.1 using C# and quite some p/Invoking. (I think I'm referencing about 50 native functions) On normal circumstances this goes without any problem, but when i start stressing the GC i'm getting a nasty 0xC0000005 error witch seems uncatchable. In my test i'm rapidly closing and opening a dialog form (the form did make use of native functions, but for testing i commented these out) and after a while the Windows Mobile error reporter comes around to tell me that there was an fatal error in my application. My code uses a try-catch around the Application.Run(masterForm); and hooks into the CurrentDomain.UnhandledException event, but the application still crashes. Even when i attach the debugger, visual studio just tells me "The remote connection to the device has been lost" when the exception occurs.. Since I didn't succeed to catch the exception in the managed environment, I tried to make sense out of the Error Reporter log file. But this doesn't make any sense, the only consistent this about the error is the application where it occurs in. The thread where the application occurs in is unknown to me, the module where the error occurs differs from time to time (I've seen my application.exe, WS2.dll, netcfagl3_5.dll and mscoree3_5.dll), even the error code is not always the same. (most of the time it's 0xC0000005, but i've also seen an 0X80000002 error, which is a warning accounting the first byte?) I tried debugging through bugtrap, but strangely enough this crashes with the same error code (0xC0000005). I tried to open the kdmp file with visual studio, but i can't seem to make any sense out of this because it only shows me disassembler code when i step into the error (unless i have the right .pbb files, which i don't). Same goes for WinDbg. To make a long story short: I frankly don't have a single clue where to look for this error, and I'm hoping some bright soul on stackoverflow does. I'm happy to provide some code but at this moment I don't know which piece to provide.. Any help is greatly appreciated!

    Read the article

  • Sending html email to bat! program (C#)

    - by Marcin
    Hi, I`m trying to send an html email, witch will be recieved via bat! program. Mail is sending from c# code. I set up IsBodyHtml = true; My html code is : <html> <head> <title>Mail</title> </head> <body> <map name="planetmap"> <area shape="rect" coords="20,29,303,155" href="http://mysite.com" alt="this is my site" /> <area shape="rect" coords="372,23,479,103" href="http://somesite.com/" alt="somesite" /> <area shape="rect" coords="35,345,169,408" href="anotherlink.com" alt="" /> <area shape="rect" coords="178,348,332,409" href="http://www.lastsite.com/" alt="lastsite" /> </map> <img src="cid:mail" usemap ="#planetmap" border="0"/> </body> </html> this mail is displayed in outlook well but in bat! it is only an image ( map is not working). can anyone tell me what did i do bad? Regards Marcin

    Read the article

  • Rich editor.. need to replace ccorrect string...

    - by JamesM
    On my website I have a login and an article tag for editing. my article code is in HTML5 witch is enough as my editor rule is HTML5: HTML5: index.php line 212 <article contentEditable="false"> >> Changes to true when in edit mode.. <div>One row of text goes here.</div> <div>Row two's content goes here.</div> </article> I want to be able to get the selected text via JS. JS: js.php format : (function(format){ if (user = "{$ADMIN}"){ selection = getSelection(); text = selection.toString(); switch(format){ case "big": result = text.big(); break; case "small": result = text.small(); break; case "bold": result = text.bold(); break; case "italics": result = text.italics(); break; case "fixed": result = text.fixed(); break; case "strike": result = text.strike(); break; case "fontcolor": result = text.fontcolor(); break; case "fontsize": result = text.fontsize(); break; case "sub": result = text.sub(); break; case "sup": result = text.sup(); break; case "link": result = text.link(); break; } } }), I can replace the text with the result but that will replace all of them I a=can do only the first but i want to do it to the selected...

    Read the article

  • problem with ajax on the hosting server

    - by nelly
    when I Implemented chatting Function , I use Ajax to send messages between file to another . so , it is working well on local host . but , when I upload it in to remote server it doesn't work. can U tell me ,why ? is an Ajax need Special configuration ? there is my files that I used : Ajax .js file witch has "ajax_send" function that i used in chatbox.js file chatbox.js file wich consest of functions i used it to send data from php file to another one and it display the state (any user sign in or new sending message and so on ..) user.php file whitch responseble to write user name in the text file usersonline.txt and then display the online users in the online users column. send.php file that write on room1.text recive.php file that read room1.txt and then write the content into the chat box I beleve that the problem comes from the ajax code in Ajax.js File so please help me find out the problem and how to solve it. is ajax needs special server settings ? because it was working at the local host !

    Read the article

  • Flash AS3 load file xml

    - by Elias
    Hello, I'm just trying to load an xml file witch can be anywere in the hdd, this is what I have done to browse it, but later when I'm trying to load the file it would only look in the same path of the swf file here is the code package { import flash.display.Sprite; import flash.events.; import flash.net.; public class cargadorXML extends Sprite { public var cuadro:Sprite = new Sprite(); public var file:FileReference; public var req:URLRequest; public var xml:XML; public var xmlLoader:URLLoader = new URLLoader(); public function cargadorXML() { cuadro.graphics.beginFill(0xFF0000); cuadro.graphics.drawRoundRect(0,0,100,100,10); cuadro.graphics.endFill(); cuadro.addEventListener(MouseEvent.CLICK,browser); addChild(cuadro); } public function browser(e:Event) { file = new FileReference(); file.addEventListener(Event.SELECT,bien); file.browse(); } public function bien(e:Event) { xmlLoader.addEventListener(Event.COMPLETE, loadXML); req=new URLRequest(file.name); xmlLoader.load(req); } public function loadXML(e:Event) { xml=new XML(e.target.data); //xml.name=file.name; trace(xml); } } } when I open a xml file that isnt it the same directory as the swf, it gives me an unfound file error. is there anything I can do? cause for example for mp3 there is an especial class for loading the file, see http://www.flexiblefactory.co.uk/flexible/?p=46 thanks

    Read the article

  • Entity Framework 4 overwrite Equals and GetHashCode of an own class property

    - by Zhok
    Hi, I’m using Visual Studio 2010 with .NET 4 and Entity Framework 4. I’m working with POCO Classes and not the EF4 Generator. I need to overwrite the Equals() and GetHashCode() Method but that doesn’t really work. Thought it’s something everybody does but I don’t find anything about the problem Online. When I write my own Classes and Equals Method, I use Equals() of property’s, witch need to be loaded by EF to be filled. Like this: public class Item { public virtual int Id { get; set; } public virtual String Name { get; set; } public virtual List<UserItem> UserItems { get; set; } public virtual ItemType ItemType { get; set; } public override bool Equals(object obj) { Item item = obj as Item; if (obj == null) { return false; } return item.Name.Equals(this.Name) && item.ItemType.Equals(this.ItemType); } public override int GetHashCode() { return this.Name.GetHashCode() ^ this.ItemType.GetHashCode(); } } That Code doesn’t work, the problems are in Equals and GetHashCode where I try to get HashCode or Equal from “ItemType” . Every time I get a NullRefernceException if I try to get data by Linq2Entites. A dirty way to fix it, is to capture the NullReferenceException and return false (by Equals) and return base.GetHashCode() (by GethashCode) but I hope there is a better way to fix this problem. I’ve wrote a little test project, with SQL Script for the DB and POCO Domain, EDMX File and Console Test Main Method. You can download it here: Download

    Read the article

  • ruby on rails-Problem with the selection form helper

    - by winter sun
    Hello I have a form in witch users can add their working hours view them and edit them (All in one page). When adding working hours the user must select a project from a dropdown list. In case the action is adding a new hour record the dropdown field should remain empty (not selected) in case the action is edit the dropdown field should be selected with the appropriate value. In order to overcome this challenge I wrote the following code <% if params[:id].blank?%> <select name="hour[project_id]" id="hour_project_id"> <option value="nil">Select Project</option> <% @projects.each do|project|%> <option value="<%=project.id %>"><%=project.name%></option> <% end%> </select> <% else %> <%= select('hour','project_id', @projects.collect{|project|[project.name,project.id]},{:prompt => 'Select Project'})%> <% end %> So in case of save action I did the dropdown list only with html, and in case of edit action I did it with the collect method. It works fine until I tried to code the errors. The problem is that when I use the error method: validates_presence_of :project_id it didn't recognize it in the html form of the dropdown list and don’t display the error message (its working only for the dropdown with the collect method). I will deeply appreciate your instructions and help in this matter

    Read the article

  • WPF ContextMenu bind some property to another property of the same control

    - by bebicasoft
    I have a ContextMenu and a ColumnHeaderStyle defined in Window.Resource section witch i use-it to a DataGrid ColumnHeader. My code is something like this: <ContextMenu x:Key="cm_columnHeaderMenu"/> <Style x:Key="DefaultColumnHeaderStyle" TargetType="{x:Type DataGridColumnHeader}"> <Setter Property="ContextMenu" Value="{StaticResource cm_columnHeaderMenu}" /> </Style> <DataGrid Grid.Column="2" Grid.Row="1" x:Name="dgridFiles" IsReadOnly="True" ColumnHeaderStyle="{StaticResource DefaultColumnHeaderStyle}"> I want to know if I can (and if the answer it true, then HOW I could do it) bind the ContextMenu Visibility property to same control ContextMenu Items.Count>0 property. Initially based on some other treeView control selections made there shoud be no items in the context menu, but i wish to add dinamically items in ContextMenu based on selection in treeView. This part is done, the context has those items. On some selections there are no-items, but still on the grid it appears an empty ContextMenu. So I believe the easiest part it would be to bind the Visibility to Items.Count property of the same control. Sorry if my english is not good enought, I'll try to explain better if i didnt make clear 1st time.

    Read the article

  • Architecting ASP.net MVC App to use repositories and services

    - by zaladane
    Hello, I recently started reading about ASP.net MVC and after getting excited about the concept, i started to migrate all my webform project to MVC but i am having a hard time keeping my controller skinny even after following all the good advices out there (or maybe i just don't get it ... ). The website i deal with has Articles, Videos, Quotes ... and each of these entities have categories, comments, images that can be associated with it. I am using Linq to sql for database operations and for each of these Entities, i have a Repository, and for each repository, i create a service to be used in the controller. so i have - ArticleRepository ArticleCategoryRepository ArticleCommentRepository and the corresponding service ArticleService ArticleCategoryService ... you see the picture. The problem i have is that i have one controller for article,category and comment because i thought that having ArticleController handle all of that might make sense, but now i have to pass all of the services needed to the Controller constructor. So i would like to know what it is that i am doing wrong. Are my services not designed properly? should i create Bigger service to encapsulate smaller services and use them in my controller? or should i have an articleCategory Controller and an articleComment Controller? A page viewed by the user is made of all of that, thee article to be viewed,the comments associated with it, a listing of the categories to witch it applies ... how can i efficiently break down the controller to keep it "skinny" and solve my headache? Thank you! I hope my question is not too long to be read ...

    Read the article

  • Unity in C# for Platform Specific Implementations

    - by DxCK
    My program has heavy interaction with the operating system through Win32API functions. now i want to migrate my program to run under Mono under Linux (No wine), and this requires different implementations to the interaction with the operating system. I started designing a code that can have different implementation for difference platform and is extensible for new future platforms. public interface ISomeInterface { void SomePlatformSpecificOperation(); } [PlatformSpecific(PlatformID.Unix)] public class SomeImplementation : ISomeInterface { #region ISomeInterface Members public void SomePlatformSpecificOperation() { Console.WriteLine("From SomeImplementation"); } #endregion } public class PlatformSpecificAttribute : Attribute { private PlatformID _platform; public PlatformSpecificAttribute(PlatformID platform) { _platform = platform; } public PlatformID Platform { get { return _platform; } } } public static class PlatformSpecificUtils { public static IEnumerable<Type> GetImplementationTypes<T>() { foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies()) { foreach (Type type in assembly.GetTypes()) { if (typeof(T).IsAssignableFrom(type) && type != typeof(T) && IsPlatformMatch(type)) { yield return type; } } } } private static bool IsPlatformMatch(Type type) { return GetPlatforms(type).Any(platform => platform == Environment.OSVersion.Platform); } private static IEnumerable<PlatformID> GetPlatforms(Type type) { return type.GetCustomAttributes(typeof(PlatformSpecificAttribute), false) .Select(obj => ((PlatformSpecificAttribute)obj).Platform); } } class Program { static void Main(string[] args) { Type first = PlatformSpecificUtils.GetImplementationTypes<ISomeInterface>().FirstOrDefault(); } } I see two problems with this design: I can't force the implementations of ISomeInterface to have a PlatformSpecificAttribute. Multiple implementations can be marked with the same PlatformID, and i dont know witch to use in the Main. Using the first one is ummm ugly. How to solve those problems? Can you suggest another design?

    Read the article

  • SetInterval missing property in js class

    - by sebastian
    I wrote simple class in JS witch works, but i had problem when i try use setInterval with it. Ex. if i do something like that ball = new ball(5,10,0, '#canvas'); ball.draw(); ball.draw(); ball.draw(); ball.draw(); It works. But this: ball = new ball(5,10,0, '#canvas'); setInterval(ball.draw, 100); Not work. I get error that values are undefined. function ball (x,y,z,holdingEl) { this.r = 5; //zmienna przechowujaca promien pilki this.size = this.r *2; // zmienna przechowujaca rozmiar this.ballSpeed = 100; // predkosc pilki this.ballWeight = 0.45; // masa pilki this.maxFootContactTime = 0.2; // maksymalny czas kontaktu pilki z noga - stala this.ctx = jQuery(holdingEl)[0].getContext("2d"); // obiekt pilki this.intVal = 100 // predkosc odswiezania this.currentPos = { // wspolrzedne pozycji x: x, y: y, z: z } this.interactionPos = { // wspolrzedne pozycji ostatniej interakcji x: -1, y: -1, z: -1 } this.direct = { // kierunek w kazdej plaszczyznie x : 1, y : 0, z : 0 } this.draw = function (){ this.ctx.clearRect(0,0,1100,800); this.ctx.beginPath(); this.ctx.arc(this.currentPos.x, this.currentPos.y, this.r, 0, Math.PI*2, true); this.ctx.closePath(); this.ctx.fill(); } }

    Read the article

  • Callback from static library

    - by MortenHN
    I think this should be simple, but im having a real hard time finding information about this topic. I have made a static library and have no problem getting the basics to work. But im having a hard time figuring out how to make a call back from the static library to the main APP. I would like my static library to only use one header as front, this header should contain functions like: requestImage:(NSString *)path; requestLikstOfSomething:(NSSting *)guid; and so on.. These functions should do the necessary work and start a async NSURLConnection, and call back to the main application when the call have finished. How do you guys do this, what are the best ways to callback from a static library when a async method is finished? should i do this with delegates (is this possible), notifications, key/value observers. I really want to know how you guys have solved this, and what you regard as the best practices. Im going to have 20-25 different calls so i want the static library header file to be as simple as possible preferable only with a list of the 20-25 functions. UPDATE: My question is not how to use delegate pattern, but witch way is the best to do callbacks from static librarys. I would like to use delegates but i dont want to have 20-25 protocol declarations in the public header file. I would prefer to have only one function for each request. Thanks in advance. Best regards Morten

    Read the article

  • Image swaping with click on <tr>

    - by Jonny Sooter
    I've edited this piece of code from the Data Tables Plugin witch makes a tr click able and pops open another tr with details from the clicked tr. This piece of code is the event listener for opening and closing. When "details" are open the img should be images/details_close.png and they are closed the img should be images/details_open.png and have a swap occurring when it opens and closes when clicked. What is happening is there is no swap going on when its open or closed I still only get the "details_open.png". I don't knoe if I'm just not selecting the img tag properly or whats going on. Link to project: http://www2.kent.k12.wa.us/ksd/it/www/mobile/elementary.html $('#example tbody').on('click', 'td', function (e) { var myImage = $(this).find("img"); var nTr = $(this).parents('tr')[0]; if ( oTable.fnIsOpen(nTr) ) { /* This row is already open - close it */ myImage.src = "images/details_open.png"; oTable.fnClose( nTr ); } else { /* Open this row */ myImage.src = "images/details_close.png"; oTable.fnOpen( nTr, fnFormatDetails(oTable, nTr), 'details' ); } } );

    Read the article

  • Select rows from table1 and all the children from table2 into an object

    - by Patrick
    I want to pull data from table "Province_Notifiers" and also fetch all corresponding items from table "Province_Notifier_Datas". The table "Province_Notifier" has a guid to identify it (PK), table "Province_Notifier_Datas" has a column called BelongsToProvinceID witch is a foreign key to the "Province_Notifier" tables guid. I tried something like this: var records = from data in ctx.Province_Notifiers where DateTime.Now >= data.SendTime && data.Sent == false join data2 in ctx.Province_Notifier_Datas on data.Province_ID equals data2.BelongsToProvince_ID select new Province_Notifier { Email = data.Email, Province_ID = data.Province_ID, ProvinceName = data.ProvinceName, Sent = data.Sent, UserName = data.UserName, User_ID = data.User_ID, Province_Notifier_Datas = (new List<Province_Notifier_Data>().AddRange(data2)) }; This line is not working and i am trying to figure out how topull the data from table2 into that Province_Notifier_Datas variable. Province_Notifier_Datas = (new List<Province_Notifier_Data>().AddRange(data2)) I can add a record easily by adding the second table row into the Province_Notifier_Datas but i can't fetch it back. Province_Notifier dbNotifier = new Province_Notifier(); // set some values for dbNotifier dbNotifier.Province_Notifier_Datas.Add( new Province_Notifier_Data { BelongsToProvince_ID = userInput.Value.ProvinceId, EventText = GenerateNotificationDetail(notifierDetail) }); This works and inserts the data correctly into both tables. Edit: These error messages is thrown: Cannot convert from 'Province_Notifier_Data' to 'System.Collections.Generic.IEnumerable' If i look in Visual Studio, the variable "Province_Notifier_Datas" is of type System.Data.Linq.EntitySet The best overloaded method match for 'System.Collections.Generic.List.AddRange(System.Collections.Generic.IEnumerable)' has some invalid arguments Edit: var records = from data in ctx.Province_Notifiers where DateTime.Now >= data.SendTime && data.Sent == false join data2 in ctx.Province_Notifier_Datas on data.Province_ID equals data2.BelongsToProvince_ID into data2list select new Province_Notifier { Email = data.Email, Province_ID = data.Province_ID, ProvinceName = data.ProvinceName, Sent = data.Sent, UserName = data.UserName, User_ID = data.User_ID, Province_Notifier_Datas = new EntitySet<Province_Notifier_Data>().AddRange(data2List) }; Error 3 The name 'data2List' does not exist in the current context.

    Read the article

  • position for texture in opengl

    - by Tyzak
    hello, i have a question concerning how to declare the points for a texture on a cube to be exactly i mean the: glTexCoord2f(x.f, y.f); for the front side, my declaration works: glBegin(GL_POLYGON); //Vorderseite glNormal3f(0.0f, 0.0f, 1.0f);//normale für vorderseite glTexCoord2f(0.0f, -1.f); glVertex3f(-fSeitenL/2.0f,-fSeitenL/2.0f,+fSeitenL/2.0f); glTexCoord2f(1.f, -1.f); glVertex3f(+fSeitenL/2.0f,-fSeitenL/2.0f,+fSeitenL/2.0f); glTexCoord2f(1.f, 0.0f); glVertex3f(+fSeitenL/2.0f,+fSeitenL/2.0f,+fSeitenL/2.0f); glTexCoord2f(0.0f, 0.0f); glVertex3f(-fSeitenL/2.0f,+fSeitenL/2.0f,+fSeitenL/2.0f); glEnd(); but for the right side, it doesn't work, i suggest i need other parameters, for glTexCoord2f, but i don't know witch one. glBegin(GL_POLYGON); //Rechte Seite glNormal3f(1.0f, 0.0f, 0.0f); //normale für rechte seite glTexCoord2f(0.0f, -1.f); glVertex3f(+fSeitenL/2.0f,-fSeitenL/2.0f,+fSeitenL/2.0f); glTexCoord2f(1.0f, -1.f); glVertex3f(+fSeitenL/2.0f,-fSeitenL/2.0f,-fSeitenL/0.0f); glTexCoord2f(1.0f, 0.0f); glVertex3f(+fSeitenL/2.0f,+fSeitenL/2.0f,-fSeitenL/0.0f); glTexCoord2f(0.0f, 0.0f); glVertex3f(+fSeitenL/2.0f,+fSeitenL/2.0f,+fSeitenL/0.0f); glEnd(); after all i close the "texture-declaration with" glDisable(GL_TEXTURE_2D); thanks in advance

    Read the article

  • Reading XML or objects from a Web service

    - by Shawn
    This is my first time working with webservices and I am a bit lost. I successfully called the functions, but I only can get one value from the service. I read that the easiest way is to read xml or create objects and then call their values. Currently I use functions that return the desired value but I need to call them 3 times to get all the data witch is a waste of time and resources. I tried to call the service with the URL and use it as a website or getting the service to work the same way without importing into the program. The thing is that i cant find a way to pass the values into the url, because of that i get only blank pages. What is the fastest way to get my data from the services? I need city name, temperature and a flag if the city is valid. I need to pass the zip code to the service. Thank you. My current code wetther.Weather wether = new wetther.Weather(); string farenhait = wether.GetCityWeatherByZIP(zip).Temperature; string city = wether.GetCityWeatherByZIP(zip).City; bool correct = wether.GetCityWeatherByZIP(zip).Success; I tried it that way // Retrieve XML document XmlTextReader reader = new XmlTextReader("http://xml.weather.yahoo.com/forecastrss?p=94704"); // Skip non-significant whitespace reader.WhitespaceHandling = WhitespaceHandling.Significant; // Read nodes one at a time while (reader.Read()) { // Print out info on node Console.WriteLine("{0}: {1}", reader.NodeType.ToString(), reader.Name); } This one works for the yahoo page but not for mine. I need to use this webservice - http://wsf.cdyne.com/WeatherWS/Weather.asmx

    Read the article

  • Can I use php SESSIONS in spotify apps?

    - by user1593846
    since PHP can't be used in Spotify apps directly I am using it on my server only, but I am having problems getting the sessions to work, is it possible to use sessions even? I want to use it to see if a user is registered in my database or not so I am doing it like this: session_start(); $query="SELECT * FROM user WHERE facebookID = {$fbid}"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result); $num_results = mysql_num_rows($result); if ($num_results > 0) { echo"THERE IS A USER!"; $row['facebookID'] = $_SESSION[fid]; } else { echo"THERE IS NO USER!"; } the authentication to the server works fine but the session does not seem to be working, on another PHP page witch is being called after the above code has been called with some ajax code I simply wanted to try this: session_start(); if(isset($_SESSION['fid'])) { echo"SESSION EXIST"; } else { echo"NO SESSION"; } anyways is there a special way to do this in Spotify apps or do I have to do this in some other way?

    Read the article

  • WPF binding problem

    - by Lolo
    I've got problem with binding in XAML/WPF. I created Action class witch extends FrameworkElement. Each Action has list of ActionItem. The problem is that the Data/DataContext properties of ActionItem are not set, so they are always null. XAML: <my:Action DataContext="{Binding}"> <my:Action.Items> <my:ActionItem DataContext="{Binding}" Data="{Binding}" /> </my:Action.Items> </my:Action> C#: public class Action : FrameworkElement { public static readonly DependencyProperty ItemsProperty = DependencyProperty.Register("Items", typeof(IList), typeof(Action), new PropertyMetadata(null, null), null); public Action() { this.Items = new ArrayList(); this.DataContextChanged += (s, e) => MessageBox.Show("Action.DataContext"); } public IList Items { get { return (IList)this.GetValue(ItemsProperty); } set { this.SetValue(ItemsProperty, value); } } } public class ActionItem : FrameworkElement { public static readonly DependencyProperty DataProperty = DependencyProperty.Register("Data", typeof(object), typeof(ActionItem), new PropertyMetadata( null, null, (d, v) => { if (v != null) MessageBox.Show("ActionItem.Data is not null"); return v; } ), null ); public object Data { get { return this.GetValue(DataProperty); } set { this.SetValue(DataProperty, value); } } public ActionItem() { this.DataContextChanged += (s, e) => MessageBox.Show("ActionItem.DataContext"); } } Any ideas?

    Read the article

  • Threads syncronization with ThreadPoolExecutor

    - by justme1
    I'm trying to implement some logic when I create main(father) thread witch executes several other threads. Then it waits for some condition which child threads creates. After condition is meet the father executes some more child threads. The problem that when I use wait/notify I have java.lang.IllegalMonitorStateException exception. Here is the code: public class MyExecutor { final static ArrayBlockingQueue<Runnable> queue = new ArrayBlockingQueue<Runnable>(10); final static ExecutorService svc = Executors.newFixedThreadPool(1); static final ThreadPoolExecutor threadPool = new ThreadPoolExecutor(5, 8, 10, TimeUnit.SECONDS, queue); public static void main(String[] args) throws InterruptedException { final MyExecutor me = new MyExecutor(); svc.execute(new Runnable() { public void run() { try { System.out.println("Main Thread"); me.execute(threadPool, 1); System.out.println("Main Thread waiting"); wait(); System.out.println("Main Thread notified"); me.execute(threadPool, 2); Thread.sleep(100); threadPool.shutdown(); threadPool.awaitTermination(20000, TimeUnit.SECONDS); } catch (InterruptedException e) { e.printStackTrace(); } } }); svc.shutdown(); svc.awaitTermination(10000, TimeUnit.SECONDS); System.out.println("Main Thread finished"); } public void execute(ThreadPoolExecutor tpe, final int id) { tpe.execute(new Runnable() { public void run() { try { System.out.println("Child Thread " + id); Thread.sleep(2000); System.out.println("Child Thread " + id + " finished"); notify(); } catch (InterruptedException e) { e.printStackTrace(); } } }); } } When I comment wait and notify line I have the following output: Main Thread Main Thread waiting Main Thread notified Child Thread 1 Child Thread 2 Child Thread 1 finished Child Thread 2 finished Main Thread finished

    Read the article

< Previous Page | 5 6 7 8 9 10 11  | Next Page >