Search Results

Search found 262 results on 11 pages for 'lp'.

Page 1/11 | 1 2 3 4 5 6 7 8 9 10 11  | Next Page >

  • Delay between printing via lp in opensuse

    - by adamweeks
    I am experiencing a 10-15 second delay when printing multiple documents to a barcode printer in opensuse. I have had the same setup on other systems with older versions of opensuse without any issue. The setup is as follows: The print queue is setup as a "generic with driver Raw Queue". The files being sent down to the printers are simple text files with the lp command: lp -dprinter1 /path/file The printer is a JetDirect compatible device (Intermec brand) with a standard 9100 port socket setup. If I send a multi-page document to the printer, it will print nonstop the multiple pages. If I send 2 or more text files down via separate "lp" commands, the delay will be there between each printout. I've tried multiple different printers and they all experience the same issue.

    Read the article

  • Unable to run Internet explorer 7 on Wine 1.2, ubuntu 8.04

    - by leva
    Following the instructions here: http://www.wine-reviews.net/wine-reviews/applications/ie-7-on-linux-with-wine.html I installed IE7. But when I run it with Wine 1.2 with: wine iexplore.exe& I get: Explorer$ fixme:system:SetProcessDPIAware stub! fixme:heap:HeapSetInformation (nil) 1 (nil) 0 fixme:advapi:RegisterTraceGuidsW (0x5b9f97, 0x6f4b08, {3e1fd72a-c323-4574-9917-5ce9c936f78c}, 1, 0x32f414, (null), (null), 0x6f4b10,) fixme:advapi:RegisterTraceGuidsW (0x5b9f97, 0x6f4b28, {afff9c82-5be3-4205-9b3e-49e014c09a63}, 1, 0x32f414, (null), (null), 0x6f4b30,) fixme:advapi:RegisterTraceGuidsW (0x6cd15f38, 0x6cd20180, {e2821408-c59d-418f-ad3f-aa4e792aeb79}, 1, 0x32f260, (null), (null), 0x6cd20188,) fixme:process:RegisterApplicationRestart (L"-restart /WERRESTART",0) err:ntdll:NtQueryInformationToken Unhandled Token Information class 18! fixme:ole:CoInitializeSecurity ((nil),-1,(nil),(nil),2,3,(nil),0,(nil)) - stub! fixme:advapi:RegisterTraceGuidsA (0x5e00187b, 0x5e0155f8, {1fb3f43f-4827-46e5-89e2-b398580357a3}, 1, 0x32da50, (null), (null), 0x5e015600,) fixme:advapi:RegisterTraceGuidsA (0x5e00187b, 0x5e015618, {7c0334a1-4635-4d95-8d76-9cf3171ac618}, 1, 0x32da50, (null), (null), 0x5e015620,) err:rebar:REBAR_WindowProc unknown msg 200b wp=00000000 lp=0050069c fixme:msimtf:DllGetClassObject ({50d5107a-d278-4871-8989-f4ceaaf59cfc} {00000001-0000-0000-c000-000000000046} 0x32dfb4) err:ole:apartment_getclassobject DllGetClassObject returned error 0x80040111 err:ole:CoGetClassObject no class object {50d5107a-d278-4871-8989-f4ceaaf59cfc} could be created for context 0x401 fixme:urlmon:ZoneMgrImpl_GetIESecurityState (0x143f20)->(1, 0x32c4b4, (nil), 0) stub fixme:urlmon:SecManagerImpl_ProcessUrlAction Unsupported arguments fixme:shdocvw:IEParseDisplayNameWithBCW stub: 0x0 L"http://go.microsoft.com/fwlink/?LinkId=74005" 0x14d030 0x32d560 err:comboex:COMBOEX_WindowProc unknown msg 200b wp=00000000 lp=0032dd20 err:toolbar:ToolbarWindowProc unknown msg 200b wp=00000000 lp=0032db18 err:ole:CoGetClassObject class {807c1e6c-1d00-453f-b920-b61bb7cdd997} not registered err:ole:CoGetClassObject no class object {807c1e6c-1d00-453f-b920-b61bb7cdd997} could be created for context 0x1 err:rebar:REBAR_WindowProc unknown msg 200b wp=00000000 lp=005a2b88 fixme:urlmon:SecManagerImpl_ProcessUrlAction Unsupported arguments fixme:shdocvw:IEParseDisplayNameWithBCW stub: 0x0 L"http://go.microsoft.com/fwlink/?LinkId=74005" 0x131468 0x158d2f4 err:comboex:COMBOEX_WindowProc unknown msg 200b wp=00000000 lp=0032de7c err:toolbar:ToolbarWindowProc unknown msg 200b wp=00000000 lp=0032dc74 fixme:urlmon:Uri_IsEqual (0x165ae8)->(0x165210 0x32c164) err:comboex:COMBOEX_WindowProc unknown msg 200b wp=00000000 lp=0032d6dc err:toolbar:ToolbarWindowProc unknown msg 200b wp=00000000 lp=0032d4d4 err:rebar:REBAR_WindowProc unknown msg 200b wp=00000000 lp=005a2b88 err:comboex:COMBOEX_WindowProc unknown msg 200b wp=00000000 lp=0032d6dc err:toolbar:ToolbarWindowProc unknown msg 200b wp=00000000 lp=0032d4d4 err:rebar:REBAR_WindowProc unknown msg 200b wp=00000000 lp=005a2b88 err:rebar:REBAR_WindowProc unknown msg 200b wp=00000000 lp=004a796c fixme:toolbar:TOOLBAR_CheckStyle [0x10122] TBSTYLE_REGISTERDROP not implemented fixme:toolbar:TOOLBAR_CheckStyle [0x10122] TBSTYLE_REGISTERDROP not implemented fixme:toolbar:TOOLBAR_Unkwn45D hwnd=0x10122, wParam=0x00000000, size.cx=1280, size.cy=1020 stub! fixme:toolbar:TOOLBAR_CheckStyle [0x10122] TBSTYLE_REGISTERDROP not implemented fixme:wininet:InternetSetOptionW Option INTERNET_OPTION_RESET_URLCACHE_SESSION: STUB fixme:urlmon:Uri_GetScheme (0x1728a8)->(0x32e310) fixme:urlmon:Uri_GetScheme (0x18e400)->(0x32e310) fixme:shell:SignalFileOpen (0x00000000):stub. fixme:ole:NdrCorrelationInitialize (0x158e808, 0x158e408, 1024, 0x0): stub fixme:rpc:NdrStubCall2 new correlation description not implemented fixme:ole:NdrCorrelationFree (0x158e808): stub fixme:ole:NdrCorrelationInitialize (0x32d098, 0x32cc98, 1024, 0x0): stub fixme:rpc:NdrStubCall2 new correlation description not implemented fixme:ole:NdrCorrelationFree (0x32d098): stub err:comboex:COMBOEX_WindowProc unknown msg 200b wp=00000000 lp=0032d02c err:toolbar:ToolbarWindowProc unknown msg 200b wp=00000000 lp=0032ce24 err:rebar:REBAR_WindowProc unknown msg 200b wp=00000000 lp=005a2b88 err:comboex:COMBOEX_WindowProc unknown msg 200b wp=00000000 lp=0032d52c err:toolbar:ToolbarWindowProc unknown msg 200b wp=00000000 lp=0032d324 err:rebar:REBAR_WindowProc unknown msg 200b wp=00000000 lp=005a2b88 fixme:shdocvw:IEParseDisplayNameWithBCW stub: 0x0 L"http://google.ca/" 0x197e00 0x17fe9e4 err:comboex:COMBOEX_WindowProc unknown msg 200b wp=00000000 lp=0032d48c err:toolbar:ToolbarWindowProc unknown msg 200b wp=00000000 lp=0032d284 err:rebar:REBAR_WindowProc unknown msg 200b wp=00000000 lp=005a2b88 err:comboex:COMBOEX_WindowProc unknown msg 200b wp=00000000 lp=0032d52c err:toolbar:ToolbarWindowProc unknown msg 200b wp=00000000 lp=0032d324 err:rebar:REBAR_WindowProc unknown msg 200b wp=00000000 lp=005a2b88 err:comboex:COMBOEX_WindowProc unknown msg 200b wp=00000000 lp=0032d4d4 err:toolbar:ToolbarWindowProc unknown msg 200b wp=00000000 lp=0032d2cc err:rebar:REBAR_WindowProc unknown msg 200b wp=00000000 lp=005a2b88 err:comboex:COMBOEX_WindowProc unknown msg 200b wp=00000000 lp=0032d52c err:toolbar:ToolbarWindowProc unknown msg 200b wp=00000000 lp=0032d324 err:rebar:REBAR_WindowProc unknown msg 200b wp=00000000 lp=005a2b88 err:comboex:COMBOEX_WindowProc unknown msg 200b wp=00000000 lp=0032d4d4 err:toolbar:ToolbarWindowProc unknown msg 200b wp=00000000 lp=0032d2cc err:rebar:REBAR_WindowProc unknown msg 200b wp=00000000 lp= And I am unable to open any webpages. How can I fix this?

    Read the article

  • Using Zebra LP 2844-Z over the network

    - by Jason Kealey
    Hello, I am looking for a network-based label printer. I am looking at this Zebra LP-2844-Z printer. Unfortunately, it does not come with a network interface like the lower-end LP 2824 Plus. The ZebraNet 10/100 Print Server is both expensive for what it does (~$600) and only seems to support wireless networking, not wired. I prefer wired for reliability. Questions: Can I use a cheaper off-the-shelf print server to turn the LP-2844Z to a network printer. Would I get any trouble communicating with the printer via its own programming language or via OPOS? (instead of the Windows driver) Are cheaper print servers reliable? Would I be better to get another printer model that has it built in directly to avoid having issues due to the print server? What other printer would you recommend?

    Read the article

  • Move a sphere along the swipe?

    - by gameOne
    I am trying to get a sphere curl based on the swipe. I know this has been asked many times, but still it's yearning to be answered. I have managed to add force on the direction of the swipe and it works near perfect. I also have all the swipe positions stored in a list. Now I would like to know how can the curl be achieved. I believe the the curve in the swipe can be calculated by the Vector dot product If theta is 0, then there is no need to add the swipe. If it is not, then add the curl. Maybe this condition is redundant if I managed to find how to curl the sphere along the swipe position The code that adds the force to sphere based on the swipe direction is as below: using UnityEngine; using System.Collections; using System.Collections.Generic; public class SwipeControl : MonoBehaviour { //First establish some variables private Vector3 fp; //First finger position private Vector3 lp; //Last finger position private Vector3 ip; //some intermediate finger position private float dragDistance; //Distance needed for a swipe to register public float power; private Vector3 footballPos; private bool canShoot = true; private float factor = 40f; private List<Vector3> touchPositions = new List<Vector3>(); void Start(){ dragDistance = Screen.height*20/100; Physics.gravity = new Vector3(0, -20, 0); footballPos = transform.position; } // Update is called once per frame void Update() { //Examine the touch inputs foreach (Touch touch in Input.touches) { /*if (touch.phase == TouchPhase.Began) { fp = touch.position; lp = touch.position; }*/ if (touch.phase == TouchPhase.Moved) { touchPositions.Add(touch.position); } if (touch.phase == TouchPhase.Ended) { fp = touchPositions[0]; lp = touchPositions[touchPositions.Count-1]; ip = touchPositions[touchPositions.Count/2]; //First check if it's actually a drag if (Mathf.Abs(lp.x - fp.x) > dragDistance || Mathf.Abs(lp.y - fp.y) > dragDistance) { //It's a drag //Now check what direction the drag was //First check which axis if (Mathf.Abs(lp.x - fp.x) > Mathf.Abs(lp.y - fp.y)) { //If the horizontal movement is greater than the vertical movement... if ((lp.x>fp.x) && canShoot) //If the movement was to the right) { //Right move float x = (lp.x - fp.x) / Screen.height * factor; rigidbody.AddForce((new Vector3(x,10,16))*power); Debug.Log("right "+(lp.x-fp.x));//MOVE RIGHT CODE HERE canShoot = false; //rigidbody.AddForce((new Vector3((lp.x-fp.x)/30,10,16))*power); StartCoroutine(ReturnBall()); } else { //Left move float x = (lp.x - fp.x) / Screen.height * factor; rigidbody.AddForce((new Vector3(x,10,16))*power); Debug.Log("left "+(lp.x-fp.x));//MOVE LEFT CODE HERE canShoot = false; //rigidbody.AddForce(new Vector3((lp.x-fp.x)/30,10,16)*power); StartCoroutine(ReturnBall()); } } else { //the vertical movement is greater than the horizontal movement if (lp.y>fp.y) //If the movement was up { //Up move float y = (lp.y-fp.y)/Screen.height*factor; float x = (lp.x - fp.x) / Screen.height * factor; rigidbody.AddForce((new Vector3(x,y,16))*power); Debug.Log("up "+(lp.x-fp.x));//MOVE UP CODE HERE canShoot = false; //rigidbody.AddForce(new Vector3((lp.x-fp.x)/30,10,16)*power); StartCoroutine(ReturnBall()); } else { //Down move Debug.Log("down "+lp+" "+fp);//MOVE DOWN CODE HERE } } } else { //It's a tap Debug.Log("none");//TAP CODE HERE } } } } IEnumerator ReturnBall() { yield return new WaitForSeconds(5.0f); rigidbody.velocity = Vector3.zero; rigidbody.angularVelocity = Vector3.zero; transform.position = footballPos; canShoot =true; isKicked = false; } }

    Read the article

  • linux piping ( convert -> pdf2ps -> lp)

    - by Bor
    Ok, so I can print a pdf doing: pdf2ps file.pdf - | lp -s But now I want to use convert to merge several pdf files, I can do this with: convert file1.pdf file2.pdf merged.pdf which merges file1.pdf and file2.pdf into merged.pdf, target can be replaced with '-'. Question How could I pipe convert into pdf2ps and then into lp though?

    Read the article

  • What is the way to submit a patch to fix all the damage that LP: #600941 causes?

    - by nutznboltz
    What is the best way to submit a patch to fix all the damage that LP: #600941 causes? I ask because LP: #600941 was put into every version of Ubuntu still supported at this time. Should I pick a particular version and run ubuntu-bug on it? Should that version be the LTS or Oneiric or Precise (how can I get Precise if I need it?) The story is that after it was pushed out all of our systems started experiencing Nagios nrpe restart failures. Commands like /etc/init.d/nagios-nrpe-server restart would cause nrpe to stop but not restart. I tracked this down to the way that the /etc/init.d/nagios-nrpe-server script is calling start-stop-daemon. The issue is that the "stop" stanza in the /etc/init.d/nagios-nrpe-server script first calls start-stop-daemon which sends SIGTERM to nrpe and then waits only for one second. If nrpe has not exited by that time the pid file will still exist and the /etc/init.d/nagios-nrpe-server script will remove it. Worse if /etc/init.d/nagios-nrpe-server restart is used not only will the pid file be removed, the attempt to restart nrpe will fail provided that the nrpe daemon is still tardy in shutting down. The attempt to start under those circumstances will fail because nrpe will still be bound to a socket and the second attempt at binding will cause the nrpe startup to abort. They should have wondered why there was a comment about "sometimes the pid file does not get removed". They should have tested on systems that have a heavy load and therefore slow nrpe response times. The fix is to add --retry 10 or such to the invocation of start-stop-daemon ... --stop ... Thanks

    Read the article

  • Why won't my Broadcom BCM4312 LP-PHY work with the STA driver?

    - by Jackson Taylor
    I tried the steps here for a 4312: https://help.ubuntu.com/community/WifiDocs/Driver/bcm43xx Both of these: sudo modprobe -r b43 ssb wl sudo modprobe wl return: FATAL: Module wl not found. FATAL: Error running install command for wl (this one is only for the second one actually) I tried the broadcom-sta, didn't work. What's confusing is down below in the next steps for STA with internet access it says to use the bcmwl one. So I install that and it succeeds but with some errors: sudo apt-get install bcmwl-kernel-source Reading package lists... Done Building dependency tree Reading state information... Done The following package was automatically installed and is no longer required: module-assistant Use 'apt-get autoremove' to remove it. The following NEW packages will be installed: bcmwl-kernel-source 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 0 B/1,181 kB of archives. After this operation, 3,609 kB of additional disk space will be used. Selecting previously unselected package bcmwl-kernel-source. (Reading database ... 168005 files and directories currently installed.) Unpacking bcmwl-kernel-source (from .../bcmwl-kernel-source_5.100.82.112+bdcom-0ubuntu3_amd64.deb) ... Setting up bcmwl-kernel-source (5.100.82.112+bdcom-0ubuntu3) ... Loading new bcmwl-5.100.82.112+bdcom DKMS files... Building only for 3.5.0-21-generic Building for architecture x86_64 Module build for the currently running kernel was skipped since the kernel source for this kernel does not seem to be installed. ERROR: Module b43 does not exist in /proc/modules ERROR: Module b43legacy does not exist in /proc/modules ERROR: Module ssb does not exist in /proc/modules ERROR: Module bcm43xx does not exist in /proc/modules ERROR: Module brcm80211 does not exist in /proc/modules ERROR: Module brcmfmac does not exist in /proc/modules ERROR: Module brcmsmac does not exist in /proc/modules ERROR: Module bcma does not exist in /proc/modules FATAL: Module wl not found. FATAL: Error running install command for wl update-initramfs: deferring update (trigger activated) Processing triggers for initramfs-tools ... update-initramfs: Generating /boot/initrd.img-3.5.0-21-generic jtaylor991@jtaylor991-whiteHP:~$ sudo modprobe wl FATAL: Module wl not found. FATAL: Error running install command for wl Then I do the modprobe wl commands listed above and it gives the above listed errors. It didn't work with the broadcom-sta driver either. I installed the b43 ones but nothing happened, and I don't know why so those are still installed. firmware-b43legacy-installer, b43-fwcutter and firmware-b43-lpphy-installer (yes it is a LP-PHY) are currently installed. If I go into System Settings Software Sources Additional Drivers it says "Using Broadcom 802.11 Linux STA wireless driver source from bcmwl-kernel-source (proprietary) But bcmwl-kernel-source isn't installed. I could try again but I remember rebooting and it still said this. What's funny is it found wireless networks during the Ubuntu setup/installation, I don't remember if I got it to connect or not though. I think it kept asking for a password when I put it in (yes it was right I showed password and looked at it) so I just ignored it. But right now the Enable Wireless option in the top right is just gone, it's just Enable Networking and I'm on ethernet on this HP Pavilion dv4-1435dx right here. If I run rfkill list it shows: 0: hp-wifi: Wireless LAN Soft blocked: no Hard blocked: no It was hard blocked at the beginning but unblocking it makes no change. Also it's a touch sensitive button, and it appears to be always orange no matter if it's enabled or not because when I touch it the hard blocked changes between yes and no in rfkill list. I think it was blue for a minute at one point. What is going on?!?! Help me! Lol, thanks for any and all of your time guys. Oh yeah this is Ubuntu 12.10 fresh install.

    Read the article

  • Wifi installation issues on Ubuntu 10.10

    - by SlyrNemesis
    Linux newbie here, anyway so here is the problem, I run Ubuntu 10.10 and I have a Sitecom 300N x2 Wireless Network dongle with chipset 8192SU, I used ndiswrapper to install my Windows Wireless driver because Sitecom doesn't have a linux driver, it says hardware present but it doesn't find any Wireless networks, nor does it connect to one. What can I do? The command "dmesg | grep ndis" gave this output in the terminal: [ 9.999954] ndiswrapper version 1.56 loaded (smp=yes, preempt=no) [ 11.111901] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisAllocateNetBufferAndNetBufferList' [ 11.111973] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisMIndicateReceiveNetBufferLists' [ 11.112099] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisMRegisterMiniportDriver' [ 11.112161] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisAllocateMdl' [ 11.112220] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisMDeregisterMiniportDriver' [ 11.112280] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisFreeNetBufferListPool' [ 11.112339] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisAllocateNetBufferListPool' [ 11.112399] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisFreeMdl' [ 11.112457] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisMAllocatePort' [ 11.112515] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisMNetPnPEvent' [ 11.112573] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisMFreePort' [ 11.112631] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisMSendNetBufferListsComplete' [ 11.112780] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisMSetMiniportAttributes' [ 11.112848] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisOpenConfigurationEx' [ 11.112946] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisMIndicateStatusEx' [ 11.113017] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisMOidRequestComplete' [ 11.113112] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisAllocateMemoryWithTagPriority' [ 11.113200] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisAllocateIoWorkItem' [ 11.113271] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisFreeIoWorkItem' [ 11.113342] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisQueueIoWorkItem' [ 11.113413] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisFreeNetBufferList' [ 11.113481] ndiswrapper (import:233): unknown symbol: WDFLDR.SYS:'WdfVersionBind' [ 11.113547] ndiswrapper (import:233): unknown symbol: WDFLDR.SYS:'WdfVersionBindClass' [ 11.113613] ndiswrapper (import:233): unknown symbol: WDFLDR.SYS:'WdfVersionUnbindClass' [ 11.113680] ndiswrapper (import:233): unknown symbol: WDFLDR.SYS:'WdfVersionUnbind' [ 11.113742] ndiswrapper (load_sys_files:206): couldn't prepare driver 'net8192su' [ 11.148888] ndiswrapper (load_wrap_driver:108): couldn't load driver net8192su; check system log for messages from 'loadndisdriver' [ 11.365200] usbcore: registered new interface driver ndiswrapper [ 12.818573] Modules linked in: snd_wavefront snd_emu10k1(+) snd_cs4236 snd_usb_audio snd_wss_lib snd_opl3_lib snd_ac97_codec ac97_bus nouveau(+) snd_pcm i915 snd_usbmidi_lib snd_util_mem snd_page_alloc snd_hwdep snd_mpu401 snd_mpu401_uart snd_seq_midi snd_rawmidi ttm snd_seq_midi_event drm_kms_helper snd_seq ppdev snd_timer snd_seq_device drm ndiswrapper snd parport_pc emu10k1_gp intel_agp ns558 gameport soundcore i2c_algo_bit shpchp lp video output agpgart parport usbhid hid 8139too 8139cp mii floppy [ 12.819183] Modules linked in: snd_wavefront snd_emu10k1(+) snd_cs4236 snd_usb_audio snd_wss_lib snd_opl3_lib snd_ac97_codec ac97_bus nouveau(+) snd_pcm i915 snd_usbmidi_lib snd_util_mem snd_page_alloc snd_hwdep snd_mpu401 snd_mpu401_uart snd_seq_midi snd_rawmidi ttm snd_seq_midi_event drm_kms_helper snd_seq ppdev snd_timer snd_seq_device drm ndiswrapper snd parport_pc emu10k1_gp intel_agp ns558 gameport soundcore i2c_algo_bit shpchp lp video output agpgart parport usbhid hid 8139too 8139cp mii floppy [ 12.819796] Modules linked in: snd_wavefront snd_emu10k1(+) snd_cs4236 snd_usb_audio snd_wss_lib snd_opl3_lib snd_ac97_codec ac97_bus nouveau(+) snd_pcm i915 snd_usbmidi_lib snd_util_mem snd_page_alloc snd_hwdep snd_mpu401 snd_mpu401_uart snd_seq_midi snd_rawmidi ttm snd_seq_midi_event drm_kms_helper snd_seq ppdev snd_timer snd_seq_device drm ndiswrapper snd parport_pc emu10k1_gp intel_agp ns558 gameport soundcore i2c_algo_bit shpchp lp video output agpgart parport usbhid hid 8139too 8139cp mii floppy [ 12.820505] Modules linked in: snd_wavefront snd_emu10k1(+) snd_cs4236 snd_usb_audio snd_wss_lib snd_opl3_lib snd_ac97_codec ac97_bus nouveau(+) snd_pcm i915 snd_usbmidi_lib snd_util_mem snd_page_alloc snd_hwdep snd_mpu401 snd_mpu401_uart snd_seq_midi snd_rawmidi ttm snd_seq_midi_event drm_kms_helper snd_seq ppdev snd_timer snd_seq_device drm ndiswrapper snd parport_pc emu10k1_gp intel_agp ns558 gameport soundcore i2c_algo_bit shpchp lp video output agpgart parport usbhid hid 8139too 8139cp mii floppy [ 12.821115] Modules linked in: snd_wavefront snd_emu10k1(+) snd_cs4236 snd_usb_audio snd_wss_lib snd_opl3_lib snd_ac97_codec ac97_bus nouveau(+) snd_pcm i915 snd_usbmidi_lib snd_util_mem snd_page_alloc snd_hwdep snd_mpu401 snd_mpu401_uart snd_seq_midi snd_rawmidi ttm snd_seq_midi_event drm_kms_helper snd_seq ppdev snd_timer snd_seq_device drm ndiswrapper snd parport_pc emu10k1_gp intel_agp ns558 gameport soundcore i2c_algo_bit shpchp lp video output agpgart parport usbhid hid 8139too 8139cp mii floppy [ 12.821726] Modules linked in: snd_wavefront snd_emu10k1(+) snd_cs4236 snd_usb_audio snd_wss_lib snd_opl3_lib snd_ac97_codec ac97_bus nouveau(+) snd_pcm i915 snd_usbmidi_lib snd_util_mem snd_page_alloc snd_hwdep snd_mpu401 snd_mpu401_uart snd_seq_midi snd_rawmidi ttm snd_seq_midi_event drm_kms_helper snd_seq ppdev snd_timer snd_seq_device drm ndiswrapper snd parport_pc emu10k1_gp intel_agp ns558 gameport soundcore i2c_algo_bit shpchp lp video output agpgart parport usbhid hid 8139too 8139cp mii floppy [ 12.822339] Modules linked in: snd_wavefront snd_emu10k1(+) snd_cs4236 snd_usb_audio snd_wss_lib snd_opl3_lib snd_ac97_codec ac97_bus nouveau(+) snd_pcm i915 snd_usbmidi_lib snd_util_mem snd_page_alloc snd_hwdep snd_mpu401 snd_mpu401_uart snd_seq_midi snd_rawmidi ttm snd_seq_midi_event drm_kms_helper snd_seq ppdev snd_timer snd_seq_device drm ndiswrapper snd parport_pc emu10k1_gp intel_agp ns558 gameport soundcore i2c_algo_bit shpchp lp video output agpgart parport usbhid hid 8139too 8139cp mii floppy [ 12.822948] Modules linked in: snd_wavefront snd_emu10k1(+) snd_cs4236 snd_usb_audio snd_wss_lib snd_opl3_lib snd_ac97_codec ac97_bus nouveau(+) snd_pcm i915 snd_usbmidi_lib snd_util_mem snd_page_alloc snd_hwdep snd_mpu401 snd_mpu401_uart snd_seq_midi snd_rawmidi ttm snd_seq_midi_event drm_kms_helper snd_seq ppdev snd_timer snd_seq_device drm ndiswrapper snd parport_pc emu10k1_gp intel_agp ns558 gameport soundcore i2c_algo_bit shpchp lp video output agpgart parport usbhid hid 8139too 8139cp mii floppy [ 12.823560] Modules linked in: snd_wavefront snd_emu10k1(+) snd_cs4236 snd_usb_audio snd_wss_lib snd_opl3_lib snd_ac97_codec ac97_bus nouveau(+) snd_pcm i915 snd_usbmidi_lib snd_util_mem snd_page_alloc snd_hwdep snd_mpu401 snd_mpu401_uart snd_seq_midi snd_rawmidi ttm snd_seq_midi_event drm_kms_helper snd_seq ppdev snd_timer snd_seq_device drm ndiswrapper snd parport_pc emu10k1_gp intel_agp ns558 gameport soundcore i2c_algo_bit shpchp lp video output agpgart parport usbhid hid 8139too 8139cp mii floppy [ 12.824204] Modules linked in: snd_wavefront snd_emu10k1(+) snd_cs4236 snd_usb_audio snd_wss_lib snd_opl3_lib snd_ac97_codec ac97_bus nouveau(+) snd_pcm i915 snd_usbmidi_lib snd_util_mem snd_page_alloc snd_hwdep snd_mpu401 snd_mpu401_uart snd_seq_midi snd_rawmidi ttm snd_seq_midi_event drm_kms_helper snd_seq ppdev snd_timer snd_seq_device drm ndiswrapper snd parport_pc emu10k1_gp intel_agp ns558 gameport soundcore i2c_algo_bit shpchp lp video output agpgart parport usbhid hid 8139too 8139cp mii floppy

    Read the article

  • Wifi installation issues with a Sitecom 300N x2 Wireless Network dongle

    - by SlyrNemesis
    Linux newbie here, anyway so here is the problem, I run Ubuntu 10.10 and I have a Sitecom 300N x2 Wireless Network dongle with chipset 8192SU, I used ndiswrapper to install my Windows Wireless driver because Sitecom doesn't have a linux driver, it says hardware present but it doesn't find any Wireless networks, nor does it connect to one. What can I do? The command "dmesg | grep ndis" gave this output in the terminal: [ 9.999954] ndiswrapper version 1.56 loaded (smp=yes, preempt=no) [ 11.111901] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisAllocateNetBufferAndNetBufferList' [ 11.111973] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisMIndicateReceiveNetBufferLists' [ 11.112099] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisMRegisterMiniportDriver' [ 11.112161] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisAllocateMdl' [ 11.112220] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisMDeregisterMiniportDriver' [ 11.112280] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisFreeNetBufferListPool' [ 11.112339] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisAllocateNetBufferListPool' [ 11.112399] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisFreeMdl' [ 11.112457] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisMAllocatePort' [ 11.112515] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisMNetPnPEvent' [ 11.112573] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisMFreePort' [ 11.112631] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisMSendNetBufferListsComplete' [ 11.112780] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisMSetMiniportAttributes' [ 11.112848] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisOpenConfigurationEx' [ 11.112946] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisMIndicateStatusEx' [ 11.113017] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisMOidRequestComplete' [ 11.113112] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisAllocateMemoryWithTagPriority' [ 11.113200] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisAllocateIoWorkItem' [ 11.113271] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisFreeIoWorkItem' [ 11.113342] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisQueueIoWorkItem' [ 11.113413] ndiswrapper (import:233): unknown symbol: NDIS.SYS:'NdisFreeNetBufferList' [ 11.113481] ndiswrapper (import:233): unknown symbol: WDFLDR.SYS:'WdfVersionBind' [ 11.113547] ndiswrapper (import:233): unknown symbol: WDFLDR.SYS:'WdfVersionBindClass' [ 11.113613] ndiswrapper (import:233): unknown symbol: WDFLDR.SYS:'WdfVersionUnbindClass' [ 11.113680] ndiswrapper (import:233): unknown symbol: WDFLDR.SYS:'WdfVersionUnbind' [ 11.113742] ndiswrapper (load_sys_files:206): couldn't prepare driver 'net8192su' [ 11.148888] ndiswrapper (load_wrap_driver:108): couldn't load driver net8192su; check system log for messages from 'loadndisdriver' [ 11.365200] usbcore: registered new interface driver ndiswrapper [ 12.818573] Modules linked in: snd_wavefront snd_emu10k1(+) snd_cs4236 snd_usb_audio snd_wss_lib snd_opl3_lib snd_ac97_codec ac97_bus nouveau(+) snd_pcm i915 snd_usbmidi_lib snd_util_mem snd_page_alloc snd_hwdep snd_mpu401 snd_mpu401_uart snd_seq_midi snd_rawmidi ttm snd_seq_midi_event drm_kms_helper snd_seq ppdev snd_timer snd_seq_device drm ndiswrapper snd parport_pc emu10k1_gp intel_agp ns558 gameport soundcore i2c_algo_bit shpchp lp video output agpgart parport usbhid hid 8139too 8139cp mii floppy [ 12.819183] Modules linked in: snd_wavefront snd_emu10k1(+) snd_cs4236 snd_usb_audio snd_wss_lib snd_opl3_lib snd_ac97_codec ac97_bus nouveau(+) snd_pcm i915 snd_usbmidi_lib snd_util_mem snd_page_alloc snd_hwdep snd_mpu401 snd_mpu401_uart snd_seq_midi snd_rawmidi ttm snd_seq_midi_event drm_kms_helper snd_seq ppdev snd_timer snd_seq_device drm ndiswrapper snd parport_pc emu10k1_gp intel_agp ns558 gameport soundcore i2c_algo_bit shpchp lp video output agpgart parport usbhid hid 8139too 8139cp mii floppy [ 12.819796] Modules linked in: snd_wavefront snd_emu10k1(+) snd_cs4236 snd_usb_audio snd_wss_lib snd_opl3_lib snd_ac97_codec ac97_bus nouveau(+) snd_pcm i915 snd_usbmidi_lib snd_util_mem snd_page_alloc snd_hwdep snd_mpu401 snd_mpu401_uart snd_seq_midi snd_rawmidi ttm snd_seq_midi_event drm_kms_helper snd_seq ppdev snd_timer snd_seq_device drm ndiswrapper snd parport_pc emu10k1_gp intel_agp ns558 gameport soundcore i2c_algo_bit shpchp lp video output agpgart parport usbhid hid 8139too 8139cp mii floppy [ 12.820505] Modules linked in: snd_wavefront snd_emu10k1(+) snd_cs4236 snd_usb_audio snd_wss_lib snd_opl3_lib snd_ac97_codec ac97_bus nouveau(+) snd_pcm i915 snd_usbmidi_lib snd_util_mem snd_page_alloc snd_hwdep snd_mpu401 snd_mpu401_uart snd_seq_midi snd_rawmidi ttm snd_seq_midi_event drm_kms_helper snd_seq ppdev snd_timer snd_seq_device drm ndiswrapper snd parport_pc emu10k1_gp intel_agp ns558 gameport soundcore i2c_algo_bit shpchp lp video output agpgart parport usbhid hid 8139too 8139cp mii floppy [ 12.821115] Modules linked in: snd_wavefront snd_emu10k1(+) snd_cs4236 snd_usb_audio snd_wss_lib snd_opl3_lib snd_ac97_codec ac97_bus nouveau(+) snd_pcm i915 snd_usbmidi_lib snd_util_mem snd_page_alloc snd_hwdep snd_mpu401 snd_mpu401_uart snd_seq_midi snd_rawmidi ttm snd_seq_midi_event drm_kms_helper snd_seq ppdev snd_timer snd_seq_device drm ndiswrapper snd parport_pc emu10k1_gp intel_agp ns558 gameport soundcore i2c_algo_bit shpchp lp video output agpgart parport usbhid hid 8139too 8139cp mii floppy [ 12.821726] Modules linked in: snd_wavefront snd_emu10k1(+) snd_cs4236 snd_usb_audio snd_wss_lib snd_opl3_lib snd_ac97_codec ac97_bus nouveau(+) snd_pcm i915 snd_usbmidi_lib snd_util_mem snd_page_alloc snd_hwdep snd_mpu401 snd_mpu401_uart snd_seq_midi snd_rawmidi ttm snd_seq_midi_event drm_kms_helper snd_seq ppdev snd_timer snd_seq_device drm ndiswrapper snd parport_pc emu10k1_gp intel_agp ns558 gameport soundcore i2c_algo_bit shpchp lp video output agpgart parport usbhid hid 8139too 8139cp mii floppy [ 12.822339] Modules linked in: snd_wavefront snd_emu10k1(+) snd_cs4236 snd_usb_audio snd_wss_lib snd_opl3_lib snd_ac97_codec ac97_bus nouveau(+) snd_pcm i915 snd_usbmidi_lib snd_util_mem snd_page_alloc snd_hwdep snd_mpu401 snd_mpu401_uart snd_seq_midi snd_rawmidi ttm snd_seq_midi_event drm_kms_helper snd_seq ppdev snd_timer snd_seq_device drm ndiswrapper snd parport_pc emu10k1_gp intel_agp ns558 gameport soundcore i2c_algo_bit shpchp lp video output agpgart parport usbhid hid 8139too 8139cp mii floppy [ 12.822948] Modules linked in: snd_wavefront snd_emu10k1(+) snd_cs4236 snd_usb_audio snd_wss_lib snd_opl3_lib snd_ac97_codec ac97_bus nouveau(+) snd_pcm i915 snd_usbmidi_lib snd_util_mem snd_page_alloc snd_hwdep snd_mpu401 snd_mpu401_uart snd_seq_midi snd_rawmidi ttm snd_seq_midi_event drm_kms_helper snd_seq ppdev snd_timer snd_seq_device drm ndiswrapper snd parport_pc emu10k1_gp intel_agp ns558 gameport soundcore i2c_algo_bit shpchp lp video output agpgart parport usbhid hid 8139too 8139cp mii floppy [ 12.823560] Modules linked in: snd_wavefront snd_emu10k1(+) snd_cs4236 snd_usb_audio snd_wss_lib snd_opl3_lib snd_ac97_codec ac97_bus nouveau(+) snd_pcm i915 snd_usbmidi_lib snd_util_mem snd_page_alloc snd_hwdep snd_mpu401 snd_mpu401_uart snd_seq_midi snd_rawmidi ttm snd_seq_midi_event drm_kms_helper snd_seq ppdev snd_timer snd_seq_device drm ndiswrapper snd parport_pc emu10k1_gp intel_agp ns558 gameport soundcore i2c_algo_bit shpchp lp video output agpgart parport usbhid hid 8139too 8139cp mii floppy [ 12.824204] Modules linked in: snd_wavefront snd_emu10k1(+) snd_cs4236 snd_usb_audio snd_wss_lib snd_opl3_lib snd_ac97_codec ac97_bus nouveau(+) snd_pcm i915 snd_usbmidi_lib snd_util_mem snd_page_alloc snd_hwdep snd_mpu401 snd_mpu401_uart snd_seq_midi snd_rawmidi ttm snd_seq_midi_event drm_kms_helper snd_seq ppdev snd_timer snd_seq_device drm ndiswrapper snd parport_pc emu10k1_gp intel_agp ns558 gameport soundcore i2c_algo_bit shpchp lp video output agpgart parport usbhid hid 8139too 8139cp mii floppy

    Read the article

  • Mac OSX and root login enabled

    - by reza
    All I am running OSX 10.6.8 I have enabled root login through Directory Utility. I have assigned a password. I get an error when I try to ssh root@localhost. ssh -v root@localhost OpenSSH_5.2p1, OpenSSL 0.9.8r 8 Feb 2011 debug1: Reading configuration data /Users/rrazavipour-lp/.ssh/config debug1: Reading configuration data /etc/ssh_config debug1: Connecting to localhost [127.0.0.1] port 22. debug1: Connection established. debug1: identity file /Users/rrazavipour-lp/.ssh/identity type -1 debug1: identity file /Users/rrazavipour-lp/.ssh/id_rsa type 1 debug1: identity file /Users/rrazavipour-lp/.ssh/id_dsa type 2 debug1: Remote protocol version 2.0, remote software version OpenSSH_5.2 debug1: match: OpenSSH_5.2 pat OpenSSH* debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_5.2 debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: server->client aes128-ctr hmac-md5 none debug1: kex: client->server aes128-ctr hmac-md5 none debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP debug1: SSH2_MSG_KEX_DH_GEX_INIT sent debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY debug1: Host 'localhost' is known and matches the RSA host key. debug1: Found key in /Users/rrazavipour-lp/.ssh/known_hosts:47 debug1: ssh_rsa_verify: signature correct debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: SSH2_MSG_SERVICE_REQUEST sent debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey,keyboard-interactive debug1: Next authentication method: publickey debug1: Offering public key: /Users/rrazavipour-lp/.ssh/id_dsa debug1: Authentications that can continue: publickey,keyboard-interactive debug1: Trying private key: /Users/rrazavipour-lp/.ssh/identity debug1: Offering public key: /Users/rrazavipour-lp/.ssh/id_rsa debug1: Authentications that can continue: publickey,keyboard-interactive debug1: Next authentication method: keyboard-interactive Password: debug1: Authentications that can continue: publickey,keyboard-interactive debug1: Authentications that can continue: publickey,keyboard-interactive debug1: Authentications that can continue: publickey,keyboard-interactive debug1: No more authentication methods to try. Permission denied (publickey,keyboard-interactive). What I am doing wrong? I know I have the password correct.

    Read the article

  • Mysql - help me optimize this query

    - by sandeepan-nath
    About the system: -The system has a total of 8 tables - Users - Tutor_Details (Tutors are a type of User,Tutor_Details table is linked to Users) - learning_packs, (stores packs created by tutors) - learning_packs_tag_relations, (holds tag relations meant for search) - tutors_tag_relations and tags and orders (containing purchase details of tutor's packs), order_details linked to orders and tutor_details. For a more clear idea about the tables involved please check the The tables section in the end. -A tags based search approach is being followed.Tag relations are created when new tutors register and when tutors create packs (this makes tutors and packs searcheable). For details please check the section How tags work in this system? below. Following is a simpler representation (not the actual) of the more complex query which I am trying to optimize:- I have used statements like explanation of parts in the query select SUM(DISTINCT( t.tag LIKE "%Dictatorship%" )) as key_1_total_matches, SUM(DISTINCT( t.tag LIKE "%democracy%" )) as key_2_total_matches, td., u., count(distinct(od.id_od)), if (lp.id_lp > 0) then some conditional logic on lp fields else 0 as tutor_popularity from Tutor_Details AS td JOIN Users as u on u.id_user = td.id_user LEFT JOIN Learning_Packs_Tag_Relations AS lptagrels ON td.id_tutor = lptagrels.id_tutor LEFT JOIN Learning_Packs AS lp ON lptagrels.id_lp = lp.id_lp LEFT JOIN `some other tables on lp.id_lp - let's call learning pack tables set (including Learning_Packs table)` LEFT JOIN Order_Details as od on td.id_tutor = od.id_author LEFT JOIN Orders as o on od.id_order = o.id_order LEFT JOIN Tutors_Tag_Relations as ttagrels ON td.id_tutor = ttagrels.id_tutor JOIN Tags as t on (t.id_tag = ttagrels.id_tag) OR (t.id_tag = lptagrels.id_tag) where some condition on Users table's fields AND CASE WHEN ((t.id_tag = lptagrels.id_tag) AND (lp.id_lp 0)) THEN `some conditions on learning pack tables set` ELSE 1 END AND CASE WHEN ((t.id_tag = wtagrels.id_tag) AND (wc.id_wc 0)) THEN `some conditions on webclasses tables set` ELSE 1 END AND CASE WHEN (od.id_od0) THEN od.id_author = td.id_tutor and some conditions on Orders table's fields ELSE 1 END AND ( t.tag LIKE "%Dictatorship%" OR t.tag LIKE "%democracy%") group by td.id_tutor HAVING key_1_total_matches = 1 AND key_2_total_matches = 1 order by tutor_popularity desc, u.surname asc, u.name asc limit 0,20 ===================================================================== What does the above query do? Does AND logic search on the search keywords (2 in this example - "Democracy" and "Dictatorship"). Returns only those tutors for which both the keywords are present in the union of the two sets - tutors details and details of all the packs created by a tutor. To make things clear - Suppose a Tutor name "Sandeepan Nath" has created a pack "My first pack", then:- Searching "Sandeepan Nath" returns Sandeepan Nath. Searching "Sandeepan first" returns Sandeepan Nath. Searching "Sandeepan second" does not return Sandeepan Nath. ====================================================================================== The problem The results returned by the above query are correct (AND logic working as per expectation), but the time taken by the query on heavily loaded databases is like 25 seconds as against normal query timings of the order of 0.005 - 0.0002 seconds, which makes it totally unusable. It is possible that some of the delay is being caused because all the possible fields have not yet been indexed, but I would appreciate a better query as a solution, optimized as much as possible, displaying the same results ========================================================================================== How tags work in this system? When a tutor registers, tags are entered and tag relations are created with respect to tutor's details like name, surname etc. When a Tutors create packs, again tags are entered and tag relations are created with respect to pack's details like pack name, description etc. tag relations for tutors stored in tutors_tag_relations and those for packs stored in learning_packs_tag_relations. All individual tags are stored in tags table. ==================================================================== The tables Most of the following tables contain many other fields which I have omitted here. CREATE TABLE IF NOT EXISTS users ( id_user int(10) unsigned NOT NULL AUTO_INCREMENT, name varchar(100) NOT NULL DEFAULT '', surname varchar(155) NOT NULL DEFAULT '', PRIMARY KEY (id_user) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=636 ; CREATE TABLE IF NOT EXISTS tutor_details ( id_tutor int(10) NOT NULL AUTO_INCREMENT, id_user int(10) NOT NULL DEFAULT '0', PRIMARY KEY (id_tutor), KEY Users_FKIndex1 (id_user) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=51 ; CREATE TABLE IF NOT EXISTS orders ( id_order int(10) unsigned NOT NULL AUTO_INCREMENT, PRIMARY KEY (id_order), KEY Orders_FKIndex1 (id_user), ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=275 ; ALTER TABLE orders ADD CONSTRAINT Orders_ibfk_1 FOREIGN KEY (id_user) REFERENCES users (id_user) ON DELETE NO ACTION ON UPDATE NO ACTION; CREATE TABLE IF NOT EXISTS order_details ( id_od int(10) unsigned NOT NULL AUTO_INCREMENT, id_order int(10) unsigned NOT NULL DEFAULT '0', id_author int(10) NOT NULL DEFAULT '0', PRIMARY KEY (id_od), KEY Order_Details_FKIndex1 (id_order) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=284 ; ALTER TABLE order_details ADD CONSTRAINT Order_Details_ibfk_1 FOREIGN KEY (id_order) REFERENCES orders (id_order) ON DELETE NO ACTION ON UPDATE NO ACTION; CREATE TABLE IF NOT EXISTS learning_packs ( id_lp int(10) unsigned NOT NULL AUTO_INCREMENT, id_author int(10) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (id_lp), KEY Learning_Packs_FKIndex2 (id_author), KEY id_lp (id_lp) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=23 ; CREATE TABLE IF NOT EXISTS tags ( id_tag int(10) unsigned NOT NULL AUTO_INCREMENT, tag varchar(255) DEFAULT NULL, PRIMARY KEY (id_tag), UNIQUE KEY tag (tag), KEY id_tag (id_tag), KEY tag_2 (tag), KEY tag_3 (tag) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3419 ; CREATE TABLE IF NOT EXISTS tutors_tag_relations ( id_tag int(10) unsigned NOT NULL DEFAULT '0', id_tutor int(10) DEFAULT NULL, KEY Tutors_Tag_Relations (id_tag), KEY id_tutor (id_tutor), KEY id_tag (id_tag) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; ALTER TABLE tutors_tag_relations ADD CONSTRAINT Tutors_Tag_Relations_ibfk_1 FOREIGN KEY (id_tag) REFERENCES tags (id_tag) ON DELETE NO ACTION ON UPDATE NO ACTION; CREATE TABLE IF NOT EXISTS learning_packs_tag_relations ( id_tag int(10) unsigned NOT NULL DEFAULT '0', id_tutor int(10) DEFAULT NULL, id_lp int(10) unsigned DEFAULT NULL, KEY Learning_Packs_Tag_Relations_FKIndex1 (id_tag), KEY id_lp (id_lp), KEY id_tag (id_tag) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; ALTER TABLE learning_packs_tag_relations ADD CONSTRAINT Learning_Packs_Tag_Relations_ibfk_1 FOREIGN KEY (id_tag) REFERENCES tags (id_tag) ON DELETE NO ACTION ON UPDATE NO ACTION; =================================================================================== Following is the exact query (this includes classes also - tutors can create classes and search terms are matched with classes created by tutors):- select count(distinct(od.id_od)) as tutor_popularity, CASE WHEN (IF((wc.id_wc 0), ( wc.wc_api_status = 1 AND wc.wc_type = 0 AND wc.class_date '2010-06-01 22:00:56' AND wccp.status = 1 AND (wccp.country_code='IE' or wccp.country_code IN ('INT'))), 0)) THEN 1 ELSE 0 END as 'classes_published', CASE WHEN (IF((lp.id_lp 0), (lp.id_status = 1 AND lp.published = 1 AND lpcp.status = 1 AND (lpcp.country_code='IE' or lpcp.country_code IN ('INT'))),0)) THEN 1 ELSE 0 END as 'packs_published', td . * , u . * from Tutor_Details AS td JOIN Users as u on u.id_user = td.id_user LEFT JOIN Learning_Packs_Tag_Relations AS lptagrels ON td.id_tutor = lptagrels.id_tutor LEFT JOIN Learning_Packs AS lp ON lptagrels.id_lp = lp.id_lp LEFT JOIN Learning_Packs_Categories AS lpc ON lpc.id_lp_cat = lp.id_lp_cat LEFT JOIN Learning_Packs_Categories AS lpcp ON lpcp.id_lp_cat = lpc.id_parent LEFT JOIN Learning_Pack_Content as lpct on (lp.id_lp = lpct.id_lp) LEFT JOIN Webclasses_Tag_Relations AS wtagrels ON td.id_tutor = wtagrels.id_tutor LEFT JOIN WebClasses AS wc ON wtagrels.id_wc = wc.id_wc LEFT JOIN Learning_Packs_Categories AS wcc ON wcc.id_lp_cat = wc.id_wp_cat LEFT JOIN Learning_Packs_Categories AS wccp ON wccp.id_lp_cat = wcc.id_parent LEFT JOIN Order_Details as od on td.id_tutor = od.id_author LEFT JOIN Orders as o on od.id_order = o.id_order LEFT JOIN Tutors_Tag_Relations as ttagrels ON td.id_tutor = ttagrels.id_tutor JOIN Tags as t on (t.id_tag = ttagrels.id_tag) OR (t.id_tag = lptagrels.id_tag) OR (t.id_tag = wtagrels.id_tag) where (u.country='IE' or u.country IN ('INT')) AND CASE WHEN ((t.id_tag = lptagrels.id_tag) AND (lp.id_lp 0)) THEN lp.id_status = 1 AND lp.published = 1 AND lpcp.status = 1 AND (lpcp.country_code='IE' or lpcp.country_code IN ('INT')) ELSE 1 END AND CASE WHEN ((t.id_tag = wtagrels.id_tag) AND (wc.id_wc 0)) THEN wc.wc_api_status = 1 AND wc.wc_type = 0 AND wc.class_date '2010-06-01 22:00:56' AND wccp.status = 1 AND (wccp.country_code='IE' or wccp.country_code IN ('INT')) ELSE 1 END AND CASE WHEN (od.id_od0) THEN od.id_author = td.id_tutor and o.order_status = 'paid' and CASE WHEN (od.id_wc 0) THEN od.can_attend_class=1 ELSE 1 END ELSE 1 END AND 1 group by td.id_tutor order by tutor_popularity desc, u.surname asc, u.name asc limit 0,20 Please note - The provided database structure does not show all the fields and tables as in this query

    Read the article

  • .htaccess redirect for www in parent folder and children react

    - by ServerChecker
    We were having a problem with the Norton seal not showing up on our affiliate marketing landing pages (landers). Turns out, the Norton seal was super picky about the "www." prefix. I had folder paths like /lp/cmpx where x was a number 1-100 and indicated advertising campaign number. So, to remedy this, I stuck this in my .htaccess file right after the RewriteEngine On line: RewriteCond %{HTTP_HOST} ^example\.com RewriteRule ^(.*)$ http://www.example.com/lp/cmp1/$1 [R=302,QSA,NC,L] Trouble is, I had to do that under every campaign folder, changing cmp1 to whatever the folder name was. Therefore, my question is... Is there a way I can do this with an .htaccess file under the parent folder (/lp in this case) and it will work for each of the children? EDIT: Note that I stuck an .htaccess file in /lp just now to test: RewriteEngine On RewriteCond %{HTTP_HOST} ^example\.com RewriteRule ^(.*)$ http://www.example.com/lp/$1 [R=302,QSA,NC,L] This yielded no effect to the /lp/cmpx folders underneath, to my dismay.

    Read the article

  • Can I using cross-site XmlHttpRequest in Itunes LP environment?

    - by jameulrich
    Itunes is based on Webkit platform and we can't use cross-site XmlHttpRequest in JavaScript because of security policy. But, as a exception, we can do that with a special header. Here is source code and I did it successfully in Safari: /////////////// var url = 'http://mysite.net/canvas.php'; var mybody = "Arun"; var http = new XMLHttpRequest(); http.open("POST", url, true); http.setRequestHeader("X-PINGOTHER", "pingpong"); http.setRequestHeader('Content-Type', 'application/xml'); http.setRequestHeader("Content-length", mybody.length); http.setRequestHeader("Connection", "close"); http.send(mybody); /////////////// I sent xml data to my server and get return response successfully in Safari browser but i can't do it in iTunes LP environment. So what is the problems?

    Read the article

  • Structuring Win32 GUI code

    - by kraf
    I wish to improve my code and file structure in larger Win32 projects with plenty of windows and controls. Currently, I tend to have one header and one source file for the entire implementation of a window or dialog. This works fine for small projects, but now it has come to the point where these implementations are starting to reach 1000-2000 lines, which is tedious to browse. A typical source file of mine looks like this: static LRESULT CALLBACK on_create(const HWND hwnd, WPARAM wp, LPARAM lp) { setup_menu(hwnd); setup_list(hwnd); setup_context_menu(hwnd); /* clip */ return 0; } static LRESULT CALLBACK on_notify(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) { const NMHDR* header = (const NMHDR*)lp; /* At this point I feel that the control's event handlers doesn't * necessarily belong in the same source file. Perhaps I could move * each control's creation code and event handlers into a separate * source file? Good practice or cause of confusion? */ switch (header->idFrom) { case IDC_WINDOW_LIST: switch (header->code) { case NM_RCLICK: return on_window_list_right_click(hwnd, wp, lp); /* clip */ } } } static LRESULT CALLBACK wndmain_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) { switch (msg) { case WM_CREATE: return on_create(hwnd, wp, lp); case WM_CLOSE: return on_close(hwnd, wp, lp); case WM_NOTIFY: return on_notify(hwnd, wp, lp); /* It doesn't matter much how the window proc looks as it just forwards * events to the appropriate handler. */ /* clip */ default: return DefWindowProc(hwnd, msg, wp, lp); } } But now as the window has a lot more controls, and these controls in turn have their own message handlers, and then there's the menu click handlers, and so on... I'm getting lost, and I really need advice on how to structure this mess up in a good and sensible way. I have tried to find good open source examples of structuring Win32 code, but I just get more confused since there are hundreds of files, and within each of these files that seem GUI related, the Win32 GUI code seems so far encapsulated away. And when I finally find a CreateWindowEx statement, the window proc is nowhere to be found. Any advice on how to structure all the code while remaining sane would be greatly appreciated. Thanks! I don't wish to use any libraries or frameworks as I find the Win32 API interesting and valuable for learning. Any insight into how you structure your own GUI code could perhaps serve as inspiration.

    Read the article

  • Downloading source via bazaar

    - by beanaroo
    Forgive me if this is a stupid question or an inapproptiate place to ask. This is my first time attempting to download source by means of bazaar (launchpad). Regardless of the package or branch... I always get an error like the following: bzr: ERROR: Revision {[email protected]} not present in "Graph(StackedParentsProvider(bzrlib.repository._LazyListJoin(([CachingParentsProvider(None)], []))))". I have looked all over and cannot find an answer. What does this mean? How can I resolve it? Many thanks. ---edit--- Ubuntu 12.10 running BZR-2.6.0Commands include but are not limited to: bzr branch lp:ubuntu/quantal-proposed/ubiquity bzr branch lp:ubuntu/quantal/ubiquity bzr branch lp:ubuntu/quantal/ubiquity-slideshow-ubuntu bzr branch lp:nano (just to test) bzr branch lp:ubuntu/quantal/transmission (just to test)

    Read the article

  • Mysql - Help me change this single complex query to use temporary tables

    - by sandeepan-nath
    About the system: - There are tutors who create classes and packs - A tags based search approach is being followed.Tag relations are created when new tutors register and when tutors create packs (this makes tutors and packs searcheable). For details please check the section How tags work in this system? below. Following is the concerned query Can anybody help me suggest an approach using temporary tables. We have indexed all the relevant fields and it looks like this is the least time possible with this approach:- SELECT SUM(DISTINCT( t.tag LIKE "%Dictatorship%" OR tt.tag LIKE "%Dictatorship%" OR ttt.tag LIKE "%Dictatorship%" )) AS key_1_total_matches , SUM(DISTINCT( t.tag LIKE "%democracy%" OR tt.tag LIKE "%democracy%" OR ttt.tag LIKE "%democracy%" )) AS key_2_total_matches , COUNT(DISTINCT( od.id_od )) AS tutor_popularity, CASE WHEN ( IF(( wc.id_wc > 0 ), ( wc.wc_api_status = 1 AND wc.wc_type = 0 AND wc.class_date > '2010-06-01 22:00:56' AND wccp.status = 1 AND ( wccp.country_code = 'IE' OR wccp.country_code IN ( 'INT' ) ) ), 0) ) THEN 1 ELSE 0 END AS 'classes_published' , CASE WHEN ( IF(( lp.id_lp > 0 ), ( lp.id_status = 1 AND lp.published = 1 AND lpcp.status = 1 AND ( lpcp.country_code = 'IE' OR lpcp.country_code IN ( 'INT' ) ) ), 0) ) THEN 1 ELSE 0 END AS 'packs_published', td . *, u . * FROM tutor_details AS td JOIN users AS u ON u.id_user = td.id_user LEFT JOIN learning_packs_tag_relations AS lptagrels ON td.id_tutor = lptagrels.id_tutor LEFT JOIN learning_packs AS lp ON lptagrels.id_lp = lp.id_lp LEFT JOIN learning_packs_categories AS lpc ON lpc.id_lp_cat = lp.id_lp_cat LEFT JOIN learning_packs_categories AS lpcp ON lpcp.id_lp_cat = lpc.id_parent LEFT JOIN learning_pack_content AS lpct ON ( lp.id_lp = lpct.id_lp ) LEFT JOIN webclasses_tag_relations AS wtagrels ON td.id_tutor = wtagrels.id_tutor LEFT JOIN webclasses AS wc ON wtagrels.id_wc = wc.id_wc LEFT JOIN learning_packs_categories AS wcc ON wcc.id_lp_cat = wc.id_wp_cat LEFT JOIN learning_packs_categories AS wccp ON wccp.id_lp_cat = wcc.id_parent LEFT JOIN order_details AS od ON td.id_tutor = od.id_author LEFT JOIN orders AS o ON od.id_order = o.id_order LEFT JOIN tutors_tag_relations AS ttagrels ON td.id_tutor = ttagrels.id_tutor LEFT JOIN tags AS t ON t.id_tag = ttagrels.id_tag LEFT JOIN tags AS tt ON tt.id_tag = lptagrels.id_tag LEFT JOIN tags AS ttt ON ttt.id_tag = wtagrels.id_tag WHERE ( u.country = 'IE' OR u.country IN ( 'INT' ) ) AND CASE WHEN ( ( tt.id_tag = lptagrels.id_tag ) AND ( lp.id_lp > 0 ) ) THEN lp.id_status = 1 AND lp.published = 1 AND lpcp.status = 1 AND ( lpcp.country_code = 'IE' OR lpcp.country_code IN ( 'INT' ) ) ELSE 1 END AND CASE WHEN ( ( ttt.id_tag = wtagrels.id_tag ) AND ( wc.id_wc > 0 ) ) THEN wc.wc_api_status = 1 AND wc.wc_type = 0 AND wc.class_date > '2010-06-01 22:00:56' AND wccp.status = 1 AND ( wccp.country_code = 'IE' OR wccp.country_code IN ( 'INT' ) ) ELSE 1 END AND CASE WHEN ( od.id_od > 0 ) THEN od.id_author = td.id_tutor AND o.order_status = 'paid' AND CASE WHEN ( od.id_wc > 0 ) THEN od.can_attend_class = 1 ELSE 1 END ELSE 1 END AND ( t.tag LIKE "%Dictatorship%" OR t.tag LIKE "%democracy%" OR tt.tag LIKE "%Dictatorship%" OR tt.tag LIKE "%democracy%" OR ttt.tag LIKE "%Dictatorship%" OR ttt.tag LIKE "%democracy%" ) GROUP BY td.id_tutor HAVING key_1_total_matches = 1 AND key_2_total_matches = 1 ORDER BY tutor_popularity DESC, u.surname ASC, u.name ASC LIMIT 0, 20 The problem The results returned by the above query are correct (AND logic working as per expectation), but the time taken by the query rises alarmingly for heavier data and for the current data I have it is like 10 seconds as against normal query timings of the order of 0.005 - 0.0002 seconds, which makes it totally unusable. Somebody suggested in my previous question to do the following:- create a temporary table and insert here all relevant data that might end up in the final result set run several updates on this table, joining the required tables one at a time instead of all of them at the same time finally perform a query on this temporary table to extract the end result All this was done in a stored procedure, the end result has passed unit tests, and is blazing fast. I have never worked with temporary tables till now. Only if I could get some hints, kind of schematic representations so that I can start with... Is there something faulty with the query? What can be the reason behind 10+ seconds of execution time? How tags work in this system? When a tutor registers, tags are entered and tag relations are created with respect to tutor's details like name, surname etc. When a Tutors create packs, again tags are entered and tag relations are created with respect to pack's details like pack name, description etc. tag relations for tutors stored in tutors_tag_relations and those for packs stored in learning_packs_tag_relations. All individual tags are stored in tags table. The explain query output:- Please see this screenshot - http://www.test.examvillage.com/Explain_query_improved.jpg

    Read the article

  • Mysql - help me optimize this query (improved question)

    - by sandeepan-nath
    About the system: - There are tutors who create classes and packs - A tags based search approach is being followed.Tag relations are created when new tutors register and when tutors create packs (this makes tutors and packs searcheable). For details please check the section How tags work in this system? below. Following is the concerned query SELECT SUM(DISTINCT( t.tag LIKE "%Dictatorship%" )) AS key_1_total_matches, SUM(DISTINCT( t.tag LIKE "%democracy%" )) AS key_2_total_matches, COUNT(DISTINCT( od.id_od )) AS tutor_popularity, CASE WHEN ( IF(( wc.id_wc > 0 ), ( wc.wc_api_status = 1 AND wc.wc_type = 0 AND wc.class_date > '2010-06-01 22:00:56' AND wccp.status = 1 AND ( wccp.country_code = 'IE' OR wccp.country_code IN ( 'INT' ) ) ), 0) ) THEN 1 ELSE 0 END AS 'classes_published', CASE WHEN ( IF(( lp.id_lp > 0 ), ( lp.id_status = 1 AND lp.published = 1 AND lpcp.status = 1 AND ( lpcp.country_code = 'IE' OR lpcp.country_code IN ( 'INT' ) ) ), 0) ) THEN 1 ELSE 0 END AS 'packs_published', td . *, u . * FROM tutor_details AS td JOIN users AS u ON u.id_user = td.id_user LEFT JOIN learning_packs_tag_relations AS lptagrels ON td.id_tutor = lptagrels.id_tutor LEFT JOIN learning_packs AS lp ON lptagrels.id_lp = lp.id_lp LEFT JOIN learning_packs_categories AS lpc ON lpc.id_lp_cat = lp.id_lp_cat LEFT JOIN learning_packs_categories AS lpcp ON lpcp.id_lp_cat = lpc.id_parent LEFT JOIN learning_pack_content AS lpct ON ( lp.id_lp = lpct.id_lp ) LEFT JOIN webclasses_tag_relations AS wtagrels ON td.id_tutor = wtagrels.id_tutor LEFT JOIN webclasses AS wc ON wtagrels.id_wc = wc.id_wc LEFT JOIN learning_packs_categories AS wcc ON wcc.id_lp_cat = wc.id_wp_cat LEFT JOIN learning_packs_categories AS wccp ON wccp.id_lp_cat = wcc.id_parent LEFT JOIN order_details AS od ON td.id_tutor = od.id_author LEFT JOIN orders AS o ON od.id_order = o.id_order LEFT JOIN tutors_tag_relations AS ttagrels ON td.id_tutor = ttagrels.id_tutor JOIN tags AS t ON ( t.id_tag = ttagrels.id_tag ) OR ( t.id_tag = lptagrels.id_tag ) OR ( t.id_tag = wtagrels.id_tag ) WHERE ( u.country = 'IE' OR u.country IN ( 'INT' ) ) AND CASE WHEN ( ( t.id_tag = lptagrels.id_tag ) AND ( lp.id_lp 0 ) ) THEN lp.id_status = 1 AND lp.published = 1 AND lpcp.status = 1 AND ( lpcp.country_code = 'IE' OR lpcp.country_code IN ( 'INT' ) ) ELSE 1 END AND CASE WHEN ( ( t.id_tag = wtagrels.id_tag ) AND ( wc.id_wc 0 ) ) THEN wc.wc_api_status = 1 AND wc.wc_type = 0 AND wc.class_date '2010-06-01 22:00:56' AND wccp.status = 1 AND ( wccp.country_code = 'IE' OR wccp.country_code IN ( 'INT' ) ) ELSE 1 END AND CASE WHEN ( od.id_od 0 ) THEN od.id_author = td.id_tutor AND o.order_status = 'paid' AND CASE WHEN ( od.id_wc 0 ) THEN od.can_attend_class = 1 ELSE 1 END ELSE 1 END GROUP BY td.id_tutor HAVING key_1_total_matches = 1 AND key_2_total_matches = 1 ORDER BY tutor_popularity DESC, u.surname ASC, u.name ASC LIMIT 0, 20 The problem The results returned by the above query are correct (AND logic working as per expectation), but the time taken by the query rises alarmingly for heavier data and for the current data I have it is like 25 seconds as against normal query timings of the order of 0.005 - 0.0002 seconds, which makes it totally unusable. It is possible that some of the delay is being caused because all the possible fields have not yet been indexed. The tag field of tags table is indexed. Is there something faulty with the query? What can be the reason behind 20+ seconds of execution time? How tags work in this system? When a tutor registers, tags are entered and tag relations are created with respect to tutor's details like name, surname etc. When a Tutors create packs, again tags are entered and tag relations are created with respect to pack's details like pack name, description etc. tag relations for tutors stored in tutors_tag_relations and those for packs stored in learning_packs_tag_relations. All individual tags are stored in tags table. The explain query output:- Please see this screenshot - http://www.test.examvillage.com/Explain_query.jpg

    Read the article

  • Whats wrong with this piece of code?

    - by cambr
    vector<int>& mergesort(vector<int> &a) { if (a.size() == 1) return a; int middle = a.size() / 2; vector<int>::const_iterator first = a.begin(); vector<int>::const_iterator mid = a.begin() + (middle - 1); vector<int>::const_iterator last = a.end(); vector<int> ll(first, mid); vector<int> rr(mid, last); vector<int> l = mergesort(ll); vector<int> r = mergesort(rr); vector<int> result; result.reserve(a.size()); int dp = 0, lp = 0, rp = 0; while (dp < a.size()) { if (lp == l.size()) { result[dp] = (r[rp]); rp++; } else if (rp == r.size()) { result[dp] = (l[lp]); lp++; } else if (l[lp] < r[rp]) { result[dp] = (l[lp]); lp++; } else { result[dp] = (r[rp]); rp++; } dp++; } a = result; return a; } It compiles coorectly but while execution, I am getting: This application has requested the runtime to end it in an unusual way. This is a weird error. Is there something that is fundamentally wrong with the code?

    Read the article

  • Problem with Mergesort in C++

    - by cambr
    vector<int>& mergesort(vector<int> &a) { if (a.size() == 1) return a; int middle = a.size() / 2; vector<int>::const_iterator first = a.begin(); vector<int>::const_iterator mid = a.begin() + (middle - 1); vector<int>::const_iterator last = a.end(); vector<int> ll(first, mid); vector<int> rr(mid, last); vector<int> l = mergesort(ll); vector<int> r = mergesort(rr); vector<int> result; result.reserve(a.size()); int dp = 0, lp = 0, rp = 0; while (dp < a.size()) { if (lp == l.size()) { result[dp] = (r[rp]); rp++; } else if (rp == r.size()) { result[dp] = (l[lp]); lp++; } else if (l[lp] < r[rp]) { result[dp] = (l[lp]); lp++; } else { result[dp] = (r[rp]); rp++; } dp++; } a = result; return a; } It compiles correctly but while execution, I am getting: This application has requested the runtime to end it in an unusual way. This is a weird error. Is there something that is fundamentally wrong with the code?

    Read the article

  • How to make my robot move in a rectangular path along the black tape?

    - by Sahat
    I am working on a robot, it's part of the summer robotics workshop in our college. We are using C-STAMP micro controllers by A-WIT. I was able to make it move, turn left, turn right, move backward. I have even managed to make it go along the black tape using a contrast sensor. I send the robot at 30-45 degrees toward the black tape on the table and it aligns itself and starts to move along the black tape. It jerks a little, probably due to my programming logic below, it's running a while loop and constantly checking if statements, so it ends up trying to turn left and right every few milliseconds, which explains the jerking part. But it's okay, it works, not as smooth as I want it to work but it works! Problem is that I can't make my robot go into a rectangular path of the black tape. As soon as it reaches the corner it just keeps going straight instead of making a left/right turn. Here's my attempt. The following code is just part of the code. My 2 sensors are located right underneath the robot, next to the front wheel, almost at the floor level. It has "index" value ranging from 0 to 8. I believe it's 8 when you have a lot of light coming into the sensor , and 0 when it's nearly pitch black. So when the robot moves into the black-tape-zone, the index value drops, and based on that I have an if-statement telling my robot to either turn left or right. To avoid confusion I didn't post the entire source code, but only the logical part responsible for the movement of my robot along the black tape. while(1) { // don't worry about these. // 10 and 9 represent Sensor's PIN location on the motherboard V = ANALOGIN(10, 1, 0, 0, 0); V2 = ANALOGIN(9, 1, 0, 0, 0); // i got this "formula" from the example in my Manual. // V stands for voltage of the sensor. // it gives me the index value of the sensor. 0 = darkest, 8 = lightest. index = ((-(V - 5) / 5) * 8 + 0.5); index2 = ((-(V2 - 5) / 5) * 8 + 0.5); // i've tweaked the position of the sensors so index > 7 is just right number. // the robot will move anywhere on the table just fine with index > 7. // as soon as it drops to or below 7 (i.e. finds black tape), the robot will // either turn left or right and then go forward. // lp & rp represent left-wheel pin and right-wheel pin, 1 means run forever. // if i change it from 1 to 100, it will go forward for 100ms. if (index > 7 && index2 > 7) goForward(lp, rp, 1); if (index <= 7) { turnLeft(lp, rp, 1); goForward(lp, rp, 1); // this is the tricky part. i've added this code last minute // trying to make my robot turn, but i didn't work. if (index > 4) { turnLeft(lp, rp, 1); goForward(lp, rp, 1); } } else if (index2 <= 7) { turnRight(lp, rp, 1); goForward(lp, rp, 1); // this is also the last minute addition. it's same code as above // but it's for the 2nd sensor. if (index2 > 4) { turnRight(lp, rp, 1); goForward(lp, rp, 1); } } I've spent the entire day trying to figure it out. I've pretty much exhausted all avenues. Asking for the solution on stackoverflow is my very last option now. Thanks in advance! If you have any questions about the code, let me know, but comments should be self-explanatory.

    Read the article

  • flash core engine by Dinesh [closed]

    - by hdinesh
    This post was a dump of the following code (without the highlights). No question, just a dump. Please update this q. with a real question to have it reopened. You (the asker) risk to be flagged as spammer (if not already) and a bad reputation. This is a q/a site, not a site to promote your own code libraries. package facers { import flash.display.*; import flash.events.*; import flash.geom.ColorTransform; import flash.utils.Dictionary; import org.papervision3d.cameras.*; import org.papervision3d.scenes.*; import org.papervision3d.objects.*; import org.papervision3d.objects.special.*; import org.papervision3d.objects.primitives.*; import org.papervision3d.materials.*; import org.papervision3d.events.FileLoadEvent; import org.papervision3d.materials.special.*; import org.papervision3d.materials.shaders.*; import org.papervision3d.materials.utils.*; import org.papervision3d.lights.*; import org.papervision3d.render.*; import org.papervision3d.view.*; import org.papervision3d.events.InteractiveScene3DEvent; import org.papervision3d.events.*; import org.papervision3d.core.utils.*; import org.papervision3d.core.geom.renderables.Vertex3D; import caurina.transitions.*; public class Main extends Sprite { public var viewport :BasicView; public var displayObject :DisplayObject3D; private var light :PointLight3D; private var shadowPlane :Plane; private var dataArray :Array; private var material :BitmapFileMaterial; private var planeByContainer :Dictionary = new Dictionary(); private var paperSize :Number = 0.5; private var cloudSize :Number = 1500; private var rotSize :Number = 360; private var maxAlbums :Number = 50; private var num :Number = 0; public function Main():void { trace("START APPLICATION"); viewport = new BasicView(1024, 690, true, true, CameraType.FREE); viewport.camera.zoom = 50; viewport.camera.extra = { goPosition: new DisplayObject3D(),goTarget: new DisplayObject3D() }; addChild(viewport); displayObject = new DisplayObject3D(); viewport.scene.addChild(displayObject); createAlbum(); addEventListener(Event.ENTER_FRAME, onRenderEvent); } private function createAlbum() { dataArray = new Array("images/thums/pic1.jpg", "images/thums/pic2.jpg", "images/thums/pic3.jpg", "images/thums/pic4.jpg", "images/thums/pic5.jpg", "images/thums/pic6.jpg", "images/thums/pic7.jpg", "images/thums/pic8.jpg", "images/thums/pic9.jpg", "images/thums/pic10.jpg", "images/thums/pic1.jpg", "images/thums/pic2.jpg", "images/thums/pic3.jpg", "images/thums/pic4.jpg", "images/thums/pic5.jpg", "images/thums/pic6.jpg", "images/thums/pic7.jpg", "images/thums/pic8.jpg", "images/thums/pic9.jpg", "images/thums/pic10.jpg"); for (var i:int = 0; i < dataArray.length; i++) { material = new BitmapFileMaterial(dataArray[i]); material.doubleSided = true; material.addEventListener(FileLoadEvent.LOAD_COMPLETE, loadMaterial); } } public function loadMaterial(event:Event) { var plane:Plane = new Plane(material, 300, 180); displayObject.addChild(plane); var _x:int = Math.random() * cloudSize - cloudSize/2; var _y:int = Math.random() * cloudSize - cloudSize/2; var _z:int = Math.random() * cloudSize - cloudSize/2; var _rotationX:int = Math.random() * rotSize; var _rotationY:int = Math.random() * rotSize; var _rotationZ:int = Math.random() * rotSize; Tweener.addTween(plane, { x:_x, y:_y, z:_z, rotationX:_rotationX, rotationY:_rotationY, rotationZ:_rotationZ, time:5, transition:"easeIn" } ); } protected function onRenderEvent(event:Event):void { var rotY: Number = (mouseY-(stage.stageHeight/2))/(900/2)*(1200); var rotX: Number = (mouseX-(stage.stageWidth/2))/(600/2)*(-1200); displayObject.rotationY = viewport.camera.x + (rotX - viewport.camera.x) / 50; displayObject.rotationX = viewport.camera.y + (rotY - viewport.camera.y) / 30; viewport.singleRender(); } } } package designLab.events { import flash.display.BlendMode; import flash.display.Sprite; import flash.events.Event; import flash.filters.BlurFilter; // Import designLab import designLab.layer.IntroLayer; import designLab.shadow.ShadowCaster; import designLab.utils.LayerConstant; // Import Papervision3D import org.papervision3d.cameras.*; import org.papervision3d.scenes.*; import org.papervision3d.objects.*; import org.papervision3d.objects.special.*; import org.papervision3d.objects.primitives.*; import org.papervision3d.materials.*; import org.papervision3d.materials.special.*; import org.papervision3d.materials.shaders.*; import org.papervision3d.materials.utils.*; import org.papervision3d.lights.*; import org.papervision3d.render.*; import org.papervision3d.view.*; import org.papervision3d.events.InteractiveScene3DEvent; import org.papervision3d.events.*; import org.papervision3d.core.utils.*; import org.papervision3d.core.geom.renderables.Vertex3D; public class CoreEnging extends Sprite { public var viewport :BasicView; // Create BasicView public var displayObject :DisplayObject3D; // Create DisplayObject public var shadowCaster :ShadowCaster; // Create ShadowCaster private var light :PointLight3D; // Create PointLight private var shadowPlane :Plane; // Create Plane private var layer :LayerConstant; // Create constant resource layer private static var instance :CoreEnging; // Create CoreEnging class static instance // CoreEnging class static instance mathod function public static function getinstance() { if (instance != null) return instance; else { instance = new CoreEnging(); return instance; } } // CoreEnging constrictor public function CoreEnging () { trace("INFO: Design Lab Application : Core Enging v0.1"); layer = new LayerConstant(); viewport = new BasicView(900, 600, true, true, CameraType.FREE); // pass the width, height, scaleToStage, interactive, cameraType to BasicView viewport.camera.zoom = 100; // Define the zoom level of camera addChild(viewport); createFloor(); // Create the floor displayObject = new DisplayObject3D(); // Create new instance of DisplayObject viewport.scene.addChild(displayObject); // Add the DisplayObject to the BasicView light = new PointLight3D(); // Create new instance of PointLight light.z = -50; // Position the Z of create instance light.x = 0; //Position the X of create instance light.rotationZ = 45; //Position the rotation angel of the Z of create instance light.y = 500; //Position the Y of create instance shadowCaster = new ShadowCaster("shadow", 0x000000, BlendMode.MULTIPLY, .1, [new BlurFilter(20, 20, 1)]); // pass shadowcaster name, color, blend mode, alpha and filters shadowCaster.setType(ShadowCaster.SPOTLIGHT); // Define the shadow type addEventListener(Event.ENTER_FRAME, onRenderEvent); // Add frame render event } // Start create floor public function createFloor() { var spr:Sprite = new Sprite(); // Create Sprite spr.graphics.beginFill(0xFFFFFF); // Define the fill color for sprite spr.graphics.drawRect(0, 0, 600, 600); // Define the X, Y, width, height of the sprite var sprMaterial:MovieMaterial = new MovieMaterial(spr, true, true, true); //Create a texture from an existing sprite instance shadowPlane = new Plane(sprMaterial, 2000, 2000, 1, 1); // create new instance of the Plane and pass the texture material, width, height, segmentsW and segmentsH shadowPlane.rotationX = 80; //Position the rotation angel of the X of Plane shadowPlane.y = -200; //Position the Y of Plane viewport.scene.addChild(shadowPlane); // Add the Plane to the BasicView } // switch method function of the page layer control public function addLayer(type:String) { switch (type) { case layer.INTRO: var intro:IntroLayer = new IntroLayer(); break; } } // Create get mathod function for DisplayObject public function getDisplayObject():DisplayObject3D { return displayObject; } // Create get mathod function for BasicView public function getViewport():BasicView { return viewport; } // Rendering function protected function onRenderEvent(event:Event):void { var rotY: Number = (mouseY-(stage.stageHeight/2))/(900/2)*(1200); var rotX: Number = (mouseX-(stage.stageWidth/2))/(600/2)*(-1200); displayObject.rotationY = viewport.camera.x + (rotX - viewport.camera.x) / 50; displayObject.rotationX = viewport.camera.y + (rotY - viewport.camera.y) / 30; // Remove the shadow shadowCaster.invalidate(); // create new shadow on DisplayObject move shadowCaster.castModel(displayObject, light, shadowPlane); viewport.singleRender(); } } } package designLab.layer { import flash.display.Sprite; import flash.events.Event; // Import designLab import designLab.materials.iBusinessCard; import designLab.events.CoreEnging; // Import Papervision3D import org.papervision3d.objects.primitives.Cube; import org.papervision3d.materials.ColorMaterial; import org.papervision3d.materials.MovieMaterial; public class IntroLayer { // IntroLayer constrictor public function IntroLayer() { trace("INFO: Load Intro layer"); var indexDP:DP_index = new DP_index(); //Create the library MovieClip var blackMaterial:MovieMaterial = new MovieMaterial(indexDP, true); //Create a texture from an existing library MovieClip instance blackMaterial.smooth = true; blackMaterial.doubleSided = false; var mycolor:ColorMaterial = new ColorMaterial(0x000000); //Create solid color material var mycard:iBusinessCard = new iBusinessCard(blackMaterial, blackMaterial, mycolor, 372, 10, 207); // Create custom 3D cube object to pass the Front, Back, All, CubeWidth, CubeDepth and CubeHeight CoreEnging.getinstance().getDisplayObject().addChild(mycard.create3DCube()); // Add the custom 3D cube to the DisplayObject } } } package designLab.materials { import flash.display.*; import flash.events.*; // Import Papervision3D import org.papervision3d.materials.*; import org.papervision3d.materials.utils.MaterialsList; import org.papervision3d.objects.primitives.Cube; public class iBusinessCard extends Sprite { private var materialsList :MaterialsList; private var cube :Cube; private var Front :MovieMaterial = new MovieMaterial(); private var Back :MovieMaterial = new MovieMaterial(); private var All :ColorMaterial = new ColorMaterial(); private var CubeWidth :Number; private var CubeDepth :Number; private var CubeHeight :Number; public function iBusinessCard(Front:MovieMaterial, Back:MovieMaterial, All:ColorMaterial, CubeWidth:Number, CubeDepth:Number, CubeHeight:Number) { setFront(Front); setBack(Back); setAll(All); setCubeWidth(CubeWidth); setCubeDepth(CubeDepth); setCubeHeight(CubeHeight); } public function create3DCube():Cube { materialsList = new MaterialsList(); materialsList.addMaterial(Front, "front"); materialsList.addMaterial(Back, "back"); materialsList.addMaterial(All, "left"); materialsList.addMaterial(All, "right"); materialsList.addMaterial(All, "top"); materialsList.addMaterial(All, "bottom"); cube = new Cube(materialsList, CubeWidth, CubeDepth, CubeHeight); cube.x = 0; cube.y = 0; cube.z = 0; cube.rotationY = 180; return cube; } public function setFront(Front:MovieMaterial) { this.Front = Front; } public function getFront():MovieMaterial { return Front; } public function setBack(Back:MovieMaterial) { this.Back = Back; } public function getBack():MovieMaterial { return Back; } public function setAll(All:ColorMaterial) { this.All = All; } public function getAll():ColorMaterial { return All; } public function setCubeWidth(CubeWidth:Number) { this.CubeWidth = CubeWidth; } public function getCubeWidth():Number { return CubeWidth; } public function setCubeDepth(CubeDepth:Number) { this.CubeDepth = CubeDepth; } public function getCubeDepth():Number { return CubeDepth; } public function setCubeHeight(CubeHeight:Number) { this.CubeHeight = CubeHeight; } public function getCubeHeight():Number { return CubeHeight; } } } package designLab.shadow { import flash.display.Sprite; import flash.filters.BlurFilter; import flash.geom.Point; import flash.geom.Rectangle; import flash.utils.Dictionary; import org.papervision3d.core.geom.TriangleMesh3D; import org.papervision3d.core.geom.renderables.Triangle3D; import org.papervision3d.core.geom.renderables.Vertex3D; import org.papervision3d.core.math.BoundingSphere; import org.papervision3d.core.math.Matrix3D; import org.papervision3d.core.math.Number3D; import org.papervision3d.core.math.Plane3D; import org.papervision3d.lights.PointLight3D; import org.papervision3d.materials.MovieMaterial; import org.papervision3d.objects.DisplayObject3D; import org.papervision3d.objects.primitives.Plane; public class ShadowCaster { private var vertexRefs:Dictionary; private var numberRefs:Dictionary; private var lightRay:Number3D = new Number3D() private var p3d:Plane3D = new Plane3D(); public var color:uint = 0; public var alpha:Number = 0; public var blend:String = ""; public var filters:Array; public var uid:String; private var _type:String = "point"; private var dir:Number3D; private var planeBounds:Dictionary; private var targetBounds:Dictionary; private var models:Dictionary; public static var DIRECTIONAL:String = "dir"; public static var SPOTLIGHT:String = "spot"; public function ShadowCaster(uid:String, color:uint = 0, blend:String = "multiply", alpha:Number = 1, filters:Array=null) { this.uid = uid; this.color = color; this.alpha = alpha; this.blend = blend; this.filters = filters ? filters : [new BlurFilter()]; numberRefs = new Dictionary(true); targetBounds = new Dictionary(true); planeBounds = new Dictionary(true); models = new Dictionary(true); } public function castModel(model:DisplayObject3D, light:PointLight3D, plane:Plane, faces:Boolean = true, cull:Boolean = false):void{ var ar:Array; if(models[model]) { ar = models[model]; }else{ ar = new Array(); getChildMesh(model, ar); models[model] = ar; } var reset:Boolean = true; for each(var t:TriangleMesh3D in ar){ if(faces) castFaces(light, t, plane, cull, reset); else castBoundingSphere(light, t, plane, 0.75, reset); reset = false; } } private function getChildMesh(do3d:DisplayObject3D, ar):void{ if(do3d is TriangleMesh3D) ar.push(do3d); for each(var d:DisplayObject3D in do3d.children) getChildMesh(d, ar); } public function setType(type:String="point"):void{ _type = type; } public function getType():String{ return _type; } public function castBoundingSphere(light:PointLight3D, target:TriangleMesh3D, plane:Plane, scaleRadius:Number=0.8, clear:Boolean = true):void{ var planeVertices:Array = plane.geometry.vertices; //convert to target space? var world:Matrix3D = plane.world; var inv:Matrix3D = Matrix3D.inverse(plane.transform); var lp:Number3D = new Number3D(light.x, light.y, light.z); Matrix3D.multiplyVector(inv, lp); p3d.setNormalAndPoint(plane.geometry.faces[0].faceNormal, new Number3D()); var b:BoundingSphere = target.geometry.boundingSphere; var bounds:Object = planeBounds[plane]; if(!bounds){ bounds = plane.boundingBox(); planeBounds[plane] = bounds; } var tbounds:Object = targetBounds[target]; if(!tbounds){ tbounds = target.boundingBox(); targetBounds[target] = tbounds; } var planeMovie:Sprite = Sprite(MovieMaterial(plane.material).movie); var movieSize:Point = new Point(planeMovie.width, planeMovie.height); var castClip:Sprite = getCastClip(plane); castClip.blendMode = this.blend; castClip.filters = this.filters; castClip.alpha = this.alpha; if(clear) castClip.graphics.clear(); vertexRefs = new Dictionary(true); var tlp:Number3D = new Number3D(light.x, light.y, light.z); Matrix3D.multiplyVector(Matrix3D.inverse(target.world), tlp); var center:Number3D = new Number3D(tbounds.min.x+tbounds.size.x*0.5, tbounds.min.y+tbounds.size.y*0.5, tbounds.min.z+tbounds.size.z*0.5); var dif:Number3D = Number3D.sub(lp, center); dif.normalize(); var other:Number3D = new Number3D(); other.x = -dif.y; other.y = dif.x; other.z = 0; other.normalize(); var cross:Number3D = Number3D.cross(new Number3D(plane.transform.n12, plane.transform.n22, plane.transform.n32), p3d.normal); cross.normalize(); //cross = new Number3D(-dif.y, dif.x, 0); //cross.normalize(); cross.multiplyEq(b.radius*scaleRadius); if(_type == DIRECTIONAL){ var oPos:Number3D = new Number3D(target.x, target.y, target.z); Matrix3D.multiplyVector(target.world, oPos); Matrix3D.multiplyVector(inv, oPos); dir = new Number3D(oPos.x-lp.x, oPos.y-lp.y, oPos.z-lp.z); } //numberRefs = new Dictionary(true); var pos:Number3D; var c2d:Point; var r2d:Point; //_type = SPOTLIGHT; pos = projectVertex(new Vertex3D(center.x, center.y, center.z), lp, inv, target.world); c2d = get2dPoint(pos, bounds.min, bounds.size, movieSize); pos = projectVertex(new Vertex3D(center.x+cross.x, center.y+cross.y, center.z+cross.z), lp, inv, target.world); r2d = get2dPoint(pos, bounds.min, bounds.size, movieSize); var dx:Number = r2d.x-c2d.x; var dy:Number = r2d.y-c2d.y; var rad:Number = Math.sqrt(dx*dx+dy*dy); castClip.graphics.beginFill(color); castClip.graphics.moveTo(c2d.x, c2d.y); castClip.graphics.drawCircle(c2d.x, c2d.y, rad); castClip.graphics.endFill(); } public function getCastClip(plane:Plane):Sprite{ var planeMovie:Sprite = Sprite(MovieMaterial(plane.material).movie); var movieSize:Point = new Point(planeMovie.width, planeMovie.height); var castClip:Sprite;// = new Sprite(); if(planeMovie.getChildByName("castClip"+uid)) return Sprite(planeMovie.getChildByName("castClip"+uid)); else{ castClip = new Sprite(); castClip.name = "castClip"+uid; castClip.scrollRect = new Rectangle(0, 0, movieSize.x, movieSize.y); //castClip.alpha = 0.4; planeMovie.addChild(castClip); return castClip; } } public function castFaces(light:PointLight3D, target:TriangleMesh3D, plane:Plane, cull:Boolean=false, clear:Boolean = true):void{ var planeVertices:Array = plane.geometry.vertices; //convert to target space? var world:Matrix3D = plane.world; var inv:Matrix3D = Matrix3D.inverse(plane.transform); var lp:Number3D = new Number3D(light.x, light.y, light.z); Matrix3D.multiplyVector(inv, lp); var tlp:Number3D; if(cull){ tlp = new Number3D(light.x, light.y, light.z); Matrix3D.multiplyVector(Matrix3D.inverse(target.world), tlp); } //Matrix3D.multiplyVector(Matrix3D.inverse(target.transform), tlp); //p3d.setThreePoints(planeVertices[0].getPosition(), planeVertices[1].getPosition(), planeVertices[2].getPosition()); p3d.setNormalAndPoint(plane.geometry.faces[0].faceNormal, new Number3D()); if(_type == DIRECTIONAL){ var oPos:Number3D = new Number3D(target.x, target.y, target.z); Matrix3D.multiplyVector(target.world, oPos); Matrix3D.multiplyVector(inv, oPos); dir = new Number3D(oPos.x-lp.x, oPos.y-lp.y, oPos.z-lp.z); } var bounds:Object = planeBounds[plane]; if(!bounds){ bounds = plane.boundingBox(); planeBounds[plane] = bounds; } var castClip:Sprite = getCastClip(plane); castClip.blendMode = this.blend; castClip.filters = this.filters; castClip.alpha = this.alpha; var planeMovie:Sprite = Sprite(MovieMaterial(plane.material).movie); var movieSize:Point = new Point(planeMovie.width, planeMovie.height); if(clear) castClip.graphics.clear(); vertexRefs = new Dictionary(true); //numberRefs = new Dictionary(true); var pos:Number3D; var p2d:Point; var s2d:Point; var hitVert:Number3D = new Number3D(); for each(var t:Triangle3D in target.geometry.faces){ if( cull){ hitVert.x = t.v0.x; hitVert.y = t.v0.y; hitVert.z = t.v0.z; if(Number3D.dot(t.faceNormal, Number3D.sub(tlp, hitVert)) <= 0) continue; } castClip.graphics.beginFill(color); pos = projectVertex(t.v0, lp, inv, target.world); s2d = get2dPoint(pos, bounds.min, bounds.size, movieSize); castClip.graphics.moveTo(s2d.x, s2d.y); pos = projectVertex(t.v1, lp, inv, target.world); p2d = get2dPoint(pos, bounds.min, bounds.size, movieSize); castClip.graphics.lineTo(p2d.x, p2d.y); pos = projectVertex(t.v2, lp, inv, target.world); p2d = get2dPoint(pos, bounds.min, bounds.size, movieSize); castClip.graphics.lineTo(p2d.x, p2d.y); castClip.graphics.lineTo(s2d.x, s2d.y); castClip.graphics.endFill(); } } public function invalidate():void{ invalidateModels(); invalidatePlanes(); } public function invalidatePlanes():void{ planeBounds = new Dictionary(true); } public function invalidateTargets():void{ numberRefs = new Dictionary(true); targetBounds = new Dictionary(true); } public function invalidateModels():void{ models = new Dictionary(true); invalidateTargets(); } private function get2dPoint(pos3D:Number3D, min3D:Number3D, size3D:Number3D, movieSize:Point):Point{ return new Point((pos3D.x-min3D.x)/size3D.x*movieSize.x, ((-pos3D.y-min3D.y)/size3D.y*movieSize.y)); } private function projectVertex(v:Vertex3D, light:Number3D, invMat:Matrix3D, world:Matrix3D):Number3D{ var pos:Number3D = vertexRefs[v]; if(pos) return pos; var n:Number3D = numberRefs[v]; if(!n){ n = new Number3D(v.x, v.y, v.z); Matrix3D.multiplyVector(world, n); Matrix3D.multiplyVector(invMat, n); numberRefs[v] = n; } if(_type == SPOTLIGHT){ lightRay.x = light.x; lightRay.y = light.y; lightRay.z = light.z; }else{ lightRay.x = n.x-dir.x; lightRay.y = n.y-dir.y; lightRay.z = n.z-dir.z; } pos = p3d.getIntersectionLineNumbers(lightRay, n); vertexRefs[v] = pos; return pos; } } } package designLab.utils { public class LayerConstant { public const INTRO:String = "INTRO"; // Intro layer string constant } }*emphasized text*

    Read the article

  • Terminal Server 2003 Login Issue - Insufficient system resources exist to complete the requested ser

    - by LP
    Afternoon. We have three identical terminal servers running Windows Server 2003 SP2, on these servers there are about 250 concurrent users logged on. We're running Roaming Profiles on a central server running Active Directory which cache the profiles locally on each terminal server as well. When one, and just that one, user tries to login she gets this error message (roughly translated from Swedish): "You could not be logged in becouse your principle could not be registered. Check that you're connected to the network or ask your administrator Insufficient system resources exist to complete the requested service." Anyone have an idea about this? I'm stumped ... Best Regards LP

    Read the article

  • Set margins in a LinearLayout programmatically.

    - by Timmmm
    I'm trying to use Java (not XML) to create a LinearLayout with buttons that fill the screen, and have margins. Here is code that works without margins: LinearLayout buttonsView = new LinearLayout(this); buttonsView.setOrientation(LinearLayout.VERTICAL); for (int r = 0; r < 6; ++r) { Button btn = new Button(this); btn.setText("A"); LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.FILL_PARENT); // Verbose! lp.weight = 1.0f; // This is critical. Doesn't work without it. buttonsView.addView(btn, lp); } ViewGroup.LayoutParams lp = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT); setContentView(buttonsView, lp); So that works fine, but how on earth do you give the buttons margins so there is space between them? I tried using LinearLayout.MarginLayoutParams, but that has no weight member so it's no good. And it doesn't work if you pass it lp in its constructor either. Is this impossible? Because it sure looks it, and it wouldn't be the first Android layout task you can only do in XML.

    Read the article

1 2 3 4 5 6 7 8 9 10 11  | Next Page >