Search Results

Search found 49 results on 2 pages for 'vipin sahu'.

Page 1/2 | 1 2  | Next Page >

  • String manipulation functions in SQL Server 2000 / 2005

    - by Vipin
    SQL Server provides a range of string manipulation functions. I was aware of most of those in back of the mind, but when I needed to use one, I had to dig it out either from SQL server help file or from google. So, I thought I will list some of the functions which performs some common operations in SQL server. Hope it will be helpful to you all. Len (' String_Expression' ) - returns the length of input String_Expression. Example - Select Len('Vipin') Output - 5 Left ( 'String_Expression', int_characters ) - returns int_characters characters from the left of the String_Expression.     Example - Select Left('Vipin',3), Right('Vipin',3) Output -  Vip,  Pin  LTrim ( 'String_Expression' ) - removes spaces from left of the input 'String_Expression'  RTrim ( 'String_Expression' ) - removes spaces from right of the input 'String_Expression' Note - To removes spaces from both ends of the string_expression use Ltrim and RTrim in conjunction Example - Select LTrim(' Vipin '), RTrim(' Vipin ') , LTrim ( RTrim(' Vipin ')) Output - 'Vipin ' , ' Vipin' , 'Vipin' (Single quote marks ' ' are not part of the SQL output, it's just been included to demonstrate the presence of space at the end of string.) Substring ( 'String_Expression' , int_start , int_length ) - this function returns the part of string_expression. Right ( 'String_Expression', int_characters ) - returns int_characters characters from the right of the String_Expression.

    Read the article

  • Retrieve .Net Control ID in Javascript

    - by Vipin
    Originally posted on: http://geekswithblogs.net/Vipin/archive/2013/07/24/retrieve-.net-control-id-in-javascript.aspxIf you need to retrieve a client ID of an asp:net control in a javascript function, then you can use the below function - function $$(id, context) { var el = $("#" + id, context); if (el.length < 1) el = $("[id$=_" + id + "]", context); return el; }   var tempDotNetControl = 'aspTextTemporary';   var ClientSideID = $$(aspTextTemporary); Please bear in mind, this function is useful if you want to retrieve client ID of a different DotNet control based on some condition, otherwise if it’s always static then you can just use <%= aspTextTemporary.ClientID %>"

    Read the article

  • Unable to configure/setup 5.1 audio with 12.04

    - by Vipin Vinayan
    I am kinda new to Ubuntu as well. I have been having this issue with audio for quite sometime now. Initially, when I installed version 11.10 (I guess), I was able to use my 5.1 speakers without any issues. If my memory serves me right, it was after an update that the 5.1 audio stopped working and the video resolution would not get saved. I temporarily fixed the resolution issue by creating a start-up shell script that would update the resolution and load it. But the issue with audio has been going on for quite sometime now. Even though I have option for 5.1, only two speakers seem to be working. I thought an upgrade should fix the issue and so upgraded the OS to version 12.04. I also tried uninstalling alsa and pulse audio, reinstalling them, changing the /etc/pulse/daemon.conf channels from 2 to 6. I have also tried installing pavucontrol but nothing seems to have worked and the issue still persists. Is there anything else you could suggest? The lspci log on my computer is as follows 00:00.0 Host bridge: Intel Corporation 82G33/G31/P35/P31 Express DRAM Controller (rev 10) 00:01.0 PCI bridge: Intel Corporation 82G33/G31/P35/P31 Express PCI Express Root Port (rev 10) 00:02.0 VGA compatible controller: Intel Corporation 82G33/G31 Express Integrated Graphics Controller (rev 10) 00:1b.0 Audio device: Intel Corporation N10/ICH 7 Family High Definition Audio Controller (rev 01) 00:1c.0 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 1 (rev 01) 00:1c.1 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 2 (rev 01) 00:1d.0 USB controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #1 (rev 01) 00:1d.1 USB controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #2 (rev 01) 00:1d.2 USB controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #3 (rev 01) 00:1d.3 USB controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #4 (rev 01) 00:1d.7 USB controller: Intel Corporation N10/ICH 7 Family USB2 EHCI Controller (rev 01) 00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev e1) 00:1f.0 ISA bridge: Intel Corporation 82801GB/GR (ICH7 Family) LPC Interface Bridge (rev 01) 00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 01) 00:1f.2 IDE interface: Intel Corporation N10/ICH7 Family SATA Controller [IDE mode] (rev 01) 00:1f.3 SMBus: Intel Corporation N10/ICH 7 Family SMBus Controller (rev 01) 03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 01) Would really appreciate a response that will assist me in resolving my issue. Thanks in advance Vipin

    Read the article

  • Find the occurrence of word/character in SQL column with wildcard character - PATINDEX

    - by Vipin
    CharIndex and PatIndex both can be used to determine the presence of character or string within sql column data. Both returns the starting position of the first occurrence of the character/word within expression. However, one major difference between CharIndex and PatIndex is that later allows the use of wild card characters while searching for character or word within column data. Also, Patindex is useful for searching within Text datatype. Allowed wild card characters are % and _ . " % "  - use it for any number of characters " _ "  - use it for a single character. Syntax PATINDEX('%pattern%', string_expression) Note - it's mandatory to include pattern within %% characters. returns starting position of occurrence of pattern, if found. returns 0, if not found returns NULL , if either pattern or string_expression is null. Example SELECT fldname FROM tblUsers WHERE PatIndex('%v_pin%', fldname) > 0

    Read the article

  • Page_BlockSubmit - reset it to False, if there is a scenario when page doesn't postback on validation error

    - by Vipin
    Recently, I was facing a problem where if there was a validation error, and if I changed the state of checkbox it won't postback on first attempt. But when I uncheck and check again , it postbacks on second attempt...this is some quirky behaviour in .ASP.Net platform. The solution was to reset Page_BlockSubmit flag to false and it works fine. The following explanation is from http://lionsden.co.il/codeden/?p=137&cpage=1#comment-143   Submit button on the page is a member of vgMain, so automatically it will only run the validation on that group. A solution is needed that will run validation on multiple groups and block the postback if needed. Solution Include the following function on the page: function DoValidation() { //validate the primary group var validated = Page_ClientValidate('vgPrimary ');   //if it is valid if (validated) { //valid the main group validated = Page_ClientValidate('vgMain'); }   //remove the flag to block the submit if it was raised Page_BlockSubmit = false;   //return the results return validated; } Call the above function from the submit button’s OnClientClick event. <asp:Button runat="server" ID="btnSubmit" CausesValidation="true" ValidationGroup="vgMain" Text="Next" OnClick="btnSubmit_Click" OnClientClick="return DoValidation();" /> What is Page_BlockSubmit When the user clicks on a button causing a full post back, after running Page_ClientValidate ASP.NET runs another built in function ValidatorCommonOnSubmit. Within Page_ClientValidate, Page_BlockSubmit is set based on the validation. The postback is then blocked in ValidatorCommonOnSubmit if Page_BlockSubmit is true. No matter what, at the end of the function Page_BlockSubmit is always reset back to false. If a page does a partial postback without running any validation and Page_BlockSubmit has not been reset to false, the partial postback will be blocked. In essence the above function, RunValidation, acts similar to ValidatorCommonOnSubmit. It runs the validation and then returns false to block the postback if needed. Since the built in postback is never run, we need to reset Page_BlockSubmit manually before returning the validation result.

    Read the article

  • PC to USB transfer slow

    - by Vipin Ms
    I'm having trouble with USB transfer,not with external hard disk. Transfer starts with like, for the transfer of 700MB file it starts with 30mb/s and towards the end it stops at 0s and stays put for like 3-4 mins to transfer the last bit. I have tried different USB devices, but no luck. Is it a bug? Another important point is, in Kubuntu there is no such issue. So is it something related to Gnome? I'm using Ubuntu 11.10 64bit. Somebody please help, it's really annoying. Here are the details. PC all of my drives are in ext4. USB I tried ext3,ntfs and fat32. All having the same problem. Here are my USB controllers details: root@LAB:~# lspci|grep USB 00:1a.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #4 (rev 03) 00:1a.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #5 (rev 03) 00:1a.2 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #6 (rev 03) 00:1a.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #2 (rev 03) 00:1d.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #1 (rev 03) 00:1d.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #2 (rev 03) 00:1d.2 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #3 (rev 03) 00:1d.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #1 (rev 03) Here is an example of one transfer. I connected one of my 4GB usb device. Nov 24 12:01:25 LAB kernel: [ 1175.082175] userif-2: sent link up event. Nov 24 12:01:25 LAB kernel: [ 1695.684158] usb 2-2: new high speed USB device number 3 using ehci_hcd Nov 24 12:01:25 LAB mtp-probe: checking bus 2, device 3: "/sys/devices/pci0000:00/0000:00:1d.7/usb2/2-2" Nov 24 12:01:26 LAB mtp-probe: bus: 2, device: 3 was not an MTP device Nov 24 12:01:26 LAB kernel: [ 1696.132680] usbcore: registered new interface driver uas Nov 24 12:01:26 LAB kernel: [ 1696.142528] Initializing USB Mass Storage driver... Nov 24 12:01:26 LAB kernel: [ 1696.142919] scsi4 : usb-storage 2-2:1.0 Nov 24 12:01:26 LAB kernel: [ 1696.143146] usbcore: registered new interface driver usb-storage Nov 24 12:01:26 LAB kernel: [ 1696.143150] USB Mass Storage support registered. Nov 24 12:01:27 LAB kernel: [ 1697.141657] scsi 4:0:0:0: Direct-Access SanDisk U3 Cruzer Micro 8.02 PQ: 0 ANSI: 0 CCS Nov 24 12:01:27 LAB kernel: [ 1697.168827] sd 4:0:0:0: Attached scsi generic sg2 type 0 Nov 24 12:01:27 LAB kernel: [ 1697.169262] sd 4:0:0:0: [sdb] 7856127 512-byte logical blocks: (4.02 GB/3.74 GiB) Nov 24 12:01:27 LAB kernel: [ 1697.169762] sd 4:0:0:0: [sdb] Write Protect is off Nov 24 12:01:27 LAB kernel: [ 1697.169767] sd 4:0:0:0: [sdb] Mode Sense: 45 00 00 08 Nov 24 12:01:27 LAB kernel: [ 1697.171386] sd 4:0:0:0: [sdb] No Caching mode page present Nov 24 12:01:27 LAB kernel: [ 1697.171391] sd 4:0:0:0: [sdb] Assuming drive cache: write through Nov 24 12:01:27 LAB kernel: [ 1697.173503] sd 4:0:0:0: [sdb] No Caching mode page present Nov 24 12:01:27 LAB kernel: [ 1697.173510] sd 4:0:0:0: [sdb] Assuming drive cache: write through Nov 24 12:01:27 LAB kernel: [ 1697.175337] sdb: sdb1 After that I initiated one transfer. lsof -p 3575|tail -2 mv 3575 root 3r REG 8,8 1719599104 4325379 /media/Misc/The Tree of Life (2011) DVDRip XviD-MAXSPEED/The Tree of Life (2011) DVDRip XviD-MAXSPEED www.torentz.3xforum.ro.avi mv 3575 root 4w REG 8,17 1046347776 15 /media/SREE/The Tree of Life (2011) DVDRip XviD-MAXSPEED/The Tree of Life (2011) DVDRip XviD-MAXSPEED www.torentz.3xforum.ro.avi Here are the total time spent on that transfer. root@LAB:/media/SREE# time mv /media/Misc/The\ Tree\ of\ Life\ \(2011\)\ DVDRip\ XviD-MAXSPEED/ /media/SREE/ real 11m49.334s user 0m0.008s sys 0m5.260s root@LAB:/media/SREE# df -T|tail -2 /dev/sdb1 vfat 3918344 1679308 2239036 43% /media/SREE /dev/sda8 ext4 110110576 60096904 50013672 55% /media/Misc Do you think this is normal?? Approximately 12 minutes for 1.6Gb transfer? Thanks.

    Read the article

  • App_Offline.htm, taking site down for maintenance

    - by Vipin
    There is much simpler and graceful way to shut down a site while doing upgrade to avoid the problem of people accessing site in the middle of a content update.   Basically, if you place file with name 'app_offline.htm' with below contents in the root of a web application directory, ASP.NET will shut-down the application,  and stop processing any new incoming requests for that application.  ASP.NET will also then respond to all requests for dynamic pages in the application by sending back the content of the app_offline.htm file (for example: you might want to have a “site under construction” or “down for maintenance” message).   Then after upgrade, just rename/delete app_offline.htm file…and the site would be back to normal. Just remember that the size of the file should be greater than 512 bytes, doesn't matter even if you add some comments to it to push the byte size as long as it's of the size greater than 512 - it'll work fine.     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html http://www.w3.org/1999/xhtml"http://www.w3.org/1999/xhtml" ><head>    <title>Maintenance Mode - Outage Message</title></head><body>    <h1>Maintenance Mode</h1>     <p>We're currently undergoing scheduled maintenance. We will come back very shortly.</p>     <p>Sorry for the inconvenience!</p>     <!--            Adding additional hidden content so that IE Friendly Errors don't prevent    this message from displaying (note: it will show a "friendly" 404    error if the content isn't of a certain size).        <h2>Site under maintenance...</h2>      <h2>Site under maintenance...</h2>      <h2>Site under maintenance...</h2>      <h2>Site under maintenance...</h2>      <h2>Site under maintenance...</h2>      <h2>Site under maintenance...</h2>      <h2>Site under maintenance...</h2>      <h2>Site under maintenance...</h2>         --></body></html>

    Read the article

  • Show line breaks in asp:label inside gridview

    - by Vipin
    To show line breaks in asp:label element or for that matter inside Gridview, do the following  in case of Mandatory/ Nullable fields. <ItemTemplate>          <%# ((string)Eval("Details")).Replace("\n", "<br/>") %>  </ItemTemplate>    <ItemTemplate>          <%# FormatString(Eval("Details"))  %>  </ItemTemplate>   In code behind, add the following FormatString function - protected string FormatString(string strHelpMessage) { string rtnString = string.Empty; if (!string.IsNullOrEmpty(strHelpMessage)) rtnString = strHelpMessage.Replace(Environment.NewLine, "<br/>"); return rtnString; }

    Read the article

  • How to find the occurrence of particular character in string - CHARINDEX

    - by Vipin
    Many times while writing SQL, we need to find if particular character is present in the column data. SQL server possesses an in-built function to do this job - CHARINDEX(character_to_search, string, [starting_position]) Returns the position of the first occurrence of the character in the string. NOTE - index starts with 1. So, if character is at the starting position, this function would return 1. Returns 0 if character is not found. Returns 0 if 'string' is empty. Returns NULL if string is NULL. A working example of the function is SELECT CHARINDEX('a', fname) a_First_occurence, CHARINDEX('a', fname, CHARINDEX('a', fname)) a_Second_occurrence FROM Users WHERE fname = 'aka unknown' OUTPUT ------- a_First_occurence a_Second_occurrence 1 3

    Read the article

  • mount issue in ubuntu 12.10

    - by Vipin Ms
    I'm having issue with latest Ubuntu 12.10. Let me make it more clear. I'm having the following partitions in my Laptop. Device Boot Start End Blocks Id System /dev/sda1 2048 39997439 19997696 83 Linux /dev/sda2 * 40001850 81947564 20972857+ 83 Linux /dev/sda3 81947565 123877214 20964825 83 Linux /dev/sda4 123887614 976773119 426442753 5 Extended /dev/sda5 123887616 333602815 104857600 83 Linux /dev/sda6 333604864 543320063 104857600 83 Linux /dev/sda7 543322112 753037311 104857600 83 Linux /dev/sda8 753039360 976773119 111866880 83 Linux I have also two users named "ms" and abc. Here ms is for administrative tasks and abc for my friends. When I mount any drive under "abc" user, I cannot access it under my other user "ms". Same as in the case with "ms" user. I found possible reason behind the issue. When I mount any drive under "abc" user, Ubuntu will try to mount it under "/media/abc/volume_name" instead of "/media/volume_name" . Same as in the case with "ms" user. # df -h Filesystem Size Used Avail Use% Mounted on /dev/sda1 19G 11G 7.5G 59% / udev 1.5G 4.0K 1.5G 1% /dev tmpfs 599M 896K 598M 1% /run none 5.0M 0 5.0M 0% /run/lock none 1.5G 620K 1.5G 1% /run/shm none 100M 92K 100M 1% /run/user /dev/sda2 20G 172M 19G 1% /media/abc/TEST /dev/sdb1 466G 353G 114G 76% /media/abc/F088F74288F7063E /dev/sdb2 466G 318G 148G 69% /media/abc/New Volume /dev/sda5 99G 94G 323M 100% /media/abc/Songs /dev/sda6 99G 31G 63G 34% /media/ms/Films Here, you can see that "TEST" was mounted under "/media/abc/TEST". When I try to access the already mounted partition named '/media/abc/TEST" in my "ms" session I'm getting the following error. How to fix this error? Is it a bug? Is there any way to fix this without modifying the underlying file-system structure?

    Read the article

  • How to show multiple screens with right/left slide Gesture

    - by ajay sahu
    I am having an application in which i have a ListView .List is populated from an array list . On selection of each item it show the detail description for that item in a seperate screen populated data from another array list . A single screen is used to display details of all the items.it loads data from dynamically. Can anyone please tell me how can i display all details on same screen using right/left slide gesture. Screen with ListView -itemList Screen to display detail -detail listView on next and previous gesture it should dynamic data on screen 2detail list view from arraylist

    Read the article

  • How to calculate commision based on referred memebrs?

    - by RAJKISHOR SAHU
    Hello everybody, I am developing a small software in C# WPF for a consultancy which does chain system business. I have coded tree structure to show who referred whom. Now it has commission depending on level. If 1 referred 2 & 3 then 1 will get level-1 commission. If 2 referred 4, 5 & 3 referred 6, 7 then 1 will receive level-2 commission. This chain will go on to certain total number. My problem is how I would implement this logic; I am able to calculate who has referred how many members via UDF written for adding TreeViewItem to TreeView. Or tell me how I can count items in treeview in certain level? Node adding UDF: public void AddNodes(int uid, TreeViewItem tSubNode) { string query = "select fullname, id from members where refCode=" + uid + ";"; MySqlCommand cmd = new MySqlCommand(query, db.conn); MySqlDataAdapter _DA = new MySqlDataAdapter(cmd); DataTable _DT = new DataTable(); tSubNode.IsExpanded = true; _DA.Fill(_DT); foreach (DataRow _dr in _DT.Rows) { TreeViewItem tNode = new TreeViewItem(); tNode.Header = _dr["fullname"].ToString()+" ("+_dr["id"].ToString()+")"; tSubNode.Items.Add(tNode); if (db.HasMembers(Convert.ToInt32(_dr["id"].ToString()))) { AddNodes(Convert.ToInt32(_dr["id"]), tNode); } } //This line tracks who has referred how many members Console.WriteLine("Tree node Count : "+tSubNode.Items.Count.ToString()+", UID "+uid); } Help me PLEASE!!!!

    Read the article

  • How to get notification when window closes in Firefox extension?

    - by Yashwant Kumar Sahu
    Hello experts I am making toolbar in Mozilla Firefox. On the click of a button on my toolbar, I am opening a new window which navigates to my HTML Page created by me. On this HTML Page on the click of a button I am doing some work and closing the window. That's all done, now I need my original or parent window's toolbar to get notified when this window is closed. I guess adding event listeners won't work as its all done in new window. Please suggest. Any help is apprectiated

    Read the article

  • Setting html controller to right side in firefox extension

    - by Yashwant Kumar Sahu
    Hi Expert, I am creating Mozilla extension. Here I need to set button controller right side in extension. Here I divide XUL file to div element. I have take a main div element and inside this i have take two more inner div. Then I have set one inner div style property float:left; and another div style property float:right. But this is not helpful for me. Here I also set Button CSS style property float:right which is inside the div which have property float:right. Awaiting for your response. Thanks in advance

    Read the article

  • What are the IPv6 Public and Private and Reserved ranges

    - by vipin raj
    I just want to know what are all the public IPv6 ranges which ISPs or other users can use? Also need a list of addresses which can be used in private networks and also the list of addresses which never can be used in any network. I have been searching through different web sites. But none gives a reliable answer. Actually we are developing an application which allows user to plan their IP address(create supernets, subnets, hosts, assign host to ports etc). So my application should be able to distinguish between all kinds of address ranges, whether it is reserved, public, private, multicast etc

    Read the article

  • Oracle Open World Tokyo

    - by user762552
    ????????????????????????????Oracle Open World Tokyo????????????????????????????????????????????Database Firewall????????·??????????????????????????????????????????????????VP(?????????)???Vipin Samar????????????????????SNS???????DBA???????????????????????????????????????????????????????S3-01 4/6(?)11:50-12:35??????????????????????????????? ???????????????????????2415?????????????????????????···???????????????????????4/4???????????S1-12(13:00-13:45)????????????????????··· ?????????????

    Read the article

  • Problem to display 3D google map.

    - by nemade-vipin
    hello friends, I have implemented one Flex application in which I want to display 3D google map.In which I am getting the error the NUll object reference during map display. Here is my code:- import com.google.maps.controls.MapTypeControl; import adobe.utils.XMLUI; import mx.rpc.events.FaultEvent; import mx.controls.Alert; import generated.webservices.*; import mx.collections.ArrayCollection; import mx.controls.*; import generated.webservices.*; import com.google.maps.LatLng; import com.google.maps.Map3D; import com.google.maps.MapEvent; import com.google.maps.MapMouseEvent; import com.google.maps.services.GeocodingEvent; import com.google.maps.services.ClientGeocoder; import com.google.maps.overlays.Marker; import com.google.maps.InfoWindowOptions; import com.google.maps.MapOptions; import com.google.maps.MapType; import com.google.maps.View; import com.google.maps.controls.NavigationControl; import com.google.maps.geom.Attitude; import mx.controls.Alert; [Bindable] private var childName:ArrayCollection; [Bindable] private var childId:ArrayCollection; private var photoFeed:ArrayCollection; private var trackinginfochild:TrackingInfo; private var arrayOfchild:Array; private var newEntry:GetSBTSMobileAuthentication; private var trackinginfo:GetSBTSTrackingInfo; private var childObj:Child; private var UserId:int; private var lat:int; private var long:int; private var latlong:LatLng; public var user:SBTSWebService; public function authentication():void { // Instantiate a new Entry object. user = new SBTSWebService(); if(user!=null) { user.addSBTSWebServiceFaultEventListener(handleFaults); user.addgetSBTSMobileAuthenticationEventListener(authenticationResult); newEntry = new GetSBTSMobileAuthentication(); if(newEntry!=null) { newEntry.mobile=mobileno.text; newEntry.password=password.text; user.getSBTSMobileAuthentication(newEntry); } } } public function handleFaults(event:FaultEvent):void { Alert.show("A fault occured contacting the server. Fault message is: " + event.fault.faultString); } public function authenticationResult(event:GetSBTSMobileAuthenticationResultEvent):void { if(event.result != null && event.result._return>0) { if(event.result._return > 0) { UserId = event.result._return; loginform.enabled = false; getChildList(UserId); viewstack2.selectedIndex=1; } else { Alert.show("Authentication fail"); } } } public function getChildList(userId:int):void { var childEntry:GetSBTSMobileChildrenInfo = new GetSBTSMobileChildrenInfo(); childEntry.UserId = userId; user.addgetSBTSMobileChildrenInfoEventListener(sbtsChildrenInfoResult); user.getSBTSMobileChildrenInfo(childEntry); } public function sbtsChildrenInfoResult(event:GetSBTSMobileChildrenInfoResultEvent):void { if( event.result._return!=null) { arrayOfchild = event.result._return as Array; photoFeed = new ArrayCollection(arrayOfchild); childName = new ArrayCollection(); for( var count:int=0;count<photoFeed.length;count++) { childObj = photoFeed.getItemAt(count,0) as Child; childName.addItem(childObj.strName); } } } private function trackingInfo():void { for( var count:int=0;count user.getSBTSTrackingInfo(trackinginfo); } } } } private function getTrackingInfo(event:GetSBTSTrackingInfoResultEvent):void { if(event.result._return != null) { trackinginfochild = event.result._return as TrackingInfo; lat = trackinginfochild.dblLatitude; long = trackinginfochild.dblLongitude; latlong = new LatLng(lat,long); } } private function onMapPreinitialize(event:MapEvent):void { var myMapOptions:MapOptions = new MapOptions(); myMapOptions.zoom = 12; myMapOptions.center = latlong; myMapOptions.mapType = MapType.NORMAL_MAP_TYPE; myMapOptions.viewMode = View.VIEWMODE_PERSPECTIVE; myMapOptions.attitude = new Attitude(20,30,0); buslocation.setInitOptions(myMapOptions); buspath.setInitOptions(myMapOptions); } private function onMapReady(event:MapEvent):void { this.buslocation.addControl(new NavigationControl()); this.buslocation.addControl( new MapTypeControl()); } ]]> <mx:Move id="hideEffect" yTo="-500" /> <mx:Move id="showEffect" xFrom="500"/> <mx:Panel width="100%" height="100%" headerColors="[#000000,#FFFFFF]" hideEffect="{hideEffect}" showEffect="{showEffect}"> <mx:TabNavigator id="viewstack2" selectedIndex="0" creationPolicy="all" width="100%" height="100%"> <mx:Form label="Login Form" id="loginform" hideEffect="{hideEffect}" showEffect="{showEffect}"> <mx:FormItem label="Mobile NO:" creationPolicy="all"> <mx:TextInput id="mobileno"/> </mx:FormItem> <mx:FormItem label="Password:" creationPolicy="all"> <mx:TextInput displayAsPassword="true" id="password" /> </mx:FormItem> <mx:FormItem> <mx:Button label="Login" click="authentication()"/> </mx:FormItem> </mx:Form> <mx:Form label="Child List" id="childForm" hideEffect="{hideEffect}" showEffect="{showEffect}"> <mx:Label width="100%" color="blue" text="Select Child."/> <mx:RadioButtonGroup id="radioGroup" itemClick="trackingInfo()"/> <mx:Repeater id="fieldRepeater" dataProvider="{childName}"> <mx:RadioButton groupName="radioGroup" label="{fieldRepeater.currentItem}" value="{fieldRepeater.currentItem}"/> </mx:Repeater> </mx:Form> <mx:Form label="Child Information" hideEffect="{hideEffect}" showEffect="{showEffect}"> <mx:FormItem> <mx:DataGrid id="childinfo"> <mx:columns> <mx:DataGridColumn headerText="Child Name" dataField="strName"/> <mx:DataGridColumn headerText="School Name" dataField="strSchoolName"/> <mx:DataGridColumn headerText="Pick Up Point" dataField="strPickUpPointName"/> <mx:DataGridColumn headerText="Drop Down Point" dataField="strDropDownPointName"/> </mx:columns> </mx:DataGrid> </mx:FormItem> <mx:FormItem> <mx:Button label="click here to see bus location"/> </mx:FormItem> </mx:Form> <mx:Form label="Bus Location" hideEffect="{hideEffect}" showEffect="{showEffect}"> <maps:Map3D xmlns:maps="com.google.maps.*" mapevent_mappreinitialize="onMapPreinitialize(event)" id="buslocation" width="100%" height="100%" url="http://code.google.com/apis/maps/" key="ABQIAAAAXuX6aG-r_N0-tQNxUEV-vRSE8al1BQssMxLXJiP75kIjR3ssLxT3D52_u94hI-dMIkD72FmnK-P4og"/> </mx:Form> <mx:Form label="Bus path" hideEffect="{hideEffect}" showEffect="{showEffect}"> <maps:Map3D xmlns:maps="com.google.maps.*" mapevent_mappreinitialize="onMapPreinitialize(event)" id="buspath" width="100%" height="100%" url="http://code.google.com/apis/maps/" key="ABQIAAAAXuX6aG-r_N0-tQNxUEV-vRSE8al1BQssMxLXJiP75kIjR3ssLxT3D52_u94hI-dMIkD72FmnK-P4og"/> </mx:Form> </mx:TabNavigator> </mx:Panel> I am getting this error :- TypeError: Error #1009: Cannot access a property or method of a null object reference. at com.google.maps.geom::Geometry$/computeSeparatingAxes() at com.google.maps.geom::TileEnumerator/enumerateTiles() at com.google.maps.core::PerspectiveTilePane/computeOptimalSet() at com.google.maps.core::PerspectiveTilePane/render() at com.google.maps.core::PerspectiveTilePane/configure() at com.google.maps.managers::PerspectiveTileManager/updateView() at com.google.maps.managers::PerspectiveTileManager/initializePanes() at com.google.maps.managers::PerspectiveTileManager/onInitialize() at MethodInfo-190() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9298] at com.google.maps.wrappers::BaseEventDispatcher/dispatchEvent() at com.google.maps.wrappers::EventDispatcherWrapper/dispatchEvent() at com.google.maps.core::MapImpl/size() at com.google.maps.core::MapImpl/setSize() at com.google.maps.wrappers::IMapWrapper/setSize() at com.google.maps::Map/internalSetSize() at com.google.maps::Map/onUIComponentResized() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9298] at mx.core::UIComponent/dispatchResizeEvent()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:7077] at mx.core::UIComponent/setActualSize()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:6706] at mx.containers.utilityClasses::BoxLayout/updateDisplayList()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\containers\utilityClasses\BoxLayout.as:219] at mx.containers::Form/updateDisplayList()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\containers\Form.as:375] at mx.core::UIComponent/validateDisplayList()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:6351] at mx.core::Container/validateDisplayList()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:2677] at mx.managers::LayoutManager/validateDisplayList()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:622] at mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:695] at Function/http://adobe.com/AS3/2006/builtin::apply() at mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8628] at mx.core::UIComponent/callLaterDispatcher()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8568] Please resolve my issue.

    Read the article

  • Jmeter Exception response code :000 ,response message:Read timed out,for Java Web service?

    - by vipin k.
    I am testing a java web service(jax-ws),but whenever i am running the test i am getting response code as response message:Read timed out . And at tomcat serevr side i am getting exception : SEVERE: caught throwable ClientAbortException: java.net.SocketException: Connection reset by peer: socket write error at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:358) at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:354) at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:381) at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:370) at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:89) I found out that Read timed out exception may occur because of big size of SOAP response. But i am clue less because same web service i can access form an application.

    Read the article

  • Problem to cretate dynamic radio button in flex.

    - by nemade-vipin
    hi friends, I am creating the flex ARI application in which I am accessing the webservice method this method is returning me a childList.I am accessing it in my flex appliction using the Array object in my action script code.Now I want to cretate one flex page in which I get child list with radio button.I have done it using Arraycollection in which i put all the child name.Now I am getting each child name in mxml using the Repeater component in mxml.But I have problem is that I am getting the only list of child name.I also want to get child id for to set value for each radio button. how can I refer same childname and it's id for radio button using same Arraycollection list.my code is import mx.controls.*; [Bindable] private var childName:ArrayCollection; private var photoFeed:ArrayCollection; private var arrayOfchild:Array; [Bindable] private var childObj:Child; public var user:SBTSWebService; public function initApp():void { user = new SBTSWebService(); user.addSBTSWebServiceFaultEventListener(handleFaults); } public function displayString():void { // Instantiate a new Entry object. var newEntry:GetSBTSMobileAuthentication = new GetSBTSMobileAuthentication(); newEntry.mobile=mobileno.text; newEntry.password=password.text; user.addgetSBTSMobileAuthenticationEventListener(authenticationResult); user.getSBTSMobileAuthentication(newEntry); } public function handleFaults(event:FaultEvent):void { Alert.show("A fault occured contacting the server. Fault message is: " + event.fault.faultString); } public function authenticationResult(event:GetSBTSMobileAuthenticationResultEvent):void { if(event.result != null) { if(event.result._return > 0) { var UserId:int = event.result._return; getChildList(UserId); viewstack2.selectedIndex=1; } else { Alert.show("Authentication fail"); } } } public function getChildList(userId:int):void { var childEntry:GetSBTSMobileChildrenInfo = new GetSBTSMobileChildrenInfo(); childEntry.UserId = userId; user.addgetSBTSMobileChildrenInfoEventListener(sbtsChildrenInfoResult); user.getSBTSMobileChildrenInfo(childEntry); } public function sbtsChildrenInfoResult(event:GetSBTSMobileChildrenInfoResultEvent):void { if(event.result != null && event.result._return!=null) { arrayOfchild = event.result._return as Array; photoFeed = new ArrayCollection(arrayOfchild); childName = new ArrayCollection(); for( var count:int=0;count<photoFeed.length;count++) { childObj = photoFeed.getItemAt(count,0) as Child; childName.addItem(childObj.strName); } } } ]]> <mx:Panel width="500" height="300" headerColors="[#000000,#FFFFFF]"> <mx:TabNavigator id="viewstack2" selectedIndex="0" creationPolicy="all" width="100%" height="100%"> <mx:Form label="Login Form"> <mx:FormItem label="Mobile NO:"> <mx:TextInput id="mobileno" /> </mx:FormItem> <mx:FormItem label="Password:"> <mx:TextInput displayAsPassword="true" id="password" /> </mx:FormItem> <mx:FormItem> <mx:Button label="Login" click="displayString()"/> </mx:FormItem> </mx:Form> <mx:Form label="Child List"> <mx:Label width="100%" color="blue" text="Select Child."/> <mx:RadioButtonGroup id="radioGroup" /> <mx:Repeater id="fieldRepeater" dataProvider="{childName}"> <mx:RadioButton groupName="radioGroup" label="{fieldRepeater.currentItem}"/> </mx:Repeater> </mx:Form> <mx:Form label="Child Information"> </mx:Form> <mx:Form label="Trace Path"> </mx:Form> </mx:TabNavigator> </mx:Panel> please tell me the sol.

    Read the article

  • how to use 3D map Actionscript class in mxml file for display map.

    - by nemade-vipin
    hello friends, I have created the application in which I have to use 3D map Action Script class in mxml file to display a map in form. that is in tab navigator last tab. My ActionScript 3D map class is(FlyingDirections):- package src.SBTSCoreObject { import src.SBTSCoreObject.JSONDecoder; import com.google.maps.InfoWindowOptions; import com.google.maps.LatLng; import com.google.maps.LatLngBounds; import com.google.maps.Map3D; import com.google.maps.MapEvent; import com.google.maps.MapOptions; import com.google.maps.MapType; import com.google.maps.MapUtil; import com.google.maps.View; import com.google.maps.controls.NavigationControl; import com.google.maps.geom.Attitude; import com.google.maps.interfaces.IPolyline; import com.google.maps.overlays.Marker; import com.google.maps.overlays.MarkerOptions; import com.google.maps.services.Directions; import com.google.maps.services.DirectionsEvent; import com.google.maps.services.Route; import flash.display.Bitmap; import flash.display.DisplayObject; import flash.display.DisplayObjectContainer; import flash.display.Loader; import flash.display.LoaderInfo; import flash.display.Sprite; import flash.events.Event; import flash.events.IOErrorEvent; import flash.events.MouseEvent; import flash.events.TimerEvent; import flash.filters.DropShadowFilter; import flash.geom.Point; import flash.net.URLLoader; import flash.net.URLRequest; import flash.net.navigateToURL; import flash.text.TextField; import flash.text.TextFieldAutoSize; import flash.text.TextFormat; import flash.utils.Timer; import flash.utils.getTimer; public class FlyingDirections extends Map3D { /** * Panoramio home page. */ private static const PANORAMIO_HOME:String = "http://www.panoramio.com/"; /** * The icon for the car. */ [Embed("assets/car-icon-24px.png")] private static const Car:Class; /** * The Panoramio icon. */ [Embed("assets/iw_panoramio.png")] private static const PanoramioIcon:Class; /** * We animate a zoom in to the start the route before the car starts * to move. This constant sets the time in seconds over which this * zoom occurs. */ private static const LEAD_IN_DURATION:Number = 3; /** * Duration of the trip in seconds. */ private static const TRIP_DURATION:Number = 40; /** * Constants that define the geometry of the Panoramio image markers. */ private static const BORDER_T:Number = 3; private static const BORDER_L:Number = 10; private static const BORDER_R:Number = 10; private static const BORDER_B:Number = 3; private static const GAP_T:Number = 2; private static const GAP_B:Number = 1; private static const IMAGE_SCALE:Number = 1; /** * Trajectory that the camera follows over time. Each element is an object * containing properties used to generate parameter values for flyTo(..). * fraction = 0 corresponds to the start of the trip; fraction = 1 * correspondsto the end of the trip. */ private var FLY_TRAJECTORY:Array = [ { fraction: 0, zoom: 6, attitude: new Attitude(0, 0, 0) }, { fraction: 0.2, zoom: 8.5, attitude: new Attitude(30, 30, 0) }, { fraction: 0.5, zoom: 9, attitude: new Attitude(30, 40, 0) }, { fraction: 1, zoom: 8, attitude: new Attitude(50, 50, 0) }, { fraction: 1.1, zoom: 8, attitude: new Attitude(130, 50, 0) }, { fraction: 1.2, zoom: 8, attitude: new Attitude(220, 50, 0) }, ]; /** * Number of panaramio photos for which we load data. We&apos;ll select a * subset of these approximately evenly spaced along the route. */ private static const NUM_GEOTAGGED_PHOTOS:int = 50; /** * Number of panaramio photos that we actually show. */ private static const NUM_SHOWN_PHOTOS:int = 7; /** * Scaling between real trip time and animation time. */ private static const SCALE_TIME:Number = 0.001; /** * getTimer() value at the instant that we start the trip. If this is 0 then * we have not yet started the car moving. */ private var startTimer:int = 0; /** * The current route. */ private var route:Route; /** * The polyline for the route. */ private var polyline:IPolyline; /** * The car marker. */ private var marker:Marker; /** * The cumulative duration in seconds over each step in the route. * cumulativeStepDuration[0] is 0; cumulativeStepDuration[1] adds the * duration of step 0; cumulativeStepDuration[2] adds the duration * of step 1; etc. */ private var cumulativeStepDuration:/*Number*/Array = []; /** * The cumulative distance in metres over each vertex in the route polyline. * cumulativeVertexDistance[0] is 0; cumulativeVertexDistance[1] adds the * distance to vertex 1; cumulativeVertexDistance[2] adds the distance to * vertex 2; etc. */ private var cumulativeVertexDistance:Array; /** * Array of photos loaded from Panoramio. This array has the same format as * the &apos;photos&apos; property within the JSON returned by the Panoramio API * (see http://www.panoramio.com/api/), with additional properties added to * individual photo elements to hold the loader structures that fetch * the actual images. */ private var photos:Array = []; /** * Array of polyline vertices, where each element is in world coordinates. * Several computations can be faster if we can use world coordinates * instead of LatLng coordinates. */ private var worldPoly:/*Point*/Array; /** * Whether the start button has been pressed. */ private var startButtonPressed:Boolean = false; /** * Saved event from onDirectionsSuccess call. */ private var directionsSuccessEvent:DirectionsEvent = null; /** * Start button. */ private var startButton:Sprite; /** * Alpha value used for the Panoramio image markers. */ private var markerAlpha:Number = 0; /** * Index of the current driving direction step. Used to update the * info window content each time we progress to a new step. */ private var currentStepIndex:int = -1; /** * The fly directions map constructor. * * @constructor */ public function FlyingDirections() { key="ABQIAAAA7QUChpcnvnmXxsjC7s1fCxQGj0PqsCtxKvarsoS-iqLdqZSKfxTd7Xf-2rEc_PC9o8IsJde80Wnj4g"; super(); addEventListener(MapEvent.MAP_PREINITIALIZE, onMapPreinitialize); addEventListener(MapEvent.MAP_READY, onMapReady); } /** * Handles map preintialize. Initializes the map center and zoom level. * * @param event The map event. */ private function onMapPreinitialize(event:MapEvent):void { setInitOptions(new MapOptions({ center: new LatLng(-26.1, 135.1), zoom: 4, viewMode: View.VIEWMODE_PERSPECTIVE, mapType:MapType.PHYSICAL_MAP_TYPE })); } /** * Handles map ready and looks up directions. * * @param event The map event. */ private function onMapReady(event:MapEvent):void { enableScrollWheelZoom(); enableContinuousZoom(); addControl(new NavigationControl()); // The driving animation will be updated on every frame. addEventListener(Event.ENTER_FRAME, enterFrame); addStartButton(); // We start the directions loading now, so that we&apos;re ready to go when // the user hits the start button. var directions:Directions = new Directions(); directions.addEventListener( DirectionsEvent.DIRECTIONS_SUCCESS, onDirectionsSuccess); directions.addEventListener( DirectionsEvent.DIRECTIONS_FAILURE, onDirectionsFailure); directions.load("48 Pirrama Rd, Pyrmont, NSW to Byron Bay, NSW"); } /** * Adds a big blue start button. */ private function addStartButton():void { startButton = new Sprite(); startButton.buttonMode = true; startButton.addEventListener(MouseEvent.CLICK, onStartClick); startButton.graphics.beginFill(0x1871ce); startButton.graphics.drawRoundRect(0, 0, 150, 100, 10, 10); startButton.graphics.endFill(); var startField:TextField = new TextField(); startField.autoSize = TextFieldAutoSize.LEFT; startField.defaultTextFormat = new TextFormat("_sans", 20, 0xffffff, true); startField.text = "Start!"; startButton.addChild(startField); startField.x = 0.5 * (startButton.width - startField.width); startField.y = 0.5 * (startButton.height - startField.height); startButton.filters = [ new DropShadowFilter() ]; var container:DisplayObjectContainer = getDisplayObject() as DisplayObjectContainer; container.addChild(startButton); startButton.x = 0.5 * (container.width - startButton.width); startButton.y = 0.5 * (container.height - startButton.height); var panoField:TextField = new TextField(); panoField.autoSize = TextFieldAutoSize.LEFT; panoField.defaultTextFormat = new TextFormat("_sans", 11, 0x000000, true); panoField.text = "Photos provided by Panoramio are under the copyright of their owners."; container.addChild(panoField); panoField.x = container.width - panoField.width - 5; panoField.y = 5; } /** * Handles directions success. Starts flying the route if everything * is ready. * * @param event The directions event. */ private function onDirectionsSuccess(event:DirectionsEvent):void { directionsSuccessEvent = event; flyRouteIfReady(); } /** * Handles click on the start button. Starts flying the route if everything * is ready. */ private function onStartClick(event:MouseEvent):void { startButton.removeEventListener(MouseEvent.CLICK, onStartClick); var container:DisplayObjectContainer = getDisplayObject() as DisplayObjectContainer; container.removeChild(startButton); startButtonPressed = true; flyRouteIfReady(); } /** * If we have loaded the directions and the start button has been pressed * start flying the directions route. */ private function flyRouteIfReady():void { if (!directionsSuccessEvent || !startButtonPressed) { return; } var directions:Directions = directionsSuccessEvent.directions; // Extract the route. route = directions.getRoute(0); // Draws the polyline showing the route. polyline = directions.createPolyline(); addOverlay(directions.createPolyline()); // Creates a car marker that is moved along the route. var car:DisplayObject = new Car(); marker = new Marker(route.startGeocode.point, new MarkerOptions({ icon: car, iconOffset: new Point(-car.width / 2, -car.height) })); addOverlay(marker); transformPolyToWorld(); createCumulativeArrays(); // Load Panoramio data for the region covered by the route. loadPanoramioData(directions.bounds); var duration:Number = route.duration; // Start a timer that will trigger the car moving after the lead in time. var leadInTimer:Timer = new Timer(LEAD_IN_DURATION * 1000, 1); leadInTimer.addEventListener(TimerEvent.TIMER, onLeadInDone); leadInTimer.start(); var flyTime:Number = -LEAD_IN_DURATION; // Set up the camera flight trajectory. for each (var flyStep:Object in FLY_TRAJECTORY) { var time:Number = flyStep.fraction * duration; var center:LatLng = latLngAt(time); var scaledTime:Number = time * SCALE_TIME; var zoom:Number = flyStep.zoom; var attitude:Attitude = flyStep.attitude; var elapsed:Number = scaledTime - flyTime; flyTime = scaledTime; flyTo(center, zoom, attitude, elapsed); } } /** * Loads Panoramio data for the route bounds. We load data about more photos * than we need, then select a subset lying along the route. * @param bounds Bounds within which to fetch images. */ private function loadPanoramioData(bounds:LatLngBounds):void { var params:Object = { order: "popularity", set: "full", from: "0", to: NUM_GEOTAGGED_PHOTOS.toString(10), size: "small", minx: bounds.getWest(), miny: bounds.getSouth(), maxx: bounds.getEast(), maxy: bounds.getNorth() }; var loader:URLLoader = new URLLoader(); var request:URLRequest = new URLRequest( "http://www.panoramio.com/map/get_panoramas.php?" + paramsToString(params)); loader.addEventListener(Event.COMPLETE, onPanoramioDataLoaded); loader.addEventListener(IOErrorEvent.IO_ERROR, onPanoramioDataFailed); loader.load(request); } /** * Transforms the route polyline to world coordinates. */ private function transformPolyToWorld():void { var numVertices:int = polyline.getVertexCount(); worldPoly = new Array(numVertices); for (var i:int = 0; i < numVertices; ++i) { var vertex:LatLng = polyline.getVertex(i); worldPoly[i] = fromLatLngToPoint(vertex, 0); } } /** * Returns the time at which the route approaches closest to the * given point. * @param world Point in world coordinates. * @return Route time at which the closest approach occurs. */ private function getTimeOfClosestApproach(world:Point):Number { var minDistSqr:Number = Number.MAX_VALUE; var numVertices:int = worldPoly.length; var x:Number = world.x; var y:Number = world.y; var minVertex:int = 0; for (var i:int = 0; i < numVertices; ++i) { var dx:Number = worldPoly[i].x - x; var dy:Number = worldPoly[i].y - y; var distSqr:Number = dx * dx + dy * dy; if (distSqr < minDistSqr) { minDistSqr = distSqr; minVertex = i; } } return cumulativeVertexDistance[minVertex]; } /** * Returns the array index of the first element that compares greater than * the given value. * @param ordered Ordered array of elements. * @param value Value to use for comparison. * @return Array index of the first element that compares greater than * the given value. */ private function upperBound(ordered:Array, value:Number, first:int=0, last:int=-1):int { if (last < 0) { last = ordered.length; } var count:int = last - first; var index:int; while (count > 0) { var step:int = count >> 1; index = first + step; if (value >= ordered[index]) { first = index + 1; count -= step - 1; } else { count = step; } } return first; } /** * Selects up to a given number of photos approximately evenly spaced along * the route. * @param ordered Array of photos, each of which is an object with * a property &apos;closestTime&apos;. * @param number Number of photos to select. */ private function selectEvenlySpacedPhotos(ordered:Array, number:int):Array { var start:Number = cumulativeVertexDistance[0]; var end:Number = cumulativeVertexDistance[cumulativeVertexDistance.length - 2]; var closestTimes:Array = []; for each (var photo:Object in ordered) { closestTimes.push(photo.closestTime); } var selectedPhotos:Array = []; for (var i:int = 0; i < number; ++i) { var idealTime:Number = start + ((end - start) * (i + 0.5) / number); var index:int = upperBound(closestTimes, idealTime); if (index < 1) { index = 0; } else if (index >= ordered.length) { index = ordered.length - 1; } else { var errorToPrev:Number = Math.abs(idealTime - closestTimes[index - 1]); var errorToNext:Number = Math.abs(idealTime - closestTimes[index]); if (errorToPrev < errorToNext) { --index; } } selectedPhotos.push(ordered[index]); } return selectedPhotos; } /** * Handles completion of loading the Panoramio index data. Selects from the * returned photo indices a subset of those that lie along the route and * initiates load of each of these. * @param event Load completion event. */ private function onPanoramioDataLoaded(event:Event):void { var loader:URLLoader = event.target as URLLoader; var decoder:JSONDecoder = new JSONDecoder(loader.data as String); var allPhotos:Array = decoder.getValue().photos; for each (var photo:Object in allPhotos) { var latLng:LatLng = new LatLng(photo.latitude, photo.longitude); photo.closestTime = getTimeOfClosestApproach(fromLatLngToPoint(latLng, 0)); } allPhotos.sortOn("closestTime", Array.NUMERIC); photos = selectEvenlySpacedPhotos(allPhotos, NUM_SHOWN_PHOTOS); for each (photo in photos) { var photoLoader:Loader = new Loader(); // The images aren&apos;t on panoramio.com: we can&apos;t acquire pixel access // using "new LoaderContext(true)". photoLoader.load( new URLRequest(photo.photo_file_url)); photo.loader = photoLoader; // Save the loader info: we use this to find the original element when // the load completes. photo.loaderInfo = photoLoader.contentLoaderInfo; photoLoader.contentLoaderInfo.addEventListener( Event.COMPLETE, onPhotoLoaded); } } /** * Creates a MouseEvent listener function that will navigate to the given * URL in a new window. * @param url URL to which to navigate. */ private function createOnClickUrlOpener(url:String):Function { return function(event:MouseEvent):void { navigateToURL(new URLRequest(url)); }; } /** * Handles completion of loading an individual Panoramio image. * Adds a custom marker that displays the image. Initially this is made * invisible so that it can be faded in as needed. * @param event Load completion event. */ private function onPhotoLoaded(event:Event):void { var loaderInfo:LoaderInfo = event.target as LoaderInfo; // We need to find which photo element this image corresponds to. for each (var photo:Object in photos) { if (loaderInfo == photo.loaderInfo) { var imageMarker:Sprite = createImageMarker(photo.loader, photo.owner_name, photo.owner_url); var options:MarkerOptions = new MarkerOptions({ icon: imageMarker, hasShadow: true, iconAlignment: MarkerOptions.ALIGN_BOTTOM | MarkerOptions.ALIGN_LEFT }); var latLng:LatLng = new LatLng(photo.latitude, photo.longitude); var marker:Marker = new Marker(latLng, options); photo.marker = marker; addOverlay(marker); // A hack: we add the actual image after the overlay has been added, // which creates the shadow, so that the shadow is valid even if we // don&apos;t have security privileges to generate the shadow from the // image. marker.foreground.visible = false; marker.shadow.alpha = 0; var imageHolder:Sprite = new Sprite(); imageHolder.addChild(photo.loader); imageHolder.buttonMode = true; imageHolder.addEventListener( MouseEvent.CLICK, createOnClickUrlOpener(photo.photo_url)); imageMarker.addChild(imageHolder); return; } } trace("An image was loaded which could not be found in the photo array."); } /** * Creates a custom marker showing an image. */ private function createImageMarker(child:DisplayObject, ownerName:String, ownerUrl:String):Sprite { var content:Sprite = new Sprite(); var panoramioIcon:Bitmap = new PanoramioIcon(); var iconHolder:Sprite = new Sprite(); iconHolder.addChild(panoramioIcon); iconHolder.buttonMode = true; iconHolder.addEventListener(MouseEvent.CLICK, onPanoramioIconClick); panoramioIcon.x = BORDER_L; panoramioIcon.y = BORDER_T; content.addChild(iconHolder); // NOTE: we add the image as a child only after we&apos;ve added the marker // to the map. Currently the API requires this if it&apos;s to generate the // shadow for unprivileged content. // Shrink the image, so that it doesn&apos;t obcure too much screen space. // Ideally, we&apos;d subsample, but we don&apos;t have pixel level access. child.scaleX = IMAGE_SCALE; child.scaleY = IMAGE_SCALE; var imageW:Number = child.width; var imageH:Number = child.height; child.x = BORDER_L + 30; child.y = BORDER_T + iconHolder.height + GAP_T; var authorField:TextField = new TextField(); authorField.autoSize = TextFieldAutoSize.LEFT; authorField.defaultTextFormat = new TextFormat("_sans", 12); authorField.text = "author:"; content.addChild(authorField); authorField.x = BORDER_L; authorField.y = BORDER_T + iconHolder.height + GAP_T + imageH + GAP_B; var ownerField:TextField = new TextField(); ownerField.autoSize = TextFieldAutoSize.LEFT; var textFormat:TextFormat = new TextFormat("_sans", 14, 0x0e5f9a); ownerField.defaultTextFormat = textFormat; ownerField.htmlText = "<a href=\"" + ownerUrl + "\" target=\"_blank\">" + ownerName + "</a>"; content.addChild(ownerField); ownerField.x = BORDER_L + authorField.width; ownerField.y = BORDER_T + iconHolder.height + GAP_T + imageH + GAP_B; var totalW:Number = BORDER_L + Math.max(imageW, ownerField.width + authorField.width) + BORDER_R; var totalH:Number = BORDER_T + iconHolder.height + GAP_T + imageH + GAP_B + ownerField.height + BORDER_B; content.graphics.beginFill(0xffffff); content.graphics.drawRoundRect(0, 0, totalW, totalH, 10, 10); content.graphics.endFill(); var marker:Sprite = new Sprite(); marker.addChild(content); content.x = 30; content.y = 0; marker.graphics.lineStyle(); marker.graphics.beginFill(0xff0000); marker.graphics.drawCircle(0, totalH + 30, 3); marker.graphics.endFill(); marker.graphics.lineStyle(2, 0xffffff); marker.graphics.moveTo(30 + 10, totalH - 10); marker.graphics.lineTo(0, totalH + 30); return marker; } /** * Handles click on the Panoramio icon. */ private function onPanoramioIconClick(event:MouseEvent):void { navigateToURL(new URLRequest(PANORAMIO_HOME)); } /** * Handles failure of a Panoramio image load. */ private function onPanoramioDataFailed(event:IOErrorEvent):void { trace("Load of image failed: " + event); } /** * Returns a string containing cgi query parameters. * @param Associative array mapping query parameter key to value. * @return String containing cgi query parameters. */ private static function paramsToString(params:Object):String { var result:String = ""; var separator:String = ""; for (var key:String in params) { result += separator + encodeURIComponent(key) + "=" + encodeURIComponent(params[key]); separator = "&"; } return result; } /** * Called once the lead-in flight is done. Starts the car driving along * the route and starts a timer to begin fade in of the Panoramio * images in 1.5 seconds. */ private function onLeadInDone(event:Event):void { // Set startTimer non-zero so that the car starts to move. startTimer = getTimer(); // Start a timer that will fade in the Panoramio images. var fadeInTimer:Timer = new Timer(1500, 1); fadeInTimer.addEventListener(TimerEvent.TIMER, onFadeInTimer); fadeInTimer.start(); } /** * Handles the fade in timer&apos;s TIMER event. Sets markerAlpha above zero * which causes the frame enter handler to fade in the markers. */ private function onFadeInTimer(event:Event):void { markerAlpha = 0.01; } /** * The end time of the flight. */ private function get endTime():Number { if (!cumulativeStepDuration || cumulativeStepDuration.length == 0) { return startTimer; } return startTimer + cumulativeStepDuration[cumulativeStepDuration.length - 1]; } /** * Creates the cumulative arrays, cumulativeStepDuration and * cumulativeVertexDistance. */ private function createCumulativeArrays():void { cumulativeStepDuration = new Array(route.numSteps + 1); cumulativeVertexDistance = new Array(polyline.getVertexCount() + 1); var polylineTotal:Number = 0; var total:Number = 0; var numVertices:int = polyline.getVertexCount(); for (var stepIndex:int = 0; stepIndex < route.numSteps; ++stepIndex) { cumulativeStepDuration[stepIndex] = total; total += route.getStep(stepIndex).duration; var startVertex:int = stepIndex >= 0 ? route.getStep(stepIndex).polylineIndex : 0; var endVertex:int = stepIndex < (route.numSteps - 1) ? route.getStep(stepIndex + 1).polylineIndex : numVertices; var duration:Number = route.getStep(stepIndex).duration; var stepVertices:int = endVertex - startVertex; var latLng:LatLng = polyline.getVertex(startVertex); for (var vertex:int = startVertex; vertex < endVertex; ++vertex) { cumulativeVertexDistance[vertex] = polylineTotal; if (vertex < numVertices - 1) { var nextLatLng:LatLng = polyline.getVertex(vertex + 1); polylineTotal += nextLatLng.distanceFrom(latLng); } latLng = nextLatLng; } } cumulativeStepDuration[stepIndex] = total; } /** * Opens the info window above the car icon that details the given * step of the driving directions. * @param stepIndex Index of the current step. */ private function openInfoForStep(stepIndex:int):void { // Sets the content of the info window. var content:String; if (stepIndex >= route.numSteps) { content = "<b>" + route.endGeocode.address + "</b>" + "<br /><br />" + route.summaryHtml; } else { content = "<b>" + stepIndex + ".</b> " + route.getStep(stepIndex).descriptionHtml; } marker.openInfoWindow(new InfoWindowOptions({ contentHTML: content })); } /** * Displays the driving directions step appropriate for the given time. * Opens the info window showing the step instructions each time we * progress to a new step. * @param time Time for which to display the step. */ private function displayStepAt(time:Number):void { var stepIndex:int = upperBound(cumulativeStepDuration, time) - 1; var minStepIndex:int = 0; var maxStepIndex:int = route.numSteps - 1; if (stepIndex >= 0 && stepIndex <= maxStepIndex && currentStepIndex != stepIndex) { openInfoForStep(stepIndex); currentStepIndex = stepIndex; } } /** * Returns the LatLng at which the car should be positioned at the given * time. * @param time Time for which LatLng should be found. * @return LatLng. */ private function latLngAt(time:Number):LatLng { var stepIndex:int = upperBound(cumulativeStepDuration, time) - 1; var minStepIndex:int = 0; var maxStepIndex:int = route.numSteps - 1; if (stepIndex < minStepIndex) { return route.startGeocode.point; } else if (stepIndex > maxStepIndex) { return route.endGeocode.point; } var stepStart:Number = cumulativeStepDuration[stepIndex]; var stepEnd:Number = cumulativeStepDuration[stepIndex + 1]; var stepFraction:Number = (time - stepStart) / (stepEnd - stepStart); var startVertex:int = route.getStep(stepIndex).polylineIndex; var endVertex:int = (stepIndex + 1) < route.numSteps ? route.getStep(stepIndex + 1).polylineIndex : polyline.getVertexCount(); var stepVertices:int = endVertex - startVertex; var stepLeng

    Read the article

  • Getting TypeError: Error #1009: Cannot access a property or method of a null object reference.

    - by nemade-vipin
    hello friends, I have created small application for login in flex desktop application. In which I am refering webservice method for login for this have created the Authentication class. Now I want to refer different Textinput value for mobile no and Textinput value for password. In my Authentication class. for this I have created the object of mxml class.And using this I am getting the mobile no value and password value in My Action script class. This my code :- SBTS.mxml file xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" public function login():void { var User:Authentication; User = new Authentication(); User.authentication(); } ]] text=" Select Child."/ Action script class :- package src { import adobe.utils.XMLUI; import generated.webservices.*; import mx.collections.ArrayCollection; import mx.controls.Alert; import mx.rpc.events.FaultEvent; public class Authentication { [ Bindable] private var childName:ArrayCollection; [ Bindable] private var childId:ArrayCollection; private var photoFeed:ArrayCollection; private var arrayOfchild:Array; private var newEntry:GetSBTSMobileAuthentication; public var user:SBTSWebService; public var mxmlobj:SBTS; public function authentication():void { user = new SBTSWebService(); if(user!=null) { user.addSBTSWebServiceFaultEventListener(handleFaults); user.addgetSBTSMobileAuthenticationEventListener(authenticationResult); newEntry = new GetSBTSMobileAuthentication(); if(newEntry!=null) { mxmlobj = new SBTS(); if(mxmlobj != null) { newEntry.mobile = mxmlobj.mobileno.text; // Getting error here error mention below newEntry.password= mxmlobj.password.text; } user.getSBTSMobileAuthentication(newEntry); } } } public function handleFaults(event:FaultEvent):void { Alert.show( "A fault occured contacting the server. Fault message is: " + event.fault.faultString); } public function authenticationResult(event:GetSBTSMobileAuthenticationResultEvent):void { if(event.result != null && event.result._return0) { if(event.result._return 0) { var UserId:int = event.result._return; if(mxmlobj != null) { mxmlobj.loginform.enabled = false; mxmlobj.viewstack2.selectedIndex=1; } } else { Alert.show( "Authentication fail"); } } } } } I am getting this error :- TypeError: Error #1009: Cannot access a property or method of a null object reference. at SBTSBusineesObject::Authentication/authentication()[E:\Users\User1\Documents\Fl ex Builder 3\SBTS\src\SBTSBusineesObject\Authentication.as:35] at SBTS/login()[E:\Users\User1\Documents\Flex Builder 3\SBTS\src\SBTS.mxml:12] at SBTS/___SBTS_Button1_click()[E:\Users\User1\Documents\Flex Builder 3\SBTS\src\SBTS.mxml:27] please help me to remove this error.

    Read the article

  • problem to genrate swf file.

    - by nemade-vipin
    hello friend I have created one flex Air application where I have created the one authentication actionscript class. and one mxml file.This complete application using webservice and google map API. but when I am building application it is not genrating the SWF file in bin-debug folder. that is changes not reflecting in our application. my code is:- Action script class is :- package src { import adobe.utils.XMLUI; import mx.rpc.events.FaultEvent; import mx.controls.Alert; import generated.webservices.*; import mx.collections.ArrayCollection; public class Authentication { [Bindable] private var childName:ArrayCollection; [Bindable] private var childId:ArrayCollection; private var photoFeed:ArrayCollection; private var arrayOfchild:Array; private var newEntry:GetSBTSMobileAuthentication; public function authentication():void { // Instantiate a new Entry object. user = new SBTSWebService(); if(user!=null) { user.addSBTSWebServiceFaultEventListener(handleFaults); user.addgetSBTSMobileAuthenticationEventListener(authenticationResult); newEntry = new GetSBTSMobileAuthentication(); if(newEntry!=null) { newEntry.mobile=mobileno.text; newEntry.password=password.text; user.getSBTSMobileAuthentication(newEntry); } } } public function handleFaults(event:FaultEvent):void { Alert.show("A fault occured contacting the server. Fault message is: " + event.fault.faultString); } public function authenticationResult(event:GetSBTSMobileAuthenticationResultEvent):void { if(event.result != null && event.result._return>0) { if(event.result._return > 0) { var UserId:int = event.result._return; loginform.enabled = false; //getChildList(UserId); viewstack2.selectedIndex=1; } else { Alert.show("Authentication fail"); } } } } } mxml file is :- import src.Authentication; var user:Authentication = new Authentication(); ]]> <mx:TabNavigator id="viewstack2" selectedIndex="0" creationPolicy="all" width="100%" height="100%"> <mx:Form label="Login Form" id="loginform"> <mx:FormItem label="Mobile NO:"> <mx:TextInput id="mobileno"/> </mx:FormItem> <mx:FormItem label="Password:"> <mx:TextInput displayAsPassword="true" id="password" /> </mx:FormItem> <mx:FormItem> <mx:Button label="Login" click="user.authentication()"/> </mx:FormItem> </mx:Form> <mx:Form label="Child List"> <mx:Label width="100%" color="blue" text="Select Child."/> </mx:Form> <mx:Form label="Child Information"> </mx:Form> <mx:Form label="Bus Location"> </mx:Form> <mx:Form label="Bus path"> </mx:Form> </mx:TabNavigator> </mx:Panel>

    Read the article

1 2  | Next Page >