Search Results

Search found 2396 results on 96 pages for 'alex nauda'.

Page 73/96 | < Previous Page | 69 70 71 72 73 74 75 76 77 78 79 80  | Next Page >

  • Reference table values in a war against magic numbers

    - by Alex N.
    This question bugged me for years now and can't seem to find good solution still. I working in PHP and Java but it sounds like this maybe language-agnostic :) Say we have a standard status reference table that holds status ids for some kind of entity. Further let's assume the table will have just 5 values, and will remain like this for a long time, maybe edited occasionally with addition of a new status. When you fetch a row and need to see what status it is you have 2 options(as I see it at least) - put it straight ID values(magic numbers that is) or use a named constant. Latter seem much cleaner, the question though is where those named constants should leave? In a model class? In a class that uses this particular constant? Somewhere else?

    Read the article

  • Search-friendly way to store checkbox values in MySQL?

    - by Alex
    What is a search-friendly way to store checkbox values in the database? Currently, checkboxes are processed as an array and values are separated by a ";" As such: <input type="checkbox" name="frequency[]" value="Daily"/> Daily <input type="checkbox" name="frequency[]" value="Weekly"/> Weekly <input type="checkbox" name="frequency[]" value="Monthly"/> Monthly The PHP backend runs implode(';', $frequency) and adds the string to the database. This works fine but it's a nightmare when it comes to searching. Is there a better way to approach this?

    Read the article

  • Scan site for images and alt tags

    - by Alex
    We'd like to run an scan on our site that returns a report with the following: each image tag found and a visual representation of that image on the report the alt tag for that image (also identify if an alt tag not found) Is there a simple tool that does this? We're attempting to check for alt tags, and make sure the alt tags accurately describe to the image they represent. That's why the visual representation in the report is important.

    Read the article

  • I have a bunch of template parameters that I want to hide from my users. How can I do this?

    - by Alex
    I have a superclass which is defined in terms of a few internal types it uses. Subclassing is performed as so: template <class InternalType1, class InternalType2> class Super { ... } class Sub : Super <interalTypeClass1, interalTypeClass2> { ... } But when I want to write a function that takes a pointer to the superclass, this happens : template <class InternalType1, class InternalType2> void function(Super<InternalType1, InternalType2>* in) { ... } The user really shouldn't know anything about the inside classes, and should really just concern himself with the use of the function. Some of these template lists become very very large, and expecting the user to pass them every time is wasteful, in my opinion. Any suggestions? EDIT: The function needs to know the internal types in use, so unless there is a way to access template types at compile time, I think there is no solution? Potential solution: Have each class do the following: #define SubTemplateArgs <SubTypeName, SubInternalType1, SubInternalType2> ?

    Read the article

  • How does one go about writing a virtual MIDI interface?

    - by Alex
    I want to do some funky things with controlling MIDI streams, and I'd like to be able to pipe MIDI input into an application like Ableton or Reason. Presumably this involves some sort of driver level work? Ultimately I'd like to write my application in Python, so if there is some Python-based solution, I'd consider it. I'm perfectly fine with using C/C++, though, so that's not a problem.

    Read the article

  • How can I write this Table Valued Function as a Stored Procedure?

    - by Alex
    I have the following TVF for fulltext search: FUNCTION [dbo].[Fishes_FullTextSearch] (@searchtext nvarchar(4000), @limitcount int) RETURNS TABLE AS RETURN SELECT * FROM Fishes INNER JOIN CONTAINSTABLE(Fishes, *, @searchtext, @limitcount) AS KEY_TBL ON Fishes.Id = KEY_TBL.[KEY] When I'm using this TVF, it doesn't return a collection of objects of type Fish (which I want!) - instead LINQ creates a new result type which includes all "Fish" fields and the fields Key and Rank. In another question, it was suggested that I rewrite this TVF into a stored procedure for it to return Fish objects only. Can someone help me do this please? Also, it needs to be ordered by Rank. Thank you!

    Read the article

  • jQuery slideUp and slideDwon issues

    - by Alex
    I need the classes 'two and three' to be hidden as soon as the page load and than be able to click again on the menu to slide it down, I am having probles with the following code: $(document).ready(function() { $('.two, .three').slideUp('slow'); $('.active_wrapper').click(function(){ $('.two, .three').slideDown('slow'); }); }); HTML <div class="nav_wrapper"> <div class="active_wrapper one"><a class="active" href="">home</a></div> <div class="two"><a href="about.html">about</a></div> <div class="three"><a href="project.html">project</a></div> </div>

    Read the article

  • In Python, how do I decode GZIP encoding?

    - by alex
    I downloaded a webpage in my python script. In most cases, this works fine. However, this one had a response header: GZIP encoding, and when I tried to print the source code of this web page, it had all symbols in my putty. How do decode this to regular text?

    Read the article

  • script only works in IE

    - by Alex
    I have the following JavaScript for show running line: <script type="text/javascript" language="javascript"> //Change script's width (in pixels) var marqueewidth=800 //Change script's height (in pixels, pertains only to NS) var marqueeheight=20 //Change script's scroll speed (larger is faster) var speed=3 //Change script's contents var marqueecontents='You text here' if (document.all) document.write('<marquee scrollAmount='+speed+' style="width:'+marqueewidth+'">'+marqueecontents+'</marquee>') function regenerate(){ window.location.reload() } function regenerate2(){ if (document.layers){ setTimeout("window.onresize=regenerate",450) intializemarquee() } } function intializemarquee(){ document.cmarquee01.document.cmarquee02.document.write('<nobr>'+marqueecontents+'</nobr>') document.cmarquee01.document.cmarquee02.document.close() thelength=document.cmarquee01.document.cmarquee02.document.width scrollit() } function scrollit(){ if (document.cmarquee01.document.cmarquee02.left>=thelength*(-1)){ document.cmarquee01.document.cmarquee02.left-=speed setTimeout("scrollit()",100) } else{ document.cmarquee01.document.cmarquee02.left=marqueewidth scrollit() } } window.onload=regenerate2 </script> What should I change in script to make it work in FF and Chrome? Thanks

    Read the article

  • Tool that auto-generate a code for accesing a xml-file

    - by alex
    My application have a configuration xml-file. That file contains more than 50 program settings. At the present time I read and save each program setting separately. I guess It is not effi?iently for such tasks. I need something that can auto-generate a code for load and save my program settings using predefined xml-schema. I found a dataset in Add New Item dialog. Unfortunately, i cannot add new code to dataset1 such as events in set-accessors of properties because of this // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. Maybe, there is a tool that allows a user to generate a wrapper for accesing a xml-file ? Such as DataSet1, but with availability to add events.

    Read the article

  • How do I configure emacs speedbar for C# mode?

    - by Alex B
    I'm using emacs with C# Mode and when I turn on the speedbar, no files show up by default. I can choose "show all files" on the speedbar mode, but then every .cs file shows up with a '[?]' next to the name. How do I properly configure speedbar so it shows up with .cs files by default? How do I get the '[+]' next to each file so I can navigate inside the file?

    Read the article

  • How do you make a wrapped div fill the window horizontally?

    - by Alex Parkinson
    I have a div which is contained by another 960px-wide centered div. I'm adding a background to the inner div which should expand all the way to the window's edges horizontally, essentially escaping the boundaries of its container. If I apply a large negative margin and equal amount of padding, this works on the left side, but the right side causes a scroll bar to appear. Does anyone know how I can achieve this without causing scroll bars?

    Read the article

  • Returning EF entities using WCF - Read only web service / public API

    - by alex
    I'm currently migrating an application from Linq-to-SQL & ASP.net Web Services (asmx) to Entity Framework and WCF. My question is, I have a bunch of POCO classes which i have xml mapping files for (for the linq to sql) I've replaced my linq to sql with an entity framework data model I've got an interface - something like IService - that has all the methods on it that i need my service to implement - for example: Product[] GetProductsByKeyword(string keyword); In the above case, Product is a POCO. I now have them as entities within my ef data model - i'm using .net 4, and could take advantage of poco support, but don't really see the need - This service is strictly read only. What's the best way of returning entities in my WCF service? I want it to support other client platforms, not just .net (so php guys could use it)

    Read the article

  • Jquery ui Datepicker, showing next month.

    - by Alex
    I wonder how to set next month with showing only mondays active: i tried to do smth like that but it wont work function onlyMondaysNextMonth(date){ var day = date.getDay(); var mDate = date.getMonth() + 1; return { minDate: mDate, } return [(day == 1),'']; } Thank you.

    Read the article

  • How to write specific application for facebook?

    - by alex
    Hi there! Please help me with documentation to write specific application for Facebook. Need to know, what language to choose? is specific facebook API? is documentation for API? is site with samples catalogue? need to know all related info. Some words about app, it would be app, which compare users interests. Thanks in advance.

    Read the article

  • Access to the path Server.MapPath is denied

    - by Alex
    I created one pdf document var document = new Document(); string path = Server.MapPath("AttachementToMail"); PdfWriter.GetInstance(document, new FileStream(path + "/"+DateTime.Now.ToShortDateString()+".pdf", FileMode.Create)); Now I want to download this document Response.ContentType = "Application/pdf"; Response.AppendHeader("Content-Disposition", "attachment; filename="+ DateTime.Now.ToShortDateString() + ".pdf" + ""); Response.TransmitFile(path); Response.End(); but it gave me error Access to the path '~\AttachementToMail' is denied. read / write access for IIS_IUSRS exists

    Read the article

  • How can I identify an element from a list within another list

    - by Alex
    I have been trying to make a block of code that finds the index of the largest bid for each item. Then I was going to use the index as a way to identify the person who paid that much moneys name. However no matter what i try I can't link the person and what they have gained from the auction together. Here is the code I have been writing: It has to be able to work with any information inputted def sealedBids(): n = int(input('\nHow many people are in the group? ')) z = 0 g = [] s = [] b = [] f = [] w = []#goes by number of items q = [] while z < n: b.append([]) z = z + 1 z = 0 while z < n: g.append(input('Enter a bidders name: ')) z = z + 1 z = 0 i = int(input('How many items are being bid on?')) while z < i: s.append(input('Enter the name of an item: ')) w.append(z) z = z + 1 z = 0 for j in range(n):#specifies which persons bids your taking for k in range(i):#specifies which item is being bid on b[j].append(int(input('How much money has {0} bid on the {1}? '.format(g[j], s[k])))) print(' ') for j in range(n):#calculates fair share f.append(sum(b[j])/n) for j in range(i):#identifies which quantity of money was the largest for each item for k in range(n): if w[j] < b[k][j]: w[j] = b[k][j] q.append(k) any advice is much appreciated.

    Read the article

  • Why doesn't my javascript work after AJAX filling the HTML?

    - by alex
    $.ajax({ method:"get", url:"/details/", data:"id="+id, beforeSend:function(){ }, success:function(html){ $("#holder").html(html); } }); After I fill a div with a HTML from an AJAX call, this is my javascript at the top of /details/ <script type="text/javascript"> alert('hi'); </script> MY DETAILS HTML CONTENT GOES HERE But it's not working

    Read the article

  • How to call a generic method with an anonymous type involving generics?

    - by Alex Black
    I've got this code that works: def testTypeSpecialization = { class Foo[T] def add[T](obj: Foo[T]): Foo[T] = obj def addInt[X <% Foo[Int]](obj: X): X = { add(obj) obj } val foo = addInt(new Foo[Int] { def someMethod: String = "Hello world" }) assert(true) } But, I'd like to write it like this: def testTypeSpecialization = { class Foo[T] def add[X, T <% Foo[X](obj: T): T = obj val foo = add(new Foo[Int] { def someMethod: String = "Hello world" }) assert(true) } This second one fails to compile: no implicit argument matching parameter type (Foo[Int]{ ... }) = Foo[Nothing] was found. Basically: I'd like to create a new anonymous class/instance on the fly (e.g. new Foo[Int] { ... } ), and pass it into an "add" method which will add it to a list, and then return it The key thing here is that the variable from "val foo = " I'd like its type to be the anonymous class, not Foo[Int], since it adds methods (someMethod in this example) Any ideas? I think the 2nd one fails because the type Int is being erased. I can apparently 'hint' the compiler like this: def testTypeSpecialization = { class Foo[T] def add[X, T <% Foo[X]](dummy: X, obj: T): T = obj val foo = add(2, new Foo[Int] { def someMethod: String = "Hello world" }) assert(true) }

    Read the article

  • Best Practice for Exporting an App's Data to XML via PHP/MySQL?

    - by Alex Cook
    I have an a business app and I want to give my users the ability to export their data at anytime. I'm aware that I can write an XML file semi-manually by doing something like this: http://www.kirupa.com/web/mysql_xml_php.htm But, I thought I'd ask if this is the best practice? Or is there some framework I can use to do this more easily/quickly? Maybe there isn't - it won't be too hard to do it the above way. Also, less importantly - XML is the best format to export to, right? Thanks in advance.

    Read the article

  • When do you use Java's @Override annotation and why?

    - by Alex B
    What are the best practices for using Java's @Override annotation and why? It seems like it would be overkill to mark every single overridden method with the @Override annotation. Are there certain programming situations that call for using the @Override and others that should never use the @Override?

    Read the article

  • Set the amount of rows JList show (Java)

    - by Alex Cheng
    Hi all. Problem: I have a method that creates a list from the parsed ArrayList. I manage to show the list in the GUI, without scrollbar. However, I am having problem setting it to show only the size of ArrayList. Meaning, say if the size is 6, there should only be 6 rows in the shown List. Below is the code that I am using. I tried setting the visibleRowCount as below but it does not work. I tried printing out the result and it shows that the change is made. private void createSuggestionList(ArrayList<String> str) { int visibleRowCount = str.size(); System.out.println("visibleRowCount " + visibleRowCount); listForSuggestion = new JList(str.toArray()); listForSuggestion.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); listForSuggestion.setSelectedIndex(0); listForSuggestion.setVisibleRowCount(visibleRowCount); System.out.println(listForSuggestion.getVisibleRowCount()); listScrollPane = new JScrollPane(listForSuggestion); MouseListener mouseListener = new MouseAdapter() { @Override public void mouseClicked(MouseEvent mouseEvent) { JList theList = (JList) mouseEvent.getSource(); if (mouseEvent.getClickCount() == 2) { int index = theList.locationToIndex(mouseEvent.getPoint()); if (index >= 0) { Object o = theList.getModel().getElementAt(index); System.out.println("Double-clicked on: " + o.toString()); } } } }; listForSuggestion.addMouseListener(mouseListener); textPane.add(listScrollPane); repaint(); } To summarize: I want the JList to show as many rows as the size of the parsed ArrayList, without a scrollbar. Any ideas? Please help. Thanks. Please let me know if a picture of the problem is needed in case I did not phrase my question correctly.

    Read the article

< Previous Page | 69 70 71 72 73 74 75 76 77 78 79 80  | Next Page >