Search Results

Search found 959 results on 39 pages for 'george kas'.

Page 29/39 | < Previous Page | 25 26 27 28 29 30 31 32 33 34 35 36  | Next Page >

  • MySQL table with similar column info - HELP!!!

    - by George Garman
    I have a DB with a table that is named "victim". The form that dumps the info into the table has room for two victims and therefore there is vic1_fname, vic1_lname, vic2_fname, vic2_lname, etc.. (business name, person first, person last, address, city, state, zip) a "1" and "2" of each. Now I want to search the DB and locate listed victims. This is what I have so far: $result = mysql_query( "SELECT victim.* FROM victim WHERE vic1_business_name OR vic2_business_name LIKE '%$search_vic_business_name%' AND vic1_fname OR vic2_fname LIKE '%$search_vic_fname%' AND vic1_lname OR vic2_lname LIKE '%$search_vic_lname%' AND vic1_address OR vic2_address LIKE '%$search_vic_address%' AND vic1_city OR vic2_city LIKE '%$search_vic_city%' AND vic1_state OR vic2_state LIKE '%$search_vic_state%' AND vic1_dob OR vic2_dob LIKE '%$search_vic_dob%' "); <table width="960" style="border: groove;" border=".5"> <tr><th colspan=10>You search results are listed below:</th></tr> <tr> <th>Case Number</th> <th>Business Name</th> <th>First Name</th> <th>Last Name</th> <th>DOB / Age</th> <th>Address</th> <th>City</th> <th>State</th> </tr> <?php while($row = mysql_fetch_array($result)) { ?> <tr> <td align="center"><?php print $row['vic_business_name']; ?></td> <td align="center"><?php print $row['vic_fname']; ?></td> <td align="center"><?php print $row['vic_lname']; ?></td> <td align="center"><?php print $row['vic_dob']; ?></td> <td align="center"><?php print $row['vic_adress']; ?></td> <td align="center"><?php print $row['vic_city']; ?></td> <td align="center"><?php print $row['vic_state']; ?></td> </tr> <?php } ?> </table> The info did not display in the table until I changed the table to this: <tr> <td align="center"><?php print $row['vic1_business_name']; ?></td> <td align="center"><?php print $row['vic1_fname']; ?></td> <td align="center"><?php print $row['vic1_lname']; ?></td> <td align="center"><?php print $row['vic1_dob']; ?></td> <td align="center"><?php print $row['vic1_adress']; ?></td> <td align="center"><?php print $row['vic1_city']; ?></td> <td align="center"><?php print $row['vic1_state']; ?></td> </tr> <tr> <td align="center"><?php print $row['vic2_business_name']; ?></td> <td align="center"><?php print $row['vic2_fname']; ?></td> <td align="center"><?php print $row['vic2_lname']; ?></td> <td align="center"><?php print $row['vic2_dob']; ?></td> <td align="center"><?php print $row['vic2_adress']; ?></td> <td align="center"><?php print $row['vic2_city']; ?></td> <td align="center"><?php print $row['vic2_state']; ?></td> </tr> Now it displays both rows, even if its empty. It doesn't matter if the victim was listed originally as vic1 or vic2, i just want to know if they are a victim. I hope this makes sense. I can't get it to display the way I want, line-by-line, irregardless of whether you are vic1 or vic2.

    Read the article

  • <Control>.Focus() from server side doesn't scroll into view

    - by George
    Custom Validation Control: <asp:CustomValidator ID="valSex" runat="server" ErrorMessage="1.2 &lt;b&gt;Sex&lt;/b&gt; not specified" EnableClientScript="true" ClientValidationFunction="ValidateSex" SetFocusOnError="True">Selection required</asp:CustomValidator> Client Side validation routine: function ValidateSex(source, args) { var optMale = document.getElementById("<%=optMale.ClientID %>"); var optFemale = document.getElementById("<%=optFemale.ClientID %>"); if (!optMale.checked && !optFemale.checked) { args.IsValid = false; optMale.focus(); } else args.IsValid = true; } When the page is submitted and Sex is not specified, focus is set but the 2 radio buttons are not quite in view, vertical scrolling is required to bring them into view. Shouldn't the Focus() method have brought the focus control into view?

    Read the article

  • [SOLVED]Django - Passing variables to template based on db

    - by George 'Griffin
    I am trying to add a feature to my app that would allow me to enable/disable the "Call Me" button based on whether or not I am at [home|the office]. I created a model in the database called setting, it looks like this: class setting(models.Model): key = models.CharField(max_length=200) value = models.CharField(max_length=200) Pretty simple. There is currently one row, available, the value of it is the string True. I want to be able to transparently pass variables to the templates like this: {% if available %} <!-- Display button --> {% else %} <!-- Display grayed out button --> {% endif %} Now, I could add logic to every view that would check the database, and pass the variable to the template, but I am trying to stay DRY. What is the best way to do this? UPDATE I created a context processor, and added it's path to the TEMPLATE_CONTEXT_PROCESSORS, but it is not being passed to the template def available(request): available = Setting.objects.get(key="available") if open.value == "True": return {"available":True} else: return {} UPDATE TWO If you are using the shortcut render_to_response, you need to pass an instance of RequestContext to the function. from the django documentation: If you're using Django's render_to_response() shortcut to populate a template with the contents of a dictionary, your template will be passed a Context instance by default (not a RequestContext). To use a RequestContext in your template rendering, pass an optional third argument to render_to_response(): a RequestContext instance. Your code might look like this: def some_view(request): # ... return render_to_response('my_template.html', my_data_dictionary, context_instance=RequestContext(request)) Many thanks for all the help!

    Read the article

  • if non zero elements in same column count only once

    - by George
    I want to check the elements above the main diagonal and if I found non zero values , count one. If the non zero values are found in the same column ,then count just one ,not the number of the non zero values. For example , it should be count = 2 and not 3 in this example because 12 and 6 are in the same column. A= 1 11 12 4 5 6 0 7 0 #include <stdio.h> #include <stdlib.h> #include <math.h> int main( int argc, const char* argv[] ){ int Rows = 3 , Cols = 3; float *A = (float *) malloc ( Rows * Cols * sizeof (float) ); A[0] = 1.0; A[1] = 11.0; A[2] = 12.0; A[3] = 4.0; A[4] = 5.0; A[5] = 6.0; A[6] = 0.0; A[7] = 7.0; A[8] = 0.0; // print input matrix printf("\n Input matrix \n\n"); for ( int i = 0; i < Rows; i++ ) for ( int j = 0; j < Cols; j++ ) { printf("%f\t",A[ i * Cols + j ]); if( j == Cols-1 ) printf("\n"); } printf("\n"); int count = 0; for ( int j = 0 ; j < Cols; j++ ) { for ( int i = ( Rows - 1 ); i >= 0; i-- ) { // check the diagonal elements above the main diagonal if ( j > i ) { if ( ( A[ i * Cols + j ] != 0 ) ) { printf("\n Above nonzero Elmts = %f\n",( A[i * Cols + j] ) ); count++; } } } } printf("\ncount = %d\n",count ); return 0; }

    Read the article

  • From client, force whole page validation

    - by George
    I have an ASP button for which I have set the OnClientClick property to display a javascript confirm message. However, I only want this message to be displayed AFTER all of the client side validations have passed. How can I do this? Essentially, I believe that I need to force Page level validation from the client and then, only if it passes, display the confirmation box.

    Read the article

  • Odd toString behavior in javascript

    - by George
    I have this small function that's behaving oddly to me. Easy enough to work around, but enough to pique my curiosity. function formatNumber(number,style) { if (typeof style == 'number') { style = style.toString(); } return (number).format(style); } The return format part is based on another function that requires the style variable to be a string to work properly, so I'm just checking if style is a number and if it is to convert it to a string. When the function above is written as is, the format function format doesn't work properly. However when I write it as simply: return (number).format(style.toString()); Everything works. Is there a difference between putting the .toString function inside the format call vs performing it before hand and setting it as the variable style?

    Read the article

  • Properly obsoleting old members in an XML Serializable class in C# VB .NET

    - by George
    Hi! Some time ago I defined a class that was serialized using XML. That class contained a serializable propertyA of integer type. Now I have extended and updated this class, whereby a new propertyB was added, whose type is another class that also has several serializable properties. The new propertyB is now supposed to play the role of propertyA, that is since type of propertyB is another class, one of its members would contain the value that previously propertyA contained, thus making peroptyA obsolete. What I am trying to figure out is how do I make sure that when I desireliaze the OLD version of this class (without propertyB in it), I make sure that the desreializer would take the value of propertyA from the old calss and set it as a value of one of the members of propertyB in a new class? Private WithEvents _Position As Position = New Position(Alignment.MiddleMiddle, 0, True, 0, True) Public Property Position() As Position 'NEW composite property that holds the value of the obsolted property, i.e. Alignment Get Return _Position End Get Set(ByVal value As Position) _Position = value End Set End Property Private _Alignment As Alignment = Alignment.MiddleMiddle <Xml.Serialization.XmlIgnore(), Obsolete("Use Position property instead.")> _ Public Property Alignment() As Alignment'The old, obsoleted property that I guess must be left for compliance with deserializing the old version of this class Get Return _Alignment End Get Set(ByVal value As Alignment) _Alignment = value End Set End Property Can you help me, please?

    Read the article

  • javascript resize background image

    - by George
    Is it possible to resize a background image on load using javascript? I don't care about dynamically resizing the image according to window size or anything, I just want to take large images and resize them to a specific width and height so that the full image fits inside a specific layout.

    Read the article

  • C#: How to find the default value for a run-time Type?

    - by George Mauer
    So given a static type in your code you can do var defaultMyTypeVal = default(MyType); How would you do the same thing given a variable of Type so you can use it during runtime? In other words how do I implement the following method without a bunch of if statements or using Generics (because I will not know the type I'm passing into the method at compile time)? public object GetDefaultValueForType(Type type) { .... }

    Read the article

  • How come the [L] flag isn't working in my .htaccess file?

    - by George Edison
    Here are the rules: <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^$ index.php?action=home [L] RewriteRule ^[\w\W]*$ error.php [L] When a page matches the first one, it is supposed to ignore any other further rules. Yet accessing / results in error.php being invoked. Commenting out the second rule works as intended - the page redirects to index.php. What am I doing wrong? Also: is there a better way to write the last line? It's basically a catch-all.

    Read the article

  • In C++, I want to implement a ring iterator for a deque that contains a personally defined class.

    - by George
    I have a function of a "Table" class that should add a player to the table. I decided that if the seat is taken, the function should try and go through all the seats and add the player to the next available seat. How do I implement this in my addPlayer function? int Table::addPlayer(Player player, int position) { deque<Player>::iterator it; if(playerList[position] != "(empty seat)") { //What goes here? } playerList.put(player,it); cout >> "Player " >> player.toString >> " sits at position " >> position >> endl; }

    Read the article

  • Why does this PNG file look so poorly when embedded as a resource in a Qt project?

    - by George Edison
    Here is the PNG file and what it looks like in a QWebView when accessed via http://sstatic.net/so/img/logo.png: When accessed via HTTP: <img src="http://sstatic.net/so/img/logo.png" width='250' height='61' /> When accessed via a resource: <img src="qrc:/images/logo.png" width='250' height='61' /> As you can see, the only modification was the src attribute of the image tag... why the drop in quality? Edit: The file is being shrunk via width: and height: in the style attribute, if that makes a difference. I updated the code.

    Read the article

  • How to make this jQuery snippet work in Internet Explorer?

    - by George Edison
    If there was ever a time to hate IE, this is it. This code begins with a box with content. When the button is clicked, the box is supposed to drop down and fade-in. <html> <script type="text/javascript" src="jquery.js"></script> <script type='text/javascript'> function Test() { var item_height = $('#test').height(); $('#test').height(0); $('#test').css('opacity','0'); $('#test').animate({ height: item_height, opacity: '1' },400); } </script> <body> <!-- The div below holds the sample content --> <div id="test" style='border: 1px solid black;'> Content<br> Content<br> Content<br> Content<br> Content </div> <!-- The button to test the animation --> <br><br> <div style='position: absolute; top: 150px; left: 10px;'> <button onclick='Test();'>Test</button> </div> </body> </html> This very simple example works on Chrome, Safari, and Opera. But Internet Explorer? No. How can I (if it's even possible) fix this so that it works in IE?

    Read the article

  • Prevent initial array from sorting

    - by George
    I have an array where the order of the objects is important for when I finally output the array in a document. However, I'm also sorting the array in a function to find the highest value. The problem is that I after I run the function to find the highest value, I can't get the original sort order of the array back. // html document var data = [75,300,150,500,200]; createGraph(data); // js document function createGraph(data) { var maxRange = getDataRange(data); // simpleEncode() = google encoding function for graph var dataSet = simpleEncode(data,maxRange); } function getDataRange(dataArray) { var num = dataArray.sort(sortNumber); return num[0]; } I've also tried setting data to dataA and dataB and using dataB in the getDataRange function and dataA in the simpleEncode function. Either way, data always end up being sorted from highest to lowest.

    Read the article

  • how to call array values based on the main id they linked to?

    - by veronica george
    In page one, $add_id2=implode(',',$add_id); //result is 1,4 $item_type2=implode(',',$item_type_2); //result is 8,16 $final_total2=implode(',',$final); //result is 150,430 I pass these values via URL to the page two and store them in session. $_SESSION['cart'][$car]= array ('car'=>$car, 'loc_1'=>$location, array ( 'addon_id'=>$a_id, 'item_type'=>$item_type2, 'final_total'=>$final_t ) ); I call them like this, foreach($_SESSION['cart'] as $cart=>$things) { //display main array value like car id and location id echo $cart; foreach($things as $thing_1=>$thing_2) { foreach($thing_2['addon_id'] as $thi_2=>$thi_4) { //to display addons item for the car id //this is the id for each addon under the above car //echo $thi_2; //this is to echo addon id $thi_4; } } } The above loop works . the addon items array loops through inside main array which is car. If there were two addon items chosen then the addon array will loop twice. Now al I need to do is, How to make $item_type2 and $final_total2 display the value according to the addon id? PS: Same addon items can be chosen multiple times. They are identified uniquely by id(//echo $thi_2;). Thanks.

    Read the article

  • How to write a browser plugin?

    - by George Edison
    I'm curious as to the procedure for writing browser plugins for browsers like Chrome, Safari, and Opera. I'm thinking specifically of Windows here and would prefer working with C++. Note: I am not referring to extensions or 'addons'

    Read the article

  • Why won't these two mod_rewrite rules work together?

    - by George Edison
    Here is what I have: <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^users/(\d+)/post$ post.php [L] RewriteRule ^users/(\d+)$ user.php?id=$1 [L] The first rule doesn't work. The second one does. All I get when I enter .../users/1/post is a 404 error. What am I doing wrong? Edit: The error log doesn't have anything in it relating to this.

    Read the article

  • Extreamely fast way to clone the values of an array into a second array?

    - by George
    I am currently working on an application that is responsible for calculating random permutations of a multidemensional array. Currently the bulk of the time in the application is spent copying the array in each iteration (1 million iterations total). On my current system, the entire process takes 50 seconds to complete, 39 of those seconds spent cloning the array. My array cloning routine is the following: public static int[][] CopyArray(this int[][] source) { int[][] destination = new int[source.Length][]; // For each Row for (int y = 0; y < source.Length; y++) { // Initialize Array destination[y] = new int[source[y].Length]; // For each Column for (int x = 0; x < destination[y].Length; x++) { destination[y][x] = source[y][x]; } } return destination; } Is there any way, safe or unsafe, to achieve the same effect as above, much faster?

    Read the article

  • What is the .NET equivalent of PHP var_dump?

    - by George Mauer
    I remember seeing a while ago that there is some method in maybe the Reflection namespace that would recursively run ToString() on all of an object's properties and format it nicely for display. Yes, I know everything I could want will be accessible through the debugger, but I'm wondering if anyone knows that command?

    Read the article

  • Stop functions in 5 minutes if they dont end running

    - by george mano
    I want to add a feature in my project. I have 2 functions running in a for-loop because I want to find the solution of the functions in random arrays. I also have an function that makes random arrays. In each loop the array that is made by the random_array fun are the input of the 2 functions. The 2 functions print solutions in the screen , they dont return an argument. int main(){ for (i=0;i<50 i++) { arr1=ramdom_array(); func1(arr1) func2(arr1) } } I need to stop the functions running if they have not ended in 5 minutes. I have thought that I have to put in the functions something like this : void func1(array<array<int,4>,4> initial) { while (5minutes_not_passed) { //do staff if(solution==true) break; } } But I dont know what to put in the 5minutes_not_passed. the declaration of the functions are like this: void func1(array<array<int,4>,4> initial) void func2(array<array<int,4>,4> initial) I have found that I can use the thread library but I dont think meshing up with threads in a good idea. I believe something like a timer is needed. Note that the functions sometimes might end before 5 minutes.

    Read the article

< Previous Page | 25 26 27 28 29 30 31 32 33 34 35 36  | Next Page >