Search Results

Search found 166 results on 7 pages for 'doris sel'.

Page 6/7 | < Previous Page | 2 3 4 5 6 7  | Next Page >

  • JQuery Pure Template

    - by cem
    I cant figure out whats wrong. Its working when i tried to refresh only topics but it doesnt works when tried to refresh topics and page-links. ie. topics table's refreshing, and 'pagelinks' disappearing, i thought pure cannot reach - read second template node. By the way, i tested their code, first message box show up all of nodes - includes 'pagelinks' node, but second one - in function only show up topic rows. Its look like a bug. Anyone knows how can i solve this? ps. I'm using latest version of pure. Thanks. Test Code - pure.js line: 189 function dataselectfn(sel) { // ... m = sel.split('.'); alert(m.toSource()); return function (ctxt) { var data = ctxt.context; if (!data) { return ''; } alert('in function: ' + m.toSource()); // ... Json: {"topics":[{"name":"foo"}],"pagelinks":[{"Page":1},{"Page":2}]} HTML - before pure rendering: <table> <tbody> <tr> <td class="pagelinks"> <a page="1" href="/Topics/IndexForAreas?page=1" class="p Page@page">1</a> </td> <td class="pagelinks"> <a page="2" href="/Topics/IndexForAreas?page=2" class="p Page@page">2</a> </td> </tr> </tbody> </table> HTML - after pure rendering: <table> <tbody> <tr> </tr> </tbody> </table> Controller: [Transaction] public ActionResult IndexForAreas(int? page) { TopicService topicService = new TopicService(); PagedList<Topic> topics = topicService.GetPaged(page); if (Request.IsAjaxRequest()) { return Json(new { topics = topics.Select(t => new { name = t.Name, }), pagelinks = PagingHelper.AsPager(topics, 1) }); } return View(topics); } ASP.NET - View: <div class="topiccontainer"> <table> <% foreach (Topic topic in ViewData.Model) { %> <tr class="topics"> <td> <%= Html.ActionLink<ForumPostsController>(ec => ec.Index(topic.Name, null), topic.Name, new { @class="name viewlink@href" })%> </td> //bla bla... </tr> <%} %> </table> <table> <tr> <% Html.Pager(Model, 1, p => { %> <td class="pagelinks"> <%= Html.ActionLink<TopicsController>(c => c.IndexForAreas(p.Page), p.Page.ToString(), new { page = p.Page, @class = "Page@page" })%> </td> <% }); %> </tr> </table> </div> Master Page: <% Html.RenderAction("IndexForAreas", "Topics", new { area = "" }); %> <script type="text/javascript"> $.post("<%= Html.BuildUrlFromExpressionForAreas<TopicsController>(c => c.IndexForAreas(null)) %>", { page: page }, function (data) { $(".topiccontainer").autoRender(data); }, "json" ); </script>

    Read the article

  • Disable text selection UITextView

    - by marcio
    Hello, i want to disable text selection on a UITextView. Until now what i've already done is: - (BOOL)canPerformAction:(SEL)action withSender:(id)sender { [UIMenuController sharedMenuController].menuVisible = NO; if (action == @selector(paste:)) return NO; if (action == @selector(select:)) return NO; if (action == @selector(selectAll:)) return NO; return NO; } In this away i set UIMenuController to hidden and i put a stop to text copy but the text selection is still visible. Google results (also stackoverflow) take me to no solution. Has someone already faced the same problem? Any ideas? Thanks in advance, marcio

    Read the article

  • JQUERY CYCLE - Can I add page links to anchors assigned to Cycle's pager?

    - by christianDuncan
    Hello everyone. Seems I've outdone myself. All the while I was creating this pretty little 'latest news' widget that fades on mouseover of each anchor. Then my colleague says, "Hey, Chris, these links don't work" ...oops. I would like to find out if I can have these anchors take the user to the relvent page on click. Currently Cycle is set to do its hocus pocus on mouseover. This is my Cycle code: $('#newsSlider .slides ul').cycle({ fx: 'fade', speed: 1000, timeout: 0, pager: '.slides-nav', pagerEvent: 'mouseover', pagerAnchorBuilder: function(idx, slide) { // return sel string for existing anchor return '.slides-nav li:eq(' + (idx) + ') a'; } And here is the dev site: http://slg-development.co.uk/Gradient_12859/ Any help would be hugely appriciated. Thanks everyone! Christian

    Read the article

  • mysql query the latest date

    - by user295189
    I am running this query SEL ECT sh.*, u.initials AS initals FROM database1.table1 AS sh JOIN database2.user AS u ON u.userID = sh.userid WHERE id = 123456 AND dts = ( SELECT MAX(dts) from database1.table1 ) ORDER BY sort_by, category In the table1 I have records like this dts status category sort_by 2010-04-29 12:20:27 Civil Engineers Occupation 1 2010-04-28 12:20:27 Civil Engineers Occupation 1 2010-04-28 12:20:54 Married Marital Status 2 2010-04-28 12:21:15 Smoker Tobbaco 3 2010-04-27 12:20:27 Civil Engineers Occupation 1 2010-04-27 12:20:54 Married Marital Status 2 2010-04-27 12:21:15 Smoker Tobbaco 3 2010-04-26 12:20:27 Civil Engineers Occupation 1 2010-04-26 12:20:54 Married Marital Status 2 2010-04-26 12:21:15 Smoker Tobbaco 3 so if you look at my data, I am choosing the latest entry by category and sort_id. however in some case such as on 29th (2010-04-29 12:20:27) I have only one record. So in this case I want to show occupation for latest and then the rest of them (latest). But currently it displays only one row. Thanks

    Read the article

  • UIMenuController Custom Items

    - by Joshua
    I have created a UIMenuController and have set it a custom menu item like so: UIMenuController *menuController = [UIMenuController sharedMenuController]; UIMenuItem *item1 = [[UIMenuItem alloc] initWithTitle:@"Do This" action:@selector(item1)]; [menuController setMenuItems:[NSArray arrayWithObject:item1]]; But I wanted that object to be the only one to appear so I added this code: - (BOOL)canPerformAction: (SEL)action withSender: (id)sender { BOOL answer = NO; if (action == @selector(item1)) answer = YES; return answer; } The problem is it still shows other## Heading ## items, such as "Select", "Select All" and "Paste". This may have something to do with this being displayed in a UITextView. But how do I stop if from displaying all other items?

    Read the article

  • How to use unicode inside an xpath string? (UnicodeEncodeError)

    - by Gj
    I'm using xpath in Selenium RC via the Python api. I need to click an a element who's text is "Submit »" Here's the error that I'm getting: In [18]: sel.click(u"xpath=//a[text()='Submit \xbb')]") ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (1121, 0)) --------------------------------------------------------------------------- Exception Traceback (most recent call last) /Users/me/<ipython console> in <module>() /Users/me/selenium.pyc in click(self, locator) 282 'locator' is an element locator 283 """ --> 284 self.do_command("click", [locator,]) 285 286 /Users/me/selenium.pyc in do_command(self, verb, args) 213 #print "Selenium Result: " + repr(data) + "\n\n" 214 if (not data.startswith('OK')): --> 215 raise Exception, data 216 return data 217 <type 'str'>: (<type 'exceptions.UnicodeEncodeError'>, UnicodeEncodeError('ascii', u"ERROR: Invalid xpath [2]: //a[text()='Submit \xbb')]", 45, 46, 'ordinal not in range(128)'))

    Read the article

  • Calling UIGetScreenImage() on manually-spawned thread prints "_NSAutoreleaseNoPool():" message to lo

    - by jtrim
    This is the body of the selector that is specified in NSThread +detachNewThreadSelector:(SEL)aSelector toTarget:(id)aTarget withObject:(id)anArgument NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; while (doIt) { if (doItForSure) { NSLog(@"checking"); doItForSure = NO; (void)gettimeofday(&start, NULL); /* do some stuff */ // the next line prints "_NSAutoreleaseNoPool():" message to the log CGImageRef screenImage = UIGetScreenImage(); /* do some other stuff */ (void)gettimeofday(&end, NULL); elapsed = ((double)(end.tv_sec) + (double)(end.tv_usec) / 1000000) - ((double)(start.tv_sec) + (double)(start.tv_usec) / 1000000); NSLog(@"Time elapsed: %e", elapsed); [pool drain]; } } [pool release]; Even with the autorelease pool present, I get this printed to the log when I call UIGetScreenImage(): 2010-05-03 11:39:04.588 ProjectName[763:5903] *** _NSAutoreleaseNoPool(): Object 0x15a2e0 of class NSCFNumber autoreleased with no pool in place - just leaking Has anyone else seen this with UIGetScreenImage() on a separate thread?

    Read the article

  • Trying to recognize _NSFaultingMutableSet as member of NSSet

    - by Will
    I'm trying to recognize the result of a generic query to a managed object as an NSSet. Currently the class returned is a member of _NSFaultingMutableSet, which is clearly related, but fails the isMemberOf:[NSSet class] and isKindOf:[NSSet class] calls. Given that Cocoa doesn't do a direct implementation of NSSet, it's not surprising that I've got some air in the pipes, but I'm wondering if I'm messing something obvious up or this requires a higher grade of kung-fu than I possess. Code follows: SEL selector = NSSelectorFromString(someString); if(![self respondsToSelector:selector]){ NSLog(@"Error processing item"); return; } id items = [self performSelector:selector]; Class itemsClass = [items class]; if ( [itemsClass isKindOfClass:[NSSet class]]) { // do something }

    Read the article

  • Iterate through XML with xmlstarlet

    - by hendry
    I have the following XML: <?xml version="1.0" encoding="UTF-8"?> <test-report> <testsuite> <test name="RegisterConnection1Tests"> <testcase name="testRregisterConnection001"></testcase> <testcase name="testRegisterConnection002"></testcase> </test> <test name="RegisterConnection2Tests"> <testcase name="testRregisterConnection001"></testcase> <testcase name="testRegisterConnection002"></testcase> </test> </testsuite> </test-report> And I want the output: RegisterConnection1Tests,testRregisterConnection001 RegisterConnection1Tests,testRregisterConnection002 RegisterConnection2Tests,testRregisterConnection001 RegisterConnection2Tests,testRregisterConnection002 I'm confused as to how to show the children as I expected xmlstarlet sel -t -m 'test-report/testsuite/test' -v '@name' -v '//testcase/@name' -n $1 to work, though it only inputs: RegisterConnection1TeststestRregisterConnection001 RegisterConnection2TeststestRregisterConnection001

    Read the article

  • Passing Data thru NSTimer UserInfo

    - by zorro2b
    I a trying to pass data thru userInfo for an NSTimer call. What is the best way to do this? I am trying to use an NSDictionary, this is simple enough when I have objective c objects, but what about other data? I want to do something like this, which doesn't work as is: - (void) play:(SystemSoundID)sound target:(id)target callbackSelector:(SEL)selector { NSLog(@"pause ipod"); [iPodController pause]; theSound = sound; NSMutableDictionary *cb = [[NSMutableDictionary alloc] init]; [cb setObject:(id)&sound forKey:@"sound"]; [cb setObject:target forKey:@"target"]; [cb setObject:(id)&selector forKey:@"selector"]; [NSTimer scheduledTimerWithTimeInterval:0 target:self selector: @selector(notifyPause1:) userInfo:(id)cb repeats:NO]; }

    Read the article

  • Using iPhone Core Data to many Relationship

    - by BLeB
    When I define a to many relationship between entities in Xcode and then generate the data class from the entity I get a header with the following methods defined: @interface PriceList (CoreDataGeneratedAccessors) - (void)addItemsObject:(PriceListItem *)value; - (void)removeItemsObject:(PriceListItem *)value; - (void)addItems:(NSSet *)value; - (void)removeItems:(NSSet *)value; @end When I attempt to call addItemsObject with the following code a doesNotRecognizeSelector exception is thrown. PriceListItem *item = [NSEntityDescription insertNewObjectForEntityForName:@"PriceListItem" inManagedObjectContext:managedObjectContext]; item.cat = [attributeDict valueForKey:@"c"]; item.sel = [attributeDict valueForKey:@"s"]; [self addItemsObject:item]; From what I have read I do not have to implement these methods and that they are generated at runtime. Any ideas?

    Read the article

  • How can I do an SELINUX filesystem relabel without rebooting first?

    - by Skaperen
    I can touch the file /.autorelabel and reboot and during the initialization coming back up it will do the SELINUX relabel for me. But I want to do this in a different situation where the system has just been copied to a hard drive image. I can chroot to the originating file tree, or chroot to the just populated device image and run it. I just can't find anything that says what to be run. This image is being made into an AMI on AWS EC2, and contains CentOS 6.3. But the time it takes to relabel is too long (6 minutes or more). I want to move the relabel to the image build where the extra time is not an issue (because it happens once instead of every time an AMI is launched). I can make this relabel be the very last thing just before the filesystem is unmounted for the last time until it becomes an AMI and will launch. I just need to know what to call to do it. I have searched man pages with no luck. I have searched system init scripts but where /.autorelabel is detected, it is unclear what is happening. Documents like http://www.centos.org/docs/5/html/5.2/Deployment_Guide/sec-sel-fsrelabel.html only tell how to do things that still really do the work after a reboot. I need to have the work doing BEFORE the "reboot" (unmount, build AMI, and launch ready to go). The big point is ... yes there will be a reboot ... but I want the relabel work to be done before that so it won't be done every time an AMI is launched (because it takes so long).

    Read the article

  • How seriously should I take ECC correctable error warnings?

    - by David Mackintosh
    I have a pile of Sun X2200-M2 servers. These servers have ECC memory. In some of these servers, I am getting warnings in the eLOM about "correctable ECC errors detected", eg: # ssh regress11 ipmitool sel elist 1 | 05/20/2010 | 14:20:27 | Memory CPU0 DIMM2 | Correctable ECC | Asserted 2 | 05/20/2010 | 14:33:47 | Memory CPU0 DIMM2 | Correctable ECC | Asserted ...some more frequently than others. The kernel on this particular system is throwing EDAC errors as well, although with far more frequency than the eLOM is recording ECC events: EDAC k8 MC0: general bus error: participating processor(local node response), time-out(no timeout) memory transaction type(generic read), mem or i/o(mem access), cache level(generic) MC0: CE page 0x42a194, offset 0x60, grain 8, syndrome 0xf654, row 4, channel 1, label "": k8_edac MC0: CE - no information available: k8_edac Error Overflow set EDAC k8 MC0: extended error code: ECC chipkill x4 error EDAC k8 MC0: general bus error: participating processor(local node response), time-out(no timeout) memory transaction type(generic read), mem or i/o(mem access), cache level(generic) MC0: CE page 0x48cb94, offset 0x10, grain 8, syndrome 0xf654, row 5, channel 1, label "": k8_edac MC0: CE - no information available: k8_edac Error Overflow set EDAC k8 MC0: extended error code: ECC chipkill x4 error Now if the server is detecting Uncorrectable ECC, the system resets, so clearly that's bad and removing/replacing the identified stick or pair corrects the issue. But I am thinking that if the error is Correctable, then there's no immediate issue -- I can treat this as a warning and be prepared to pull the stick/pair if an uncorrectable error starts occurring?

    Read the article

  • Setting a Visual State from a data bound enum in WPF

    - by firoso
    Hey all, I've got a scenario where I want to switch the visiblity of 4 different content controls. The visual states I have set opacity, and collapsed based on each given state (See code.) What I'd like to do is have the visual state bound to a property of my View Model of type Enum. I tried using DataStateBehavior, but it requires true/false, which doesn't work for me. So I tried DataStateSwitchBehavior, which seems to be totally broken for WPF4 from what I could tell. Is there a better way to be doing this? I'm really open to different approaches if need be, but I'd really like to keep this enum in the equation. Edit: The code shouldn't be too important, I just need to know if there's a well known solution to this problem. <UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:Custom="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions" xmlns:ee="http://schemas.microsoft.com/expression/2010/effects" xmlns:customBehaviors="clr-namespace:SEL.MfgTestDev.ESS.Behaviors" x:Class="SEL.MfgTestDev.ESS.View.PresenterControl" mc:Ignorable="d" d:DesignHeight="624" d:DesignWidth="1104" d:DataContext="{Binding ApplicationViewModel, Mode=OneWay, Source={StaticResource Locator}}"> <Grid> <Grid.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="Layout/TerminalViewTemplate.xaml"/> <ResourceDictionary Source="Layout/DebugViewTemplate.xaml"/> <ResourceDictionary Source="Layout/ProgressViewTemplate.xaml"/> <ResourceDictionary Source="Layout/LoadoutViewTemplate.xaml"/> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Grid.Resources> <Custom:Interaction.Behaviors> <customBehaviors:DataStateSwitchBehavior Binding="{Binding ApplicationViewState}"> <customBehaviors:DataStateSwitchCase State="LoadoutState" Value="Loadout"/> </customBehaviors:DataStateSwitchBehavior> </Custom:Interaction.Behaviors> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="ApplicationStates" ei:ExtendedVisualStateManager.UseFluidLayout="True"> <VisualStateGroup.Transitions> <VisualTransition GeneratedDuration="0:0:1"> <VisualTransition.GeneratedEasingFunction> <SineEase EasingMode="EaseInOut"/> </VisualTransition.GeneratedEasingFunction> <ei:ExtendedVisualStateManager.TransitionEffect> <ee:SmoothSwirlGridTransitionEffect/> </ei:ExtendedVisualStateManager.TransitionEffect> </VisualTransition> </VisualStateGroup.Transitions> <VisualState x:Name="LoadoutState"> <Storyboard> <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="LoadoutPage"> <EasingDoubleKeyFrame KeyTime="0" Value="1"/> </DoubleAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="LoadoutPage"> <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="ProgressState"> <Storyboard> <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="ProgressPage"> <EasingDoubleKeyFrame KeyTime="0" Value="1"/> </DoubleAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="ProgressPage"> <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="DebugState"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="DebugPage"> <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/> </ObjectAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="DebugPage"> <EasingDoubleKeyFrame KeyTime="0" Value="1"/> </DoubleAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="TerminalState"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="TerminalPage"> <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/> </ObjectAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="TerminalPage"> <EasingDoubleKeyFrame KeyTime="0" Value="1"/> </DoubleAnimationUsingKeyFrames> </Storyboard> </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups> <ContentControl x:Name="LoadoutPage" ContentTemplate="{StaticResource LoadoutViewTemplate}" Opacity="0" Content="{Binding}" Visibility="Collapsed"/> <ContentControl x:Name="ProgressPage" ContentTemplate="{StaticResource ProgressViewTemplate}" Opacity="0" Content="{Binding}" Visibility="Collapsed"/> <ContentControl x:Name="DebugPage" ContentTemplate="{StaticResource DebugViewTemplate}" Opacity="0" Content="{Binding}" Visibility="Collapsed"/> <ContentControl x:Name="TerminalPage" ContentTemplate="{StaticResource TerminalViewTemplate}" Opacity="0" Content="{Binding}" Visibility="Collapsed"/> <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Top" Text="{Binding ApplicationViewState}"> <TextBlock.Background> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> <GradientStop Color="Black" Offset="0"/> <GradientStop Color="White" Offset="1"/> </LinearGradientBrush> </TextBlock.Background> </TextBlock> </Grid>

    Read the article

  • Display database content which is last inserted using last inserted ID

    - by user2330772
    What i am doing is i am displaying last inserted data when form data is submitted,the form is multipart/form-data. I am getting this form data using jquery,here i am sending this data to php file using Ajax POST.In that php file i am inserting that data in db table..where i am getting the id of inserted data..on success of Ajax call i am sending that id to another PHP file..where using that id i am displaying the last inserted data... My form is: <form method="post" enctype="multipart/form-data" name="upload_form" id="data"> <select id="sel"> <option>Select the Project Stream</option> <option value="1">Computer Science</option> <option value="2">Mechanical</option> <option value="3">IT</option> <option value="4">Web Development</option> <option value="5">MCA</option> <option value="6">Civil</option> </select><br /> <input type="text" id="title" placeholder="Project Title"/><br /> <input type="text" id="vurl" placeholder="If You have any video about project write your video url path here" style="width:435px;"/><br /> <textarea id="prjdesc" name="prjdesc" rows="20" cols="80" style="border-style:groove;box-shadow: 10px 10px 10px 10px #888888;"placeholder="Please describe Your Project"></textarea> <label for="file">Filename:</label> <input type="file" name="file" id="file"/><br /> <button>Submit</button> </form> My js file: $("form#data").submit(function() { alert("update"); var sid=$("#sel").val(); alert(sid); var ttle = $("#title").val(); alert(ttle); var text = $("#prjdesc").val(); var vurl = $("#vurl").val(); /*var dataString = 'param='+text+'&param1='+vurl+'&param2='+ttle+'&param3='+id;*/ var formData = new FormData($(this)[0]); formData.append('param',text); formData.append('param1',vurl); formData.append('param2',ttle ); formData.append('param3',sid ); $.ajax({ type:'POST', data:formData, url:'insert.php', success:function(id) { alert(id); window.location ="another.php?id="+id; }, cache: false, contentType: false, processData: false }); return false; }); insert.php: <?php print_r($_FILES); $desc = $_POST['param']; echo $desc; $video = $_POST['param1']; echo $video ; $title = $_POST['param2']; echo $title; $tech_id=$_POST['param3']; echo $tech_id; $host="localhost"; $username="root"; $password=""; $db_name="geny"; $tbl_name="project_details"; mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $allowedExts = array("gif", "jpeg", "jpg", "png"); $extension = end(explode(".", $_FILES["file"]["name"])); $url_dir = "C:/wamp/www/WebsiteTemplate4/upload/"; if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/jpg") || ($_FILES["file"]["type"] == "image/pjpeg") || ($_FILES["file"]["type"] == "image/x-png") || ($_FILES["file"]["type"] == "image/png")) && ($_FILES["file"]["size"] < 50000) && in_array($extension, $allowedExts)) { if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br>"; } else { if (file_exists($url_dir . $_FILES["file"]["name"])) { echo $_FILES["file"]["name"] . " already exists. "; } else { move_uploaded_file($_FILES["file"]["tmp_name"],$url_dir. $_FILES["file"]["name"]); // echo "Stored in: " . "upload/" . $_FILES["file"]["name"]; $tmp = "C:/wamp/www/WebsiteTemplate4/upload/" . $_FILES["file"]["name"]; $sql="INSERT INTO $tbl_name (title, content, img_path, video_url, project_tech_Id) VALUES ('$title','$desc','$tmp','$video','$tech_id')"; if(mysql_query($sql)) { echo mysql_insert_id(); } else { echo "Cannot Insert"; } } } } else { echo "Invalid file"; } ?> another.php: <?php $temp=$_GET['id']; echo $temp; $host="localhost"; $username="root"; $password=""; $db_name="geny"; $tbl_name="project_details"; mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $query = mysql_query("SELECT content FROM project_details WHERE id=". $temp); if (!$query) { echo 'Could not run query: ' . mysql_error(); exit; } $row = mysql_fetch_row($query); echo "<div id='uprjct' style='background:#336699;'> <p>$row[0]</p> </div>"; ?> but the ID what i am returning in insert.php containg array of elements...i dont want all these thing i want only ID(which is number).. please tell me what is wrong in my code...

    Read the article

  • How to raycast select a scaled OBB?

    - by user3254944
    I have the OBB picking code to select an OBB with code inspired from Real time Rendering 3 and opengl-tutorial.org. I can successfully select objects that have been moved or rotated. However, I cant correctly select an object that has been scaled. The bounding box scales right, but the I can only select the object in a thin strip on its center. How do I fix the checkForHits() function to allow it to read the scaling that I passed to it in the raycast matrix? void GLWidget::selectObjRaycast() { glm::vec2 mouse = (glm::vec2(mousePos.x(), mousePos.y()) / glm::vec2(this->width(), this->height())) * 2.0f - 1.0f; mouse.y *= -1; glm::mat4 toWorld = glm::inverse(ProjectionM * ViewM); glm::vec4 from = toWorld * glm::vec4(mouse, -1.0f, 1.0f); glm::vec4 to = toWorld * glm::vec4(mouse, 1.0f, 1.0f); from /= from.w; to /= to.w; fromAABB = glm::vec3(from); toAABB = glm::normalize(glm::vec3(to - from)); checkForHits(); } void GLWidget::checkForHits() { for (int i = 0; i < myWin.myEtc->allObj.size(); ++i) //check for hits on each obj's bb { bool miss = 0; float tMin = 0.0f; float tMax = 100000.0f; glm::vec3 bbPos(myWin.myEtc->allObj[i]->raycastM[3].x, myWin.myEtc->allObj[i]->raycastM[3].y, myWin.myEtc->allObj[i]->raycastM[3].z); glm::vec3 delta = bbPos - fromAABB; for (int j = 0; j < 3; ++j) { glm::vec3 axis(myWin.myEtc->allObj[i]->raycastM[j].x, myWin.myEtc->allObj[i]->raycastM[j].y, myWin.myEtc->allObj[i]->raycastM[j].z); float e = glm::dot(axis, delta); float f = glm::dot(toAABB, axis); if (fabs(f) > 0.001f) { float t1 = (e + myWin.myEtc->allObj[i]->bbMin[j]) / f; float t2 = (e + myWin.myEtc->allObj[i]->bbMax[j]) / f; if (t1 > t2) { float w = t1; t1 = t2; t2 = w; } if (t2 < tMax) tMax = t2; if (t1 > tMin) tMin = t1; if (tMax < tMin) miss = 1; } else { if (-e + myWin.myEtc->allObj[i]->bbMin[j] > 0.0f || -e + myWin.myEtc->allObj[i]->bbMax[j] < 0.0f) miss = 1; } } if (miss == 0) { intersection_distance = tMin; myWin.myEtc->sel.push_back(myWin.myEtc->allObj[i]); myWin.myEtc->allObj[i]->highlight = myWin.myGLHelp->highlight; break; } } } void Object::render(glm::mat4 PV) { scaleM = glm::scale(glm::mat4(), s->val_3); r_quat = glm::quat(glm::radians(r->val_3)); rotationM = glm::toMat4(r_quat); translationM = glm::translate(glm::mat4(), t->val_3); transLocal1M = glm::translate(glm::mat4(), -rsPivot->val_3); transLocal2M = glm::translate(glm::mat4(), rsPivot->val_3); raycastM = translationM * transLocal2M * rotationM * scaleM * transLocal1M; // MVP = PV * translationM * transLocal2M * rotationM * scaleM * transLocal1M; }

    Read the article

  • How can I programmatically link an UIView or UIImageView with an event like "touch up inside"?

    - by Thanks
    Interface Builder will only allow me to hook up such events for an button. But like in HTML, I just want to haven an blank UIImageView where - as soon as the user taps it - a method is invoked. I hope there is some cool programmatically way of doing that, which I don't know about. UPDATE: In my View Controller that creates the UIImageView I tried to do this: SEL actionSelector = @selector(doSomethingWhenImageIsTouched:); [self.myUIImageView addTarget:nil action:actionSelector forControlEvents:UIControlEventTouchUpInside]; The compiler gives me a warning, that UIImageView may not respond to addTarget:... what do I have to do so that it works with an UIImageView. I see in the docs that UIImageView does not inherit from UIControl, but addTarget: is part of UIControl. UPDATE: I ended up creating an UIButton after creating the UIImageView. Then I set the frame of that button to the frame of the UIImageView, and alpha to 0.1f. For some reason, it will not work if alpha is 0.0f. And then, I did that cool addTarget: thing...

    Read the article

  • Calling AddEventListener in a loop with a variable element name

    - by user302209
    Hi, I'm trying to do the following: I have a set of images and select (dropdown) HTML elements, 30 of each one. I'm trying to use AddEventListener on a loop from 1 to 30 so that when I change the value of the select, the image src is updated (and the image changes). The AddEventListener function is this one: function AddEventListener(element, eventType, handler, capture) { if (element.addEventListener) element.addEventListener(eventType, handler, capture); else if (element.attachEvent) element.attachEvent("on" + eventType, handler); } I tried this and it worked: var urlfolderanimalimages = "http://localhost/animalimages/"; var testselect = "sel15"; var testimg = "i15"; AddEventListener(document.getElementById(testselect), "change", function(e) { document.getElementById(testimg).src = urlfolderanimalimages + document.getElementById(testselect).value; document.getElementById(testimg).style.display = 'inline'; if (e.preventDefault) e.preventDefault(); else e.returnResult = false; if (e.stopPropagation) e.stopPropagation(); else e.cancelBubble = true; }, false); But then I tried to call it in a loop and it doesn't work. The event is added, but when I change any select, it will update the last one (the image with id i30). var urlfolderanimalimages = "http://localhost/animalimages/"; for (k=1;k<=30;k++) { var idselect = "sel" + k; var idimage = "i" + k; AddEventListener(document.getElementById(idselect), "change", function(e) { document.getElementById(idimage).src = urlfolderanimalimages + document.getElementById(idselect).value; document.getElementById(idimage).style.display = 'inline'; if (e.preventDefault) e.preventDefault(); else e.returnResult = false; if (e.stopPropagation) e.stopPropagation(); else e.cancelBubble = true; }, false); } What am I doing wrong? I'm new to JavaScript (and programming in general), so sorry for the vomit-inducing code :(

    Read the article

  • SQL Stored Queries - use result of query as boolean based on existence of records

    - by Christian Mann
    Just getting into SQL stored queries right now... anyway, here's my database schema (simplified for YOUR convenience): member ------ id INT PK board ------ id INT PK officer ------ id INT PK If you're into OOP, Officer Inherits Board Inherits Member. In other words, if someone is listed on the officer table, s/he is listed on the board table and the member table. I want to find out the highest privilege level someone has. So far my SP looks like this: DELIMITER // CREATE PROCEDURE GetAuthLevel(IN targetID MEDIUMINT) BEGIN IF SELECT `id` FROM `member` WHERE `id` = targetID; THEN IF SELECT `id` FROM `board` WHERE `id` = targetID; THEN IF SELECT `id` FROM `officer` WHERE `id` = targetID; THEN RETURN 3; /*officer*/ ELSE RETURN 2; /*board member*/ ELSE RETURN 1; /*general member*/ ELSE RETURN 0; /*not a member*/ END // DELIMITER ; The exact text of the error is #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT id FROM member WHERE id = targetID; THEN IF SEL' at line 4 I suspect the issue is in the arguments for the IF blocks. What I want to do is return true if the result-set is at least one -- i.e. the id was found in the table. Do any of you guys see anything to do here, or should I reconsider my database design into this:? person ------ id INT PK level SMALLINT

    Read the article

  • How do we greatly optimize our MySQL database (or replace it) when using joins?

    - by jkaz
    Hi there, This is the first time I'm approaching an extremely high-volume situation. This is an ad server based on MySQL. However, the query that is used incorporates a lot of JOINs and is generally just slow. (This is Rails ActiveRecord, btw) sel = Ads.find(:all, :select = '*', :joins = "JOIN campaigns ON ads.campaign_id = campaigns.id JOIN users ON campaigns.user_id = users.id LEFT JOIN countries ON countries.campaign_id = campaigns.id LEFT JOIN keywords ON keywords.campaign_id = campaigns.id", :conditions = [flashstr + "keywords.word = ? AND ads.format = ? AND campaigns.cenabled = 1 AND (countries.country IS NULL OR countries.country = ?) AND ads.enabled = 1 AND campaigns.dailyenabled = 1 AND users.uenabled = 1", kw, format, viewer['country'][0]], :order = order, :limit = limit) My questions: Is there an alternative database like MySQL that has JOIN support, but is much faster? (I know there's Postgre, still evaluating it.) Otherwise, would firing up a MySQL instance, loading a local database into memory and re-loading that every 5 minutes help? Otherwise, is there any way I could switch this entire operation to Redis or Cassandra, and somehow change the JOIN behavior to match the (non-JOIN-able) nature of NoSQL? Thank you!

    Read the article

  • target-action uicontrolevents

    - by Fabrizio Farinelli
    I must be missing something obvious here but ... UIControl has a method - (void)addTarget:(id)target action:(SEL)action forControlEvents: (UIControlEvents)controlEvents which lets you add an action to be called when any of the given controlEvents occur. ControlEvents are a bitmask of events which tell you if a touch went down, or up inside, or was dragged etc., there's about 16 of them, you or them together and get called when any of them occur. The selector can have one of the following signatures - (void)action - (void)action:(id)sender - (void)action:(id)sender forEvent:(UIEvent *) none of those tell you what the control event bitmask was. The UIEvent is something slightly different, it's related to the actual touch event and doesn't (I think) contain the UIControlEvent. The sender (UIControl) doesn't have a way to find the control events either. I'd like to have one method which deals with a number of control events as I have some common code regardless of which event or events happened but I still need to know what the UIControlEvents were for some specific processing. Am I missing a way to find out what UIControlEvents were used when the action was called or do I really have to separate my code into -(void)actionWithUIControlEventX; -(void)actionWithUIControlEventY;

    Read the article

  • pass objective c object and primitive type into a void *

    - by user674669
    I want to pass 2 variables: UIImage * img int i into another method that only takes a (void *) I tried making a C struct containing both img and i struct MyStruct { UIImage *img; int i; } but xcode gives me an error saying "ARC forbids Objective-C objects in structs or unions" The next thing I tried is to write an objective-c class MyStruct2 containing img and i, alloc-initing an instance of it and typecasting it as (__bridge void*) before passing it to the method. Seems little involved for my use case. Seems like there should be a better way. What's the simplest way to achieve this? Thank you. Edit based on comments: I have to use void * as it is required by the UIView API. I created a selector as mentioned by UIVIew API + (void)setAnimationDidStopSelector:(SEL)selector Please see documentation for setAnimationDidStopSelector at http://developer.apple.com/library/ios/#documentation/uikit/reference/UIView_Class/UIView/UIView.html . It says ... The selector should be of the form: - (void)animationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context I want to pass both img and i into the (void *)context argument.

    Read the article

  • UIViewController remaining

    - by Guy
    Hi Guys. I have a UIViewController named equationVC who's user interface is being programmatically created from another NSObject class called equationCon. Upon loading equationVC, a method called chooseInterface is called from the equationCon class. I have a global variable (globalVar) that points to a user defined string. chooseInterface finds a method in the equationCon class that matches the string globalVar points to. In this case, let's say that globalVar points to a string that is called "methodThatMatches." In methodThatMatches, another view controller needs to show the results of what methodThatMatches did. methodThatMatches creates a new equationVC that calls upon methodThatMatches2. As a test, each method changes the color of the background. When the application starts up, I get a purple background, but as soon as I hit backwards I get another purple screen, which should be yellow. I do not think that I am release the view properly. Can anyone help? -(void)chooseInterface { NSString* equationTemp = [globalVar stringByReplacingOccurrencesOfString:@" " withString:@""]; equationTemp = [equationTemp stringByReplacingOccurrencesOfString:@"'" withString:@""]; SEL equationName = NSSelectorFromString(equationTemp); NSLog(@"selector! %@",NSStringFromSelector(equationName)); if([self respondsToSelector:equationName]){ [self performSelector:equationName]; } } -(void)methodThatMatches{ self.equationVC.view.backgroundColor = [UIColor yellowColor]; [setGlobalVar:@"methodThatMatches2"]; EquationVC* temp = [[EquationVC alloc] init]; [[self.equationVC navigationController] pushViewController:temp animated:YES ]; [temp release]; } -(void)methodThatmatches2{ self.equationVC.view.backgroundColor = [UIColor purpleColor]; }

    Read the article

  • web design question (php/ajax)

    - by tom smith
    Hi guys... Hope this isn't a waste of your time. I'm working on a project, and it occured to me that there's a chunk of code out there, that should allow me to see how others have implemented this. I've got a project where I'm going to have a page, with a sel box. the user will select an item from the selList, and based on the item selected, a separate section of the page (areaB) will change in terms of the content/tbls being displayed. i then want to allow the user to go through a series of subpages in areaB, where the user goes through a submit/cancel/confirm process, where the stuff in areaB changes, with the rest of the page remaining the same... i'm trying to figure out the best approach to implement the on both client/server side. i could just have an ugly "if block" where i have abunch of logic, and i completely regen the page each time the user selects an action.. i could have an approach that might involve divs/frames, where i then just regen the targeted frame/div area.. is this even possible?? i could have some form of ajaxy process, which would only alter the targeted section(s) of the page... so.. i'm trying to talk to anyone who has ideas on how to do this, or more ideally, if you know of a good code (client/server) side example of this... that i can examine. i'd really appreciate it!! i've got a more detailed overview but didn't know if it would be cool to post it here... thanks.. tom

    Read the article

  • Get node content from xml file and transform it into php array?

    - by Kirzilla
    Hello, I'm looking for solution to extract some node from large xml file (using xmlstarlet http://xmlstar.sourceforge.net/) and then parse this node to php array. elements.xml <?xml version="1.0"?> <elements> <element id="1" par1="val1_1" par2="val1_2" par3="val1_3"> <title>element 1 title</title> <description>element 1 description</description> </element> <element id="2" par1="val2_1" par2="val2_2" par3="val2_3"> <title>element 2 title</title> <description>element 2 description</description> </element> </elements> To extract element tag with id="1" using xmlstarlet I'm executing this shell command... xmlstarlet sel -t -c "/elements/element[id=1]" elements.xml This shell command outputs something like this... <element id="1" par1="val1_1" par2="val1_2" par3="val1_3"> <title>element 1 title</title> <description>element 1 description</description> </element> How could I parse this shell output into php array? Thank you.

    Read the article

< Previous Page | 2 3 4 5 6 7  | Next Page >