Daily Archives

Articles indexed Tuesday March 30 2010

Page 26/126 | < Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >

  • c# create an arbitrary length generic parameter string e.g. ?,?,?

    - by Sky Sanders
    I know I am forgetting to remember how to do this and it is late. I want to, in an elegant manner, build a placeholder list for a munged sql command. Have a command with an arbitrary number of parameters, need to build ?,?,? Did I mention that it was a wet brain fart? this is what came out: Regex.Replace(new string('?', _command.Parameters.Count), @"\?\?", @"\?,\?"); You are welcome to make me feel like more of an idiot if you just remember me what I am forgetting. ;-)

    Read the article

  • Simple stupid foreach loop question

    - by user281180
    In the code below i`m trying to read a list of selected projects and a list of all projects available. I want to store the all the projects that have not been selected from the list of all projects. But with the code below, I`m having list of all projects...Where and how to break the second loop incase projectId.Value == selectedProjectId.Value ? public IEnumerable NotselectedProjects; public IEnumerable NotSelectedProjects() { if (this.NotselectedProjects == null) { List<SelectListItem> result = new List<SelectListItem>(); foreach (var selectedProjectId in selectedProjects) { foreach (var projectId in projectLists) { if (projectId.Value != selectedProjectId.Value) { result.Add(new SelectListItem { Selected = false, Text = projectId.Text, Value = projectId.Value }); this.NotselectedProjects = result.AsEnumerable(); } } } } return this.NotselectedProjects; }

    Read the article

  • Implementing database redundancy with sharded tables

    - by ensnare
    We're looking to implement load balancing by horizontally sharding our tables across a cluster of servers. What are some options to implement live redundancy should a server fail? Would it be effective to do (2) INSERTS instead of one ... one to the target shard, and another to a secondary shard which could be accessed should the primary shard not respond? Or is there a better way? Thanks.

    Read the article

  • Install the proper bitness Visual C++ Runtime Library via a Setup project

    - by chiru_valentin
    Hi all! The context: I have a solution that contains amongh other C# projects, a VC++ project that suports compiling only as x64 or Win32 (but not Any CPU). In order for the application (which in fact is a macro for a third party application) to run, it requires Visual C++ Runtime libraries (x86) or (x64) (The macro will run on both x64 and x86 operating systems.) The problem: I want to create a Visual Studio setup project that would install the macro on both x86 and x64 operating systems, and the problem I have is to specify what Visual C++ Runtime library to use a prerequisite. If both are selected (x64 and x86) than I have a runtime error message when running the setup.exe, as on x86 operating systems you cannot run x64 executables like the Visual C++ Runtime libraries (x64) kit is...(which the setup calls in the back). So I would need a bitness condition, or something like that to tell the setup what bitness version of the Visual C++ Runtime library to try to install...I'm not sure if this is possible, or even where such a code should be placed in the setup. Thank you for the support, Vali

    Read the article

  • How to get a particular part of a String

    - by Harish
    I am writing a macro in Excel where I need to get a substring from a String. Its like this. ~/tester/test/hai/bye ~/stack/overflow/hai/bye In the above cases I need to take the String tester from the first one and stack from the second one.I tried using the Instr but its not useful.Can anyone help this?

    Read the article

  • Problem making ant compile my classes present in different Eclipse projects into single destination

    - by KCore
    I have close to about 20 projects in my Eclipse workspace. They are interdependent. Now I want to build all of them in a single war file. The thing is eclipse does it nicely... if I create a Dynamic Web Project and link sources of all the 20 projects. But I want to automate the entire process and want to be able to run a script (ant maybe..) and deploy a war in my app server. My approach: I started with a simple approach. I tried to sequentially build each project (javac task) with destination directory as web-inf of my war. But it is giving me weird errors like : package " ** " not found,when it shows the same all the required classes in classpath (I used verbose) Do you think, a continous integration engine will be better for my case (20 projects..) I saw Team City, but didnt get it the first time...

    Read the article

  • How to detect if Asp.Net form is valid

    - by Hasan Gürsoy
    Hi, I have a form which is in an updatePanel and I have a span with hidden loading image, which I want to show when user clicks to submit button but I first need to check if page is valid on client side. Also I'm making loading span visible with jQuery. Here is my code: <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script> <script type="text/javascript"> function showLoading() { $('#loader').show(); } </script> </head> <body> <asp:ScriptManager ID="smMain" runat="server"></asp:ScriptManager> <asp:UpdatePanel ID="upForm" runat="server"> <ContentTemplate> <asp:MultiView ID="mvContact" runat="server" ActiveViewIndex="0"> <asp:View ID="vDefault" runat="server"> <asp:TextBox ID="tEMail" runat="server" CssClass="input" /> <asp:RequiredFieldValidator ID="rfvEMail" runat="server" ControlToValidate="tEMail" ErrorMessage="* required" Display="Dynamic" /> <asp:RegularExpressionValidator ID="revEMail" runat="server" ControlToValidate="tEMail" ErrorMessage="* invalid" Display="Dynamic" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" /> <asp:ImageButton ID="btnSubmit" runat="server" ImageUrl="~/Assets/Images/btnSubmit.png" ToolTip="Submit Form" style="margin:5px 5px 0 -5px" onclick="btnSubmit_Click" OnClientClick="showLoading();" /> <span id="loader"><img src="Assets/Images/loader.gif" title="Sending..." /></span> </asp:View> <asp:View ID="vResult" runat="server"> <div class="result"> <span id="lResult" runat="server">Your message is sent</span> </div> </asp:View> </asp:MultiView> </ContentTemplate> </asp:UpdatePanel> </body></html>

    Read the article

  • Rails performance tests "rake test:benchmark" and "rake test:profile" give me errors

    - by go minimal
    I'm trying to run a blank default performance test with Ruby 1.9 and Rails 2.3.5 and I just can't get it to work! What am I missing here??? rails testapp cd testapp script/generate scaffold User name:string rake db:migrate rake test:benchmark - /usr/local/bin/ruby19 -I"lib:test" "/usr/local/lib/ruby19/gems/1.9.1/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/performance/browsing_test.rb" -- --benchmark Loaded suite /usr/local/lib/ruby19/gems/1.9.1/gems/rake-0.8.7/lib/rake/rake_test_loader Started /usr/local/lib/ruby19/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:105:in `rescue in const_missing': uninitialized constant BrowsingTest::STARTED (NameError) from /usr/local/lib/ruby19/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:94:in `const_missing' from /usr/local/lib/ruby19/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/testing/performance.rb:38:in `run' from /usr/local/lib/ruby19/1.9.1/minitest/unit.rb:415:in `block (2 levels) in run_test_suites' from /usr/local/lib/ruby19/1.9.1/minitest/unit.rb:409:in `each' from /usr/local/lib/ruby19/1.9.1/minitest/unit.rb:409:in `block in run_test_suites' from /usr/local/lib/ruby19/1.9.1/minitest/unit.rb:408:in `each' from /usr/local/lib/ruby19/1.9.1/minitest/unit.rb:408:in `run_test_suites' from /usr/local/lib/ruby19/1.9.1/minitest/unit.rb:388:in `run' from /usr/local/lib/ruby19/1.9.1/minitest/unit.rb:329:in `block in autorun' rake aborted! Command failed with status (1): [/usr/local/bin/ruby19 -I"lib:test" "/usr/l...]

    Read the article

  • print individual tables ??

    - by LiveEn
    I am getting values from a database and displaying in a table. Im trying to print the results as individual . Im using the below javascript <script type="text/javascript"> function print_parent(element) { element.parentNode.className = 'print'; window.print(); element.parentNode.className = ''; return false; } </script> The problem that i have is when i try to print all the results it works great.can some one please tell me how can i print each individual table in each result please? below is my php code $sql="select * from cisdb where pids LIKE '%$pids%'"; $result=mysql_query($sql) or die(mysql_error()); if (mysql_num_rows($result)==0) { echo '<b><center>There was no records !</center></b>'."<br>"; } while ($row=mysql_fetch_array($result)) { $cat=str_replace('+', ' ', $row['category']); print "<center>"; print "<table width='472' border='1' align='center' class='noprint'>"; print "<tr>"; print "<td width='150'><div align='center'><a href='#' onclick='return print_parent(this)'>Print</a> </div></td>"; print "<td width='150'><div align='center'><a href='process.php?mode=ed&id={$row['id']}'>Edit</div></td>"; print "<td width='150'><div align='center'><a href='process.php?mode=del&id={$row['id']}' onclick='return confirm('Are you sure you want to delete?')'>Delete</a></div></td>"; print "</tr>"; print "</table><br>"; print "<div id='divToPrint'>"; print"<table width=700 style=height:900 border=1 cellpadding=1 cellspacing=1 bordercolor=#D6D6D6 class=sss title={$row['title']}> <tr> <td height=25 colspan=2 align=left valign=top><strong>Customer:{$row['name']}</strong></td> <td width=183 align=left valign=top><strong>Sales ID:{$row['said']} </strong></td> <td width=100 align=left valign=top><strong>Phone Cord. ID:{$row['pcid']}</strong></td> <td align=left valign=top><strong>Type:{$row['classtype']}</strong></td> </tr> <tr> <td height=25 colspan=2 valign=top><strong>Contact Name: </strong></td> <td colspan=2 valign=top><strong>Email:</strong></td> <td width=154 valign=top><strong>Phone:</strong></td> </tr <tr> <td height=15 colspan=5 valign=top><strong>Remarks:</strong></td> </tr> <tr> <td height=15 colspan=2 valign=top><strong>Date Added: </strong></td> <td valign=top><strong>Date Edited : </strong></td> <td colspan=2 valign=top><strong>Printed : </strong></td> </tr> </table></div><br>"; print "</center>"; }

    Read the article

  • Core data many-to-many relationship - Predicate question

    - by Garry
    In my Core Data model I have two entities: List and Patient. List has an attribute called 'name'. A List can have any number of Patients and each Patient can belong to any number of different lists. I have therefore set a relationship on List called 'patients' that has an inverse to-many relationship to Patient AND a relationship on Patient called 'lists' that has a to-many relationship to List. What I'm struggling to figure out is how to create a Predicate that will select all Patients that belong to a particular List name. How would I go about this? I have never used relationships before in Core Data. Thanks,

    Read the article

  • calling a stored proc over a dblink

    - by neesh
    I am trying to call a stored procedure over a database link. The code looks something like this: declare symbol_cursor package_name.record_cursor; symbol_record package_name.record_name; begin symbol_cursor := package_name.function_name('argument'); loop fetch symbol_cursor into symbol_record; exit when symbol_cursor%notfound; -- Do something with each record here, e.g.: dbms_output.put_line( symbol_record.field_a ); end loop; CLOSE symbol_cursor; When I run this from the same DB instance and schema where package_name belongs to I am able to run it fine. However, when I run this over a database link, (with the required modification to the stored proc name, etc) I get an oracle error: ORA-24338: statement handle not executed. The modified version of this code over a dblink looks like this: declare symbol_cursor package_name.record_cursor@db_link_name; symbol_record package_name.record_name@db_link_name; begin symbol_cursor := package_name.function_name@db_link_name('argument'); loop fetch symbol_cursor into symbol_record; exit when symbol_cursor%notfound; -- Do something with each record here, e.g.: dbms_output.put_line( symbol_record.field_a ); end loop; CLOSE symbol_cursor;

    Read the article

  • Website Success Strategies For Service Providers

    There is a big market for a variety of services that can be delivered online. In fact, one of the fastest ways to generate income with an online business is to offer a service. Examples of successful online service businesses include graphic design, virtual assistance, web content writing, life coaching and marketing consultation.

    Read the article

  • How to Enable “Always use the selected program to open this kind of file” Option in Open With Dialog

    - by lm
    Hello, How can I enable “Always use the selected program to open this kind of file” pption in Open With dialog box? I already checked following registry entries: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer Value of "NoFileAssociate" Set to 0 ( as reccomended on Microsoft site ) HKEY_CLASSES_ROOT\Unknown\shell\openas\command Value of "Default" set to %SystemRoot%\system32\rundll32.exe %SystemRoot%\system32\shell32.dll,OpenAs_RunDLL %1 What else should cause the “Always use the selected program to open this kind of file” option to be disabled? Your help will be very valuable Thanks

    Read the article

  • Android Emulator starting in Flight-Mode

    - by Andhravaala
    Hi All, I have a small issue. I am running my application in emulator. For that it requires Network to simulate some traffic. But sometimes, on start-up my emulator is starting in Flight Mode. I am did not found any flags or settings to make it not to go to Flight-Mode. Can any one help me, if come across similar problem. Note: It is not a trivial issue, but it is making work difficult to start the emulator multiple times.

    Read the article

  • Using Linq, how to separate a list in to grouped objects by name?

    - by Dr. Zim
    I have a table where a record looks like this varchar(255) Name varchar(255) Text varchar(255) Value Name is the DDL name, Text is what is displayed, and Value is returned upon selection. There are between one and twenty options for each Name. Without iterating though each option like a cursor, is there any way to pull out a list of objects, one for each unique DDL Name, using Linq and C#? A sample of the data: Beds '4 (10)' 4 Beds '5 (1)' 5 Beds '7 (1)' 7 Baths 'NA (13)' NULL Baths '0 (1)' 0 Baths '1 (13)' 1 I was thinking about doing an outer select to get the unique Names, then an inner select to get the list of options for it, then return the set as a List of a set of Lists.

    Read the article

  • gtk-button-images setting not working.

    - by PP
    When i try to set this property I am getting run time error, GtkSettings *settings; settings = gtk_settings_get_default(); g_object_set(G_OBJECT(settings), "gtk-button-images", TRUE, NULL); Error: (App:5191): GLib-GObject-WARNING **: IA__g_object_set_valist: object class `GtkSettings' has no property named `gtk-button-images' Why this might be happening? i am also using rc file with this.

    Read the article

  • how get value from smartgwt Custom FilterEditorType ?

    - by Ehsan Khodarahmi
    Hi I've developed a custom widget (a persian calendar consist of a base textbox & image widget on a gwt grid which look likes smartgwt calendar) & putted it in a CanvasItem because i want to add it as a filter editor for a listGrid : ListGridField regDateTimeField = new ListGridField("regDateTime", ????? ? ????", 120"); regDateTimeField.setFilterEditorType(new PersianCalendarItem()); now list grid displays it successfully, but when i click on filter button, nothing happend even when it value changes. I think i have to override some canvas item methods to return internal textbox value, but i don't know how should i do this ???

    Read the article

< Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >