Search Results

Search found 229 results on 10 pages for 'anne gentle'.

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

  • Language+IDE for teaching high school students?

    - by daveagp
    I'm investigating languages and IDEs for a project involving teaching high-school students (around grade 11). It will teach basics of programming as an introduction to computer science (e.g., including how numbers/strings/characters are represented, using procedures and arrays, control flow, a little bit of algorithms, only very basic I/O). The non-negotiable requirements for this project are: a free up-to-date cross-platform IDE (Win & Mac incl. 64-bit) with debug a compiler where it's easy to learn from your mistakes together with the IDE, a gentle installation+learning curve So far, the best options I see are the following. Are there others I should know about? I am giving a short explanation with each one to generally show what I am looking for. In order from most to least promising: Pascal + FreePascal IDE (it seems a little buggy but actively developed?) Python + Eclipse + PyDev (good but features are overwhelming/hard to navigate) Groovy + Eclipse ('') Python + IDLE (looks unnatural to do debugging, to me) Pascal + Lazarus (IDE overwhelming, e.g. not obvious how to "start from scratch") Preferably, as a rule of thumb, the language should be direct enough that you don't need to wrap every program in a class, don't need to reference a System object to println, etc. I tried a little bit to see if there is something in JavaScript or (non-Visual) Basic along the lines of what I want, but found nothing so far. I would say that C/C++/C#, Java, Ruby, Lisp, VB do not fit my criteria for languages for this project. To reiterate my questions: are any of those 5 options really awesome or un-awesome? Are there other options which are even MORE awesome? Anything for Basic or JavaScript which meets all of the criteria? Thanks!

    Read the article

  • iPhone apps: Webapps or native?

    - by jpartogi
    Hi all, I am planning to create an iPhone apps version for our online webapps. I am still new to iPhone apps development so I don't know whether to choose iPhone native or a webapps that runs on iPhone browser. The requirement is actually pretty basic. The iPhone apps need to submit data and get data from the database that is also used by the webapps. User would have the same access to the webapps, only I want this specific to iPhone, as the user experience would be different using a webapps and iPhone apps. I am also interested to sell the application on Apple store. Based on your experience, what would be better for this kind of requirement, iPhone native or webapps? What are the drawbacks building a native iPhone apps and webapps that runs on iPhone browser? Also, am I only limited to Objective-C to build a native iPhone apps? Or is there any other framework for that? Please be gentle on me, I am not starting a flamewar.

    Read the article

  • JAVA - Create variable names using a loop?

    - by SeerUK
    Hi, first time poster, long time reader so be gentle with me :) See the following code which works to generate me timestamps for the beginning and end of every month in a financial year. int year = 2010; // Financial year runs from Sept-Aug so earlyMonths are those where year = FY-1 and lateMonths are those where year = FY int[] earlyMonths = {8, 9, 10, 11}; // Sept to Dec int earlyYear = year -1; for (int i : earlyMonths) { month = i; Calendar cal = Calendar.getInstance(); cal.clear(); cal.set(earlyYear,month,1,0,0,0); Long start = cal.getTimeInMillis(); cal.clear(); cal.set(earlyYear,month,1); lastDayofMonth = cal.getActualMaximum(GregorianCalendar.DAY_OF_MONTH); cal.set(earlyYear,month,lastDayofMonth,23,59,59); Long end = cal.getTimeInMillis(); } int[] lateMonths = {0, 1, 2, 3, 4, 5, 6, 7}; // Jan to Aug for (int i : lateMonths) { month = i; Calendar cal = Calendar.getInstance(); cal.clear(); cal.set(year,month,1,0,0,0); Long start = cal.getTimeInMillis(); cal.clear(); cal.set(year,month,1); lastDayofMonth = cal.getActualMaximum(GregorianCalendar.DAY_OF_MONTH); cal.set(year,month,lastDayofMonth,23,59,59); Long end = cal.getTimeInMillis(); } So far so good, but in order to use these results I need these timestamps to be output to variables named by month (to be used in a prepared statement later in the code. e.g. SeptStart = sometimestamp, SeptEnd = some timestamp etc etc. I don't know if it is possible to declare new variables based on the results of each loop. Any ideas?

    Read the article

  • Create variable names using a loop in Java?

    - by SeerUK
    Hi, first time poster, long time reader so be gentle with me :) See the following code which works to generate me timestamps for the beginning and end of every month in a financial year. int year = 2010; // Financial year runs from Sept-Aug so earlyMonths are those where year = FY-1 and lateMonths are those where year = FY int[] earlyMonths = {8, 9, 10, 11}; // Sept to Dec int earlyYear = year -1; for (int i : earlyMonths) { month = i; Calendar cal = Calendar.getInstance(); cal.clear(); cal.set(earlyYear,month,1,0,0,0); Long start = cal.getTimeInMillis(); cal.clear(); cal.set(earlyYear,month,1); lastDayofMonth = cal.getActualMaximum(GregorianCalendar.DAY_OF_MONTH); cal.set(earlyYear,month,lastDayofMonth,23,59,59); Long end = cal.getTimeInMillis(); } int[] lateMonths = {0, 1, 2, 3, 4, 5, 6, 7}; // Jan to Aug for (int i : lateMonths) { month = i; Calendar cal = Calendar.getInstance(); cal.clear(); cal.set(year,month,1,0,0,0); Long start = cal.getTimeInMillis(); cal.clear(); cal.set(year,month,1); lastDayofMonth = cal.getActualMaximum(GregorianCalendar.DAY_OF_MONTH); cal.set(year,month,lastDayofMonth,23,59,59); Long end = cal.getTimeInMillis(); } So far so good, but in order to use these results I need these timestamps to be output to variables named by month (to be used in a prepared statement later in the code. e.g. SeptStart = sometimestamp, SeptEnd = some timestamp etc etc. I don't know if it is possible to declare new variables based on the results of each loop. Any ideas?

    Read the article

  • Application Architect vs. Systems Architect vs. Enterprise Architect?

    - by iaman00b
    So many buzzwords. Not sure if I need to start playing BS Bingo or not. And I'm not trying to be cynical. But I've heard many people with these various titles. There never seems to be a clear delineation between the three. Or there's a lot of domain crossover between the three. Actually, another I've seen while looking around here on Stackoverflow has been "Solutions Architect" as well. But that one doesn't seem to be so prevalent in other places. There are questions here and there with vague answers. But I'd like definative answers to this. Please assume I'm still relatively new to software stuff and that I'm trying to map out a career path. Oh, and please be gentle folks; this most definitely is not a duplicate question. Neither is it an aggregate. So kindly leave it alone. Xp

    Read the article

  • Best Practice: QT4 QList<Mything*>... on Heap, or QList<Mything> using reference?

    - by Mike Crowe
    Hi Folks, Learning C++, so be gentle :)... I have been designing my application primarily using heap variables (coming from C), so I've designed structures like this: QList<Criteria*> _Criteria; // ... Criteria *c = new Criteria(....); _Criteria.append(c); All through my program, I'm passing pointers to specific Criteria, or often the list. So, I have a function declared like this: QList<Criteria*> Decision::addCriteria(int row,QString cname,QString ctype); Criteria * Decision::getCriteria(int row,int col) which inserts a Criteria into a list, and returns the list so my GUI can display it. I'm wondering if I should have used references, somehow. Since I'm always wanting that exact Criteria back, should I have done: QList<Criteria> _Criteria; // .... Criteria c(....); _Criteria.append(c); ... QList<Criteria>& Decision::addCriteria(int row,QString cname,QString ctype); Criteria& Decision::getCriteria(int row,int col) (not sure if the latter line is syntactically correct yet, but you get the drift). All these items are specific, quasi-global items that are the core of my program. So, the question is this: I can certainly allocate/free all my memory w/o an issue in the method I'm using now, but is there are more C++ way? Would references have been a better choice (it's not too late to change on my side). TIA Mike

    Read the article

  • Shutdown and WakeUp Script C#

    - by Stephen Murby
    Hiya I am very new to C#, infact this is basically my first task set by work whilst i learn the language. Yes i am also new to programming, be gentle :). Context: My script needs to query active directory, grab of OU's and put them to a combo box in a form. Next query ActDir for a list of machines in a selected OU (Done this in a vbscript already) Next query the machines in turn for there IP, and MAC addresses.(Done this in a vbscript already) Next needs to shut those machines down(Done this in a vbscript already) and dump all the machine and NIC info to a txt file The other half of the script grabs the info for the machines out of the text file and sends them a magic packet to wake them up. The shutdown section i have already written a VBscript for, but decided it wasn't future prrof, and i was learninc C# at home, so figured it was the best option to start over with. Im not looking for anyone to write this for me, but if anyone had any pointers on where to go for information etc. . . It would be more than appreciated :)

    Read the article

  • Display gridview in new window

    - by Ricardo Deano
    Hello all. Just a bit of advice needed really in terms of how I should handle my current scenario: I have a web page that searches for products/category information the results of which are at present displayed in a gridview on the same page. However, said gridview is a bit of a beast and as such, I would like to have a page that the user searches for, a button is pressed and the subsequent gridview is displayed in a new window. Ultimately, I would like the user to be able to make multiple searches so that new windows can have multiple gridviews containing different data sets. My current thinking is to create session variables that can be pulled through onto 'the gridview page'. Having said that, I'm not sure that would work if multiple searches are created? I am also thinking I might be able to create said 'gridview window' using javascript but my concern here is the potential loss of functionality of the gridview i.e. paging, sorting, editing, etc. Does anyone have any thoughts or theories on this? What would be "best practise"? Any thoughts greatly appreciated and taken on board. PS: This is being developed in .net, using c# and LINQ. PPS: I'm a noob so be gentle!!

    Read the article

  • Outgoing UDP sniffer in python?

    - by twneale
    I want to figure out whether my computer is somehow causing a UDP flood that is originating from my network. So that's my underlying problem, and what follows is simply my non-network-person attempt to hypothesize a solution using python. I'm extrapolating from recipe 13.1 ("Passing Messages with Socket Datagrams") from the python cookbook (also here). Would it possible/sensible/not insane to try somehow writing an outgoing UDP proxy in python, so that outgoing packets could be logged before being sent on their merry way? If so, how would one go about it? Based on my quick research, perhaps I could start a server process listening on suspect UDP ports and log anything that gets sent, then forward it on, such as: import socket s =socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.bind(("", MYPORT)) while True: packet = dict(zip('data', 'addr'), s.recvfrom(1,024)) log.info("Recieved {data} from {addr}.".format(**packet)) But what about doing this for a large number of ports simultaneously? Impractical? Are there drawbacks or other reasons not to bother with this? Is there a better way to solve this problem (please be gentle).

    Read the article

  • Dynamically populated NSPopUpButtonCell menu in an NSOutlineView

    - by Mo
    I’m working with an NSOutlineView which has two columns. My dataSource supplies the outline view with a tree of items of a custom class which represents file types (that is, you initialise it with a UTI). The first column is the display name of the file type (e.g., “Source code”, “Interface Builder NIB document”, etc.). The second column is an NSPopUpButtonCell which is supposed to allow the user to pick a handler for the given document type (think of Xcode’s “File Types” preference pane, and you’re pretty much there). I can generate an NSMenu for a given item in the tree, populated with options based upon the Launch Services database entries for the UTI, complete with the relevant application icon and and so on. In fact, the menu itself works wonderfully, populated by way of NSPopUpButtonCellWillPopUpNotification. The problem is, try as I might, the cell when the menu isn’t popped up always contains precisely one of two things: either an empty string, or the default text for the cell, the former if the result of -handlerName on the item (the attribute assigned to the column) is non-nil, the latter otherwise. Moreover, I’m manually calling -selectItem: on the NSPopUpButtonCell instance, which just seems Wrong. In contrast, the left-hand column, which is just an NSTextFieldCell, everything just works (although granted, all it’s got to do is read the value from the item and present it). (Disclaimer: I’m fairly new at Cocoa UI stuff; I know Objective-C, and lots of other programming languages, but I’ve not a huge amount of experience of building Mac OS X UIs, so be gentle).

    Read the article

  • Copy constructor using private attributes

    - by Pedro Magueija
    Hello all, My first question here so be gentle. I would like arguments for the following code: public class Example { private String name; private int age; ... // copy constructor here public Example(Example e) { this.name = e.name; // accessing a private attribute of an instance this.age = e.age; } ... } I believe this breaks the modularity of the instance passed to the copy construct. This is what I believe to be correct: public class Example { private String name; private int age; ... // copy constructor here public Example(Example e) { this.setName(e.getName()); this.setAge(e.getAge()); } ... } A friend has exposed a valid point of view, saying that in the copy construct we should create the object as fast as possible. And adding getter/setter methods would result in unnecessary overhead. I stand on a crossroad. Can you shed some light?

    Read the article

  • Declaration, allocation and assignment of an array of pointers to function pointers

    - by manneorama
    Hello Stack Overflow! This is my first post, so please be gentle. I've been playing around with C from time to time in the past. Now I've gotten to the point where I've started a real project (a 2D graphics engine using SDL, but that's irrelevant for the question), to be able to say that I have some real C experience. Yesterday, while working on the event system, I ran into a problem which I couldn't solve. There's this typedef, //the void parameter is really an SDL_Event*. //but that is irrelevant for this question. typedef void (*event_callback)(void); which specifies the signature of a function to be called on engine events. I want to be able to support multiple event_callbacks, so an array of these callbacks would be an idea, but do not want to limit the amount of callbacks, so I need some sort of dynamic allocation. This is where the problem arose. My first attempt went like this: //initial size of callback vector static const int initial_vecsize = 32; //our event callback vector static event_callback* vec = 0; //size static unsigned int vecsize = 0; void register_event_callback(event_callback func) { if (!vec) __engine_allocate_vec(vec); vec[vecsize++] = func; //error here! } static void __engine_allocate_vec(engine_callback* vec) { vec = (engine_callback*) malloc(sizeof(engine_callback*) * initial_vecsize); } First of all, I have omitted some error checking as well as the code that reallocates the callback vector when the number of callbacks exceed the vector size. However, when I run this code, the program crashes as described in the code. I'm guessing segmentation fault but I can't be sure since no output is given. I'm also guessing that the error comes from a somewhat flawed understanding on how to declare and allocate an array of pointers to function pointers. Please Stack Overflow, guide me.

    Read the article

  • Concatenate 2 text elements on a line with full-width border using CSS only

    - by Michael Horne
    Okay, I'm a newbie to CSS3, so please be gentle. ;-) I'm working with some Wordpress code (Woocommerce plugin, to be exact), and I'm trying to format a line of code in a sidebar so that 2 separate text items (one in an <a, the other in a <span are all on the same line, the full width of the column, and with a bottom border. It looks something like this (except the bottom border on each text do not go all the way across the enclosing sidebar box): http://www.dalluva.com/temp/browse-catalog.JPG (sorry, I'm new and can't post inline images yet) Here's the code fragment I'm trying to live with (i.e. I don't want to change it): <div class="widget"> ... <ul class="product-categories"> <li class="cat-item"> <a href="http://localhost/dalluva/shop/product-category/books/">Books</a> <span class="count">(5)</span> </li> ... And here's the CSS I have now: .widget ul li a { border-bottom: 1px solid #e9e9e9; line-height:1.0; padding: 5px 0 5px 22px; display: inline-block; } .widget ul li span { border-bottom: 1px solid #e9e9e9; line-height: 1.0; padding: 5px 0 5px 0; display: inline-block; } The output in the image above looks right for this CSS code, but when I change the 'span' CSS to include a width:100%, it causes the span element to wrap to the next line, looking like this: http://www.dalluva.com/temp/browse-catalog-2.JPG I've played with white-space:nowrap, overflow:hidden, etc, but I can't seem to find a way to have both the <a and the <span text on the same line with the border extending the full width of the column. Any suggestions on getting the desired effect through CSS only? Thanks. Michael

    Read the article

  • Django 1.1 template question

    - by Bovril
    Hi All, I'm a little stuck trying to get my head around a django template. I have 2 objects, a cluster and a node I would like a simple page that lists... [Cluster 1] [associated node 1] [associated node 2] [associated node 3] [Cluster 2] [associated node 4] [associated node 5] [associated node 6] I've been using Django for about 2 days so if i've missed the point, please be gentle :) Models - class Node(models.Model): name = models.CharField(max_length=30) description = models.TextField() cluster = models.ForeignKey(Cluster) def __unicode__(self): return self.name class Cluster(models.Model): name = models.CharField(max_length=30) description = models.TextField() def __unicode__(self): return self.name Views - def DSAList(request): clusterlist = Cluster.objects.all() nodelist = Node.objects.all() t = loader.get_template('dsalist.html') v = Context({ 'CLUSTERLIST' : clusterlist, 'NODELIST' : nodelist, }) return HttpResponse(t.render(v)) Template - <body> <TABLE> {% for cluster in CLUSTERLIST %} <tr> <TD>{{ cluster.name }}</TD> {% for node in NODELIST %} {% if node.cluster.id == cluster.id %} <tr> <TD>{{ node.name }}</TD> </tr> {% endif %} {% endfor %} </tr> {% endfor %} </TABLE> </body> Any ideas ?

    Read the article

  • problem with phpMyAdmin advanced features

    - by typoknig
    Hi all, I am having trouble putting the final touches on my MySQL/Apache/phpMyAdmin install on a Windows XP system. I am trying to get rid of all the error message in phpMyAdmin and I have gotten rid of all of them except the ones related to "advanced features." The exact error message I have is : The additional features for working with linked tables have been deactivated. To find out why click here. I have read up on the cause of the errors but I must be missing something because I still cannot get the warning to go away. Here is what I have done: Created a linked-tables infrastructure (default name "phpmyadmin") per the phpMyAdmin instructions and enabled "pmadb" in my "config.inc.php" file. Specified (enabled) the table names in my "config.inc.php" file (there are 9 tables total). Created a "controluser" and granted only Select privilages per phpMyAdmin instructions Adjusted "controluser" pma and "controlpass" pmapass in "config.inc.php" file From what I can see these are all the instruction phpMyAdmin gives on this subject, and I am unable to locate any tutorials on the specifics of "advanced features" in phpMyAdmin. Any help would be appreciated, and be gentle, this is my first go with MySQL/phpMyAdmin

    Read the article

  • Long running method causing race condition

    - by keeleyt83
    Hi, I'm relatively new with hibernate so please be gentle. I'm having an issue with a long running method (~2 min long) and changing the value of a status field on an object stored in the DB. The pseudo-code below should help explain my issue. public foo(thing) { if (thing.getStatus() == "ready") { thing.setStatus("finished"); doSomethingAndTakeALongTime(); } else { // Thing already has a status of finished. Send the user back a message. } } The pseudo-code shouldn't take much explanation. I want doSomethingAndTakeALongTime() to run, but only if it has a status of "ready". My issue arises whenever it takes 2 minutes for doSomethingAndTakeALongTime() to finish and the change to thing's status field doesn't get persisted to the database until it leaves foo(). So another user can put in a request during those 2 minutes and the if statement will evaluate to true. I've already tried updating the field and flushing the session manually, but it didn't seem to work. I'm not sure what to do from here and would appreciate any help. PS: My hibernate session is managed by spring.

    Read the article

  • Should I pass a SqlDataReader by reference or not when passing it out to multiple threads.

    - by deroby
    Hi all, being new to c# I've run into this 'conundrum' when passing around a SqlDataReader between different threads. Without going into too much detail, the idea is to have a main thread fetching data from the database (a large recordset) and then have a helper-task run through this record by record and doing some stuff based upon the contents of this. There is no feedback to the recordset, it simply wades through until no records are left. This works fine, but given the nature of the job at hand it should be possible to have this job spread over different threads (CPUs) to maximize throughput (the order of execution is of no significance). The question then becomes, when I pass this recordset in a SqlDataReader, do I have to use ref or not ? It kind of boils down to the question : if I pass the object around without specifying ref, won't it create new copies in memory and have records processed n times ? Or, don't I risk having the record-position being moved forward while not all fields have been fully read yet ? The latter seems more like a 'data racing' issue and probably is covered by the lock()ing mechanism (or not?). My initial take on the problem was that it doesn't really hurt passing the variable using ref, yet as a colleague put it : "you only need ref when you're doing something wrong" =) Additionally using ref restricts me from applying a Using() construction too which isn't very nice either. I thus create a "basic" project that tackles the same approach but without the ref notation. Tests so far show that it works flawlessly on a Core2Duo (2cpu) using any number of threads, yet I'm still a bit wary... What do you experts think about this ? Use ref or not ? You can find the test-project here as it seems I can't upload it to this question directly ?!? ps: it's just a test-project and I'm new to c#, so please be gentle on me when breaking down the code =P

    Read the article

  • Displaying a collection of objects in a .Net grid on a smartphone without data binding.

    - by Xav
    I know there's No DataGridView in the CF, but I've got a collection of in-memory objects that I want to display in a grid on a phone. Options I have thought of: Stick all the objects into a SQL-CE database and use a bound datagrid. This'll mean pulling my classes apart and separating the data from the functionality, which may or may not be a bad thing, but seems a little overkill. Write my own dataset and binding code so that I can bind my collection of objects to a bound datagrid. No idea how practical or possible this is, but seems like it's either do-able or impossible and I'm hoping someone here knows which! Find a third-party unbound grid control. The only one I've seen mentioned is OpenNetCF, which I'm downloading as I type. Are there others? Are any of them any good? Do something very nasty with dynamically loading labels and textboxes into a scrolling region on the form. REALLY don't want to go there. I'm not much experienced with data-bound controls other than occasionally making use of the very vanilla functionality in WinForms or ASP.Net, and that quite a long time ago, so if any of the above are silly, please be gentle. Thanks Xav

    Read the article

  • ASP.NET MVC twitter/myspace style routing

    - by Astrofaes
    Hi guys, This is my first post after being a long-time lurker - so please be gentle :-) I have a website similar to twitter, in that people can sign up and choose a 'friendly url', so on my site they would have something like: mydomain.com/benjones I also have root level static pages such as: mydomain.com/about and of course my homepage: mydomain.com/ I'm new to ASP.NET MVC 2 (in fact I just started today) and I've set up the following routes to try and achieve the above. public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.IgnoreRoute("content/{*pathInfo}"); routes.IgnoreRoute("images/{*pathInfo}"); routes.MapRoute("About", "about", new { controller = "Common", action = "About" } ); // User profile sits at root level so check for this before displaying the homepage routes.MapRoute("UserProfile", "{url}", new { controller = "User", action = "Profile", url = "" } ); routes.MapRoute("Home", "", new { controller = "Home", action = "Index", id = "" } ); } For the most part this works fine, however, my homepage is not being triggered! Essentially, when you browser to mydomain.com, it seems to trigger the User Profile route with an empty {url} parameter and so the homepage is never reached! Any ideas on how I can show the homepage?

    Read the article

  • Better way of coding this if statment?

    - by HadlowJ
    Hi. I have another question for you very helpful people. I use a lot of if statements many of which are just repeated and im sure could be shortened. This is my current bit of code if (Globals.TotalStands <= 1) { ScoreUpdate.StandNo2.Visible = false; ScoreUpdate.ScoreStand2.Visible = false; ScoreUpdate.ScoreOutOf2.Visible = false; } if (Globals.TotalStands <= 2) { ScoreUpdate.StandNo3.Visible = false; ScoreUpdate.ScoreStand3.Visible = false; ScoreUpdate.ScoreOutOf3.Visible = false; } if (Globals.TotalStands <= 3) { ScoreUpdate.StandNo4.Visible = false; ScoreUpdate.ScoreStand4.Visible = false; ScoreUpdate.ScoreOutOf4.Visible = false; } if (Globals.TotalStands <= 4) { ScoreUpdate.StandNo5.Visible = false; ScoreUpdate.ScoreStand5.Visible = false; ScoreUpdate.ScoreOutOf5.Visible = false; } if (Globals.TotalStands <= 5) { ScoreUpdate.StandNo6.Visible = false; ScoreUpdate.ScoreStand6.Visible = false; ScoreUpdate.ScoreOutOf6.Visible = false; } if (Globals.TotalStands <= 6) { ScoreUpdate.StandNo7.Visible = false; ScoreUpdate.ScoreStand7.Visible = false; ScoreUpdate.ScoreOutOf7.Visible = false; } if (Globals.TotalStands <= 7) { ScoreUpdate.StandNo8.Visible = false; ScoreUpdate.ScoreStand8.Visible = false; ScoreUpdate.ScoreOutOf8.Visible = false; } as you can see there is a huge amount of code to do something simple (which i do on a few other forms as well and im sure there must be a better way of coding this that gets the same result? Im a code noob so please be gentle, code is c# and software is visual studio 2008 pro. Thanks

    Read the article

  • jQuery Syntax Error - Trying to detect viewport size and select background image to use w/CSS

    - by CuppyCakes
    Hi all. Please be gentle, I'm still learning. I imagine that the solution to my problem is simple and that perhaps I have just been in front of the computer too long. I am trying to detect the size of the viewport, and then use a different sized image for a background on an element depending on the size of the viewport. Here is what I have so far: $(document).ready(function(){ var pageWidth = $(window).width(); if ( pageWidth <= 1280 ) { $('#contact').css('background-image', 'url(../images/contact_us_low.jpg)'); } elseif ( pageWidth > 1280 ) { $('#contact').css('background-image', 'url(../images/contact_us_high.jpg)'); } }); Error: missing ; before statement [Break on this error] elseif ( pageWidth 1280 ) {\n (Line 7) To me it seems like all of my semi-colons are in the right place. Two questions: Am I going about solving the problem in a sensible way? To me a simple conditional should solve this background problem, as the code is merely selecting between two images based on what size it detects the viewport to be. Can you please help point out my n00b syntax error? Sometimes it really does help to have an extra pair of eyes look at something like this, even if small. Thank you kindly for your advice, I will continue poking and perusing the docs I have available to me.

    Read the article

  • AJAX filter MySQL results using checkboxes

    - by keepitnang
    I'm attempting to get to grips with displaying filterable MySQL data within a PHP page based on user checkbox selections. I have a database of domain names and the dates on which these will require renewal as per Nominet DAC information and I can get unfiltered data to display, but filtering results by domain extensions is proving tricky for me to accomplish. I should point out at this stage that I am a serious newcomer to many of the ideas I am trying to learn to work with here, so please be gentle. I have tried following some other articles on here also, but no dice. I have the following so far: HTML <input type="checkbox" class="extensions" name="extensions" value=".co.uk">.co.uk</input> <input type="checkbox" class="extensions" name="extensions" value=".org.uk">.org.uk</input> Script $('.extensions').live('click', function() { var all_boxes = $('.extensions'); var all_boxes_values = []; var i = 0; for (var i; i < all_boxes.length; i++) { if (all_boxes[i].checked) { all_boxes_values.push(all_boxes[i].value) } } var all_boxes_values_clean = all_boxes_values.join(", "); console.log(all_boxes_values_clean); $.get("sql-test.php", {q: all_boxes_values_clean}, function(result) { $("div#output").html(result); } )}); PHP $g = $_GET['q']; $extensionsql=""; $extension=1; if(isset($g)) { $extension=1; $param = "" . str_replace(",", "','", $_GET['q']) . ""; } And that's as far as I have gotten with my limited ability. What I would like to do next is search the column domainName for a string match and return the appropriate results to the user. Something to mimic something like the following but I'm not sure how to achieve it. Any help would be much appreciated: SELECT * FROM `refresh` WHERE `domainName` LIKE '%.co.uk%' AND renewalDate LIKE '%2012-06-30%' ORDER BY `domainName` ASC Thanks

    Read the article

  • Including Data From DropDownList Into Gridview

    - by Mike Keller
    I feel a little embarassed posting two questions relating to the same problem, but the first one ended up answering a question that I believe is unrelated to the solution so I'm leaving it up and outlining what I'm trying to accomplish with the hopes that someone can help out a .Net noob. What I need to be able to do is create a field in my gridview that contains a link that passes two variables. One is pulled from within the gridviews datasource and the other needs to be pulled from a textbox control outside the gridview. From what I've read so far you cannot use a hyperlinkfield for this as the datanavigateurlfields cannot be set to pull from anything but the gridview's data source. What I attempted to do was create a template field where in the itemtemplate I called: <a href="example.aspx?e=<%# Eval(ExampleList.SelectedItem.Value) %>">Test</a> That comes back with an error like this: DataBinding: 'System.Data.DataRowView' does not contain a property with the value 'TestData' Any clues to make this happen would be appreciated, like I said I'm pretty new to .Net so please be gentle. I tried to do my homework before posting this.

    Read the article

  • How do I add a where filter using the original Linq-to-SQL object in the following scenario

    - by GenericTypeTea
    I am performing a select query using the following Linq expression: Table<Tbl_Movement> movements = context.Tbl_Movement; var query = from m in movements select new MovementSummary { Id = m.DocketId, Created = m.DateTimeStamp, CreatedBy = m.Tbl_User.FullName, DocketNumber = m.DocketNumber, DocketTypeDescription = m.Ref_DocketType.DocketType, DocketTypeId = m.DocketTypeId, Site = new Site() { Id = m.Tbl_Site.SiteId, FirstLine = m.Tbl_Site.FirstLine, Postcode = m.Tbl_Site.Postcode, SiteName = m.Tbl_Site.SiteName, TownCity = m.Tbl_Site.TownCity, Brewery = new Brewery() { Id = m.Tbl_Site.Ref_Brewery.BreweryId, BreweryName = m.Tbl_Site.Ref_Brewery.BreweryName }, Region = new Region() { Description = m.Tbl_Site.Ref_Region.Description, Id = m.Tbl_Site.Ref_Region.RegionId } } }; I am also passing in an IFilter class into the method where this select is performed. public interface IJobFilter { int? PersonId { get; set; } int? RegionId { get; set; } int? SiteId { get; set; } int? AssetId { get; set; } } How do I add these where parameters into my SQL expression? Preferably I'd like this done in another method as the filtering will be re-used across multiple repositories. Unfortunately when I do query.Where it has become an IQueryable<MovementSummary>. I'm assuming it has become this as I'm returning an IEnumerable<MovementSummary>. I've only just started learning LINQ, so be gentle.

    Read the article

  • Isotope.js help: Changing item image after sorting

    - by user3643081
    This is a general question on how to go about building a project I have in mind, and the best way to set off on the right foot. I am fairly new to JS, please be gentle. I want to use isotope.js (or a similar script) to display a page with multiple items (about 30 different plants found in a garden) and the ability to sort them by seasons of the year + "what is most beautiful now" + and "view all" (a total of 6 categories) . On load, or when sorted by either "what is beautiful now" or "view all", I need each item to reflect the image of the current season we are in. When sorted by season, I need those "current" images to switch over to a designated seasonal image of that plant. Therefore, each sortable item will ultimately have 4 different versions with 4 different images in the background ready to surface when plants are sorted. (perhaps 5 if it makes more sense to have a "current" version besides the 4 seasonal versions.) My question: what approach can I take to achieve this effect in a manageable way? Can isotope apply a class to items sorted? Assuming it can: Should each item have 4 inline images, each with a css class, that I then control by using display:inline; and display:none; properties from my stylesheets? (I worry that this approach would significantly increase load times) Would it make more sense to create a blank dummy div who's background I control similarly to the example above -relying mostly on CSS. Or is there some other way involving JS I am overlooking? Any help would be appreciated. Examples of what you suggest would be immensely helpful.

    Read the article

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