Daily Archives

Articles indexed Saturday October 26 2013

Page 7/15 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • My pc freezes when I connect to the internet with my iburst usb modem

    - by Kevin
    I am quite new to it and I'm having some trouble with iBurst usb modem.I followed the instructions of Graham Inggs here: https://help.ubuntu.com/community/Iburst and now it seems I can connect to the internet, but when I try to connect my whole desktop freezes. When I boot into Ubuntu with my modem connected all is well until I try to open Firefox then my desktop freezes as well.I used Graham Inngs' ibdriver in DKMS fromat solution and it worked apart from the freezing. Graham Inggs made a patch for this problem for older linux versions but I can't seem to find anything compatible with 12.04. Can someone please help?

    Read the article

  • Cannot install eclipse due to broken packages

    - by Achim
    Trying to install eclipse, I get the following error: XXX:~$ sudo apt-get install eclipse Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: eclipse : Depends: eclipse-jdt (>= 3.8.0~rc4-1ubuntu1) but it is not going to be installed Depends: eclipse-pde (>= 3.8.0~rc4-1ubuntu1) but it is not going to be installed E: Unable to correct problems, you have held broken packages. I have no idea how to solve it. I'm quite new to Ubuntu, but I don't think that I'm using a unstable distribution. But I have added the repository which is required to install Tomcat7. Could that cause the problem?

    Read the article

  • There is no two finger scroll option in my "Mouse and Touchpad" settings

    - by Ian
    I simply do not have the option for "two-finger scrolling" available in my "Mouse and Touchpad" settings. I have tried a lot of terminal commands that I have found in the forums with no success. Who has a solution that will enable two-finger scrolling? A little about me: Ubuntu 12.04.1 LTS \n \l Built-in Pointing Device Type: Mouse Interface: PS/2 Buttons: 2 ~$ xinput list ? Virtual core pointer id=2 [master pointer (3)] ? ? Virtual core XTEST pointer id=4 [slave pointer (2)] ? ? PS/2 Synaptics TouchPad id=15 [slave pointer (2)] ? Virtual core keyboard id=3 [master keyboard (2)] ? Virtual core XTEST keyboard id=5 [slave keyboard (3)] ? Power Button id=6 [slave keyboard (3)] ? Video Bus id=7 [slave keyboard (3)] ? Power Button id=8 [slave keyboard (3)] ? Sleep Button id=9 [slave keyboard (3)] ? WebCam SC-13HDL10931N id=10 [slave keyboard (3)] ? AT Translated Set 2 keyboard id=14 [slave keyboard (3)] Screenshot of system settings:

    Read the article

  • .htaccess ReWrite wildcard folder paths from host

    - by JHuangweb
    My desired result is change a file to root / from a N number of paths. For example: www.host.com/a/b/c/e/f/g/images/1.jpg, where A~G is not always given. Result: www.host.com/images/1.jpg This is what I have so far: www.host.com/a/images -- www.host.com/images Using: RewriteRule ^a\/images/$ images/$1 [L] What I need is a wildcard in front of /images/ Like this: RewriteRule ^*/images/$ images/$1 [L] How can I do this correctly in .htaccess?

    Read the article

  • What is the advantage to hosting static resources on a separate domain?

    - by Michael Ekstrand
    I notice a lot of sites host their resources on a separate domain from the main site, e.g. StackExchange using sstatic.net, Barnes & Noble using imagesbn.com, etc. I understand that there are benefits to putting your static resources on a separate host, possibly with an efficient static-file web server like nginx, freeing up the main server to focus on serving dynamic content. Similarly, outsourcing to a shared CDN like cloudfront Akamai is logical. What is the benefit to using a separate domain otherwise, though? Why sstatic.net instead of static.stackexchange.com? Update: Several answers miss the core question. I understand that there is benefit to splitting between multiple hosts — parallel downloads, slimmer web server, etc. But what is more elusive is why multiple domains. Why sstatic.net rather than static.stackexchange.com as the host for shared resources? So far, only one answer has addressed that.

    Read the article

  • How to solve exception_priv _instruction exception while running destop project? [on hold]

    - by Haritha
    While running desktop project im getting exception_priv _instruction how to solve this??? while running this page is coming # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_PRIV_INSTRUCTION (0xc0000096) at pc=0x02f5a92b, pid=3012, tid=3104 # # JRE version: 7.0-b147 # Java VM: Java HotSpot(TM) Client VM (21.0-b17 mixed mode, sharing windows-x86 ) # Problematic frame: # C 0x02f5a92b # # Failed to write core dump. Minidumps are not enabled by default on client versions of Windows # # If you would like to submit a bug report, please visit: # http://bugreport.sun.com/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --------------- T H R E A D --------------- Current thread (0x02f5a800): JavaThread "LWJGL Application" [_thread_in_native, id=3104, stack(0x076f0000,0x07740000)] siginfo: ExceptionCode=0xc0000096 Registers: EAX=0x000df4f0, EBX=0x32afc180, ECX=0x000df4f0, EDX=0x00000020 ESP=0x0773f768, EBP=0x0773f790, ESI=0x32afc180, EDI=0x02f5a800 EIP=0x02f5a92b, EFLAGS=0x00010206 Top of Stack: (sp=0x0773f768) 0x0773f768: 02bd429c 02bd429c 0773f770 32afc180 0x0773f778: 0773f7b8 32b022c8 00000000 32afc180 0x0773f788: 00000000 0773f7a0 0773f7dc 00943187 0x0773f798: 229ec1c0 00948839 69081736 00000000 0x0773f7a8: 089b0048 00000000 00000014 00001406 0x0773f7b8: 00000002 0773f7bc 32afbeb0 0773f7f8 0x0773f7c8: 32b022c8 00000000 32afbf00 0773f7a0 0x0773f7d8: 0773f7f0 0773f81c 00943187 69081736 Instructions: (pc=0x02f5a92b) 0x02f5a90b: 00 43 00 00 00 00 f0 bc 02 e8 00 e9 22 40 f7 73 0x02f5a91b: 07 85 a5 94 00 90 f7 73 07 50 cc a0 6d d8 49 c0 0x02f5a92b: 6d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x02f5a93b: 00 00 00 00 00 00 00 00 00 08 80 3d 37 00 00 00 Register to memory mapping: EAX=0x000df4f0 is an unknown value EBX=0x32afc180 is an oop {method} - klass: {other class} ECX=0x000df4f0 is an unknown value EDX=0x00000020 is an unknown value ESP=0x0773f768 is pointing into the stack for thread: 0x02f5a800 EBP=0x0773f790 is pointing into the stack for thread: 0x02f5a800 ESI=0x32afc180 is an oop {method} - klass: {other class} EDI=0x02f5a800 is a thread Stack: [0x076f0000,0x07740000], sp=0x0773f768, free space=317k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C 0x02f5a92b j org.lwjgl.opengl.GL11.glVertexPointer(IILjava/nio/FloatBuffer;)V+48 j com.badlogic.gdx.backends.lwjgl.LwjglGL10.glVertexPointer(IIILjava/nio/Buffer;)V+53 j com.badlogic.gdx.graphics.glutils.VertexArray.bind()V+149 j com.badlogic.gdx.graphics.Mesh.bind()V+25 j com.badlogic.gdx.graphics.Mesh.render(IIIZ)V+32 j com.badlogic.gdx.graphics.Mesh.render(III)V+8 j com.badlogic.gdx.graphics.g2d.SpriteBatch.flush()V+197 j com.badlogic.gdx.graphics.g2d.SpriteBatch.switchTexture(Lcom/badlogic/gdx/graphics/Texture;)V+1 j com.badlogic.gdx.graphics.g2d.SpriteBatch.draw(Lcom/badlogic/gdx/graphics/Texture;FFFF)V+33 j sevenseas.game.WorldRenderer.drawBob()V+54 j sevenseas.game.WorldRenderer.render()V+12 j sevenseas.game.GameClass.render(F)V+38 j com.badlogic.gdx.Game.render()V+19 j com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop()V+642 j com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run()V+27 v ~StubRoutines::call_stub V [jvm.dll+0x122c7e] V [jvm.dll+0x1c9c0e] V [jvm.dll+0x122e73] V [jvm.dll+0x122ed7] V [jvm.dll+0xccd1f] V [jvm.dll+0x14433f] V [jvm.dll+0x171549] C [msvcr100.dll+0x5c6de] endthreadex+0x3a C [msvcr100.dll+0x5c788] endthreadex+0xe4 C [kernel32.dll+0xb713] GetModuleFileNameA+0x1b4 Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j org.lwjgl.opengl.GL11.nglVertexPointer(IIIJJ)V+0 j org.lwjgl.opengl.GL11.glVertexPointer(IILjava/nio/FloatBuffer;)V+48 j com.badlogic.gdx.backends.lwjgl.LwjglGL10.glVertexPointer(IIILjava/nio/Buffer;)V+53 j com.badlogic.gdx.graphics.glutils.VertexArray.bind()V+149 j com.badlogic.gdx.graphics.Mesh.bind()V+25 j com.badlogic.gdx.graphics.Mesh.render(IIIZ)V+32 j com.badlogic.gdx.graphics.Mesh.render(III)V+8 j com.badlogic.gdx.graphics.g2d.SpriteBatch.flush()V+197 j com.badlogic.gdx.graphics.g2d.SpriteBatch.switchTexture(Lcom/badlogic/gdx/graphics/Texture;)V+1 j com.badlogic.gdx.graphics.g2d.SpriteBatch.draw(Lcom/badlogic/gdx/graphics/Texture;FFFF)V+33 j sevenseas.game.WorldRenderer.drawBob()V+54 j sevenseas.game.WorldRenderer.render()V+12 j sevenseas.game.GameClass.render(F)V+38 j com.badlogic.gdx.Game.render()V+19 j com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop()V+642 j com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run()V+27 v ~StubRoutines::call_stub --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x003d6c00 JavaThread "DestroyJavaVM" [_thread_blocked, id=3240, stack(0x008c0000,0x00910000)] =>0x02f5a800 JavaThread "LWJGL Application" [_thread_in_native, id=3104, stack(0x076f0000,0x07740000)] 0x02bcf000 JavaThread "Service Thread" daemon [_thread_blocked, id=2612, stack(0x02e00000,0x02e50000)] 0x02bc1000 JavaThread "C1 CompilerThread0" daemon [_thread_blocked, id=2776, stack(0x02db0000,0x02e00000)] 0x02bbf400 JavaThread "Attach Listener" daemon [_thread_blocked, id=2448, stack(0x02d60000,0x02db0000)] 0x02bbe000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=1764, stack(0x02d10000,0x02d60000)] 0x02bb8000 JavaThread "Finalizer" daemon [_thread_blocked, id=3864, stack(0x02cc0000,0x02d10000)] 0x02bb3400 JavaThread "Reference Handler" daemon [_thread_blocked, id=2424, stack(0x02c70000,0x02cc0000)] Other Threads: 0x02bb1800 VMThread [stack: 0x02c20000,0x02c70000] [id=3076] 0x02bd1000 WatcherThread [stack: 0x02e50000,0x02ea0000] [id=3276] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap def new generation total 4928K, used 2571K [0x229c0000, 0x22f10000, 0x27f10000) eden space 4416K, 46% used [0x229c0000, 0x22bc2e38, 0x22e10000) from space 512K, 100% used [0x22e90000, 0x22f10000, 0x22f10000) to space 512K, 0% used [0x22e10000, 0x22e10000, 0x22e90000) tenured generation total 10944K, used 634K [0x27f10000, 0x289c0000, 0x329c0000) the space 10944K, 5% used [0x27f10000, 0x27faea60, 0x27faec00, 0x289c0000) compacting perm gen total 12288K, used 1655K [0x329c0000, 0x335c0000, 0x369c0000) the space 12288K, 13% used [0x329c0000, 0x32b5dc58, 0x32b5de00, 0x335c0000) ro space 10240K, 42% used [0x369c0000, 0x36dfc660, 0x36dfc800, 0x373c0000) rw space 12288K, 53% used [0x373c0000, 0x37a38180, 0x37a38200, 0x37fc0000) Code Cache [0x00940000, 0x009d8000, 0x02940000) total_blobs=305 nmethods=80 adapters=158 free_code_cache=32183Kb largest_free_block=32955904 Dynamic libraries: 0x00400000 - 0x0042f000 C:\Program Files\Java\jre7\bin\javaw.exe 0x7c900000 - 0x7c9af000 C:\WINDOWS\system32\ntdll.dll 0x7c800000 - 0x7c8f6000 C:\WINDOWS\system32\kernel32.dll 0x77dd0000 - 0x77e6b000 C:\WINDOWS\system32\ADVAPI32.dll 0x77e70000 - 0x77f02000 C:\WINDOWS\system32\RPCRT4.dll 0x77fe0000 - 0x77ff1000 C:\WINDOWS\system32\Secur32.dll 0x7e410000 - 0x7e4a1000 C:\WINDOWS\system32\USER32.dll 0x77f10000 - 0x77f59000 C:\WINDOWS\system32\GDI32.dll 0x773d0000 - 0x774d3000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.5512_x-ww_35d4ce83\COMCTL32.dll 0x77c10000 - 0x77c68000 C:\WINDOWS\system32\msvcrt.dll 0x77f60000 - 0x77fd6000 C:\WINDOWS\system32\SHLWAPI.dll 0x76390000 - 0x763ad000 C:\WINDOWS\system32\IMM32.DLL 0x629c0000 - 0x629c9000 C:\WINDOWS\system32\LPK.DLL 0x74d90000 - 0x74dfb000 C:\WINDOWS\system32\USP10.dll 0x78aa0000 - 0x78b5e000 C:\Program Files\Java\jre7\bin\msvcr100.dll 0x6d940000 - 0x6dc61000 C:\Program Files\Java\jre7\bin\client\jvm.dll 0x71ad0000 - 0x71ad9000 C:\WINDOWS\system32\WSOCK32.dll 0x71ab0000 - 0x71ac7000 C:\WINDOWS\system32\WS2_32.dll 0x71aa0000 - 0x71aa8000 C:\WINDOWS\system32\WS2HELP.dll 0x76b40000 - 0x76b6d000 C:\WINDOWS\system32\WINMM.dll 0x76bf0000 - 0x76bfb000 C:\WINDOWS\system32\PSAPI.DLL 0x6d8d0000 - 0x6d8dc000 C:\Program Files\Java\jre7\bin\verify.dll 0x6d370000 - 0x6d390000 C:\Program Files\Java\jre7\bin\java.dll 0x6d920000 - 0x6d933000 C:\Program Files\Java\jre7\bin\zip.dll 0x6cec0000 - 0x6cf42000 C:\Documents and Settings\7stl0225\Local Settings\Temp\libgdx7stl0225\37fe1abc\gdx.dll 0x10000000 - 0x1004c000 C:\Documents and Settings\7stl0225\Local Settings\Temp\libgdx7stl0225\52d76f2b\lwjgl.dll 0x5ed00000 - 0x5edcc000 C:\WINDOWS\system32\OPENGL32.dll 0x68b20000 - 0x68b40000 C:\WINDOWS\system32\GLU32.dll 0x73760000 - 0x737ab000 C:\WINDOWS\system32\DDRAW.dll 0x73bc0000 - 0x73bc6000 C:\WINDOWS\system32\DCIMAN32.dll 0x77c00000 - 0x77c08000 C:\WINDOWS\system32\VERSION.dll 0x070b0000 - 0x07115000 C:\DOCUME~1\7stl0225\LOCALS~1\Temp\libgdx7stl0225\52d76f2b\OpenAL32.dll 0x7c9c0000 - 0x7d1d7000 C:\WINDOWS\system32\SHELL32.dll 0x774e0000 - 0x7761d000 C:\WINDOWS\system32\ole32.dll 0x5ad70000 - 0x5ada8000 C:\WINDOWS\system32\uxtheme.dll 0x76fd0000 - 0x7704f000 C:\WINDOWS\system32\CLBCATQ.DLL 0x77050000 - 0x77115000 C:\WINDOWS\system32\COMRes.dll 0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll 0x73f10000 - 0x73f6c000 C:\WINDOWS\system32\dsound.dll 0x76c30000 - 0x76c5e000 C:\WINDOWS\system32\WINTRUST.dll 0x77a80000 - 0x77b15000 C:\WINDOWS\system32\CRYPT32.dll 0x77b20000 - 0x77b32000 C:\WINDOWS\system32\MSASN1.dll 0x76c90000 - 0x76cb8000 C:\WINDOWS\system32\IMAGEHLP.dll 0x72d20000 - 0x72d29000 C:\WINDOWS\system32\wdmaud.drv 0x72d10000 - 0x72d18000 C:\WINDOWS\system32\msacm32.drv 0x77be0000 - 0x77bf5000 C:\WINDOWS\system32\MSACM32.dll 0x77bd0000 - 0x77bd7000 C:\WINDOWS\system32\midimap.dll 0x73ee0000 - 0x73ee4000 C:\WINDOWS\system32\KsUser.dll 0x755c0000 - 0x755ee000 C:\WINDOWS\system32\msctfime.ime 0x69000000 - 0x691a9000 C:\WINDOWS\system32\sisgl.dll 0x73b30000 - 0x73b45000 C:\WINDOWS\system32\mscms.dll 0x73000000 - 0x73026000 C:\WINDOWS\system32\WINSPOOL.DRV 0x66e90000 - 0x66ed1000 C:\WINDOWS\system32\icm32.dll 0x07760000 - 0x0778d000 C:\Program Files\WordWeb\WHook.dll 0x74c80000 - 0x74cac000 C:\WINDOWS\system32\OLEACC.dll 0x76080000 - 0x760e5000 C:\WINDOWS\system32\MSVCP60.dll VM Arguments: jvm_args: -Dfile.encoding=Cp1252 java_command: sevenseas.game.MainDesktop Launcher Type: SUN_STANDARD Environment Variables: PATH=C:/Program Files/Java/jre7/bin/client;C:/Program Files/Java/jre7/bin;C:/Program Files/Java/jre7/lib/i386;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Java\jdk1.7.0\bin;C:\eclipse; USERNAME=7stl0225 OS=Windows_NT PROCESSOR_IDENTIFIER=x86 Family 15 Model 4 Stepping 1, GenuineIntel --------------- S Y S T E M --------------- OS: Windows XP Build 2600 Service Pack 3 CPU:total 1 (1 cores per cpu, 1 threads per core) family 15 model 4 stepping 1, cmov, cx8, fxsr, mmx, sse, sse2, sse3 Memory: 4k page, physical 2031088k(939252k free), swap 3969920k(3011396k free) vm_info: Java HotSpot(TM) Client VM (21.0-b17) for windows-x86 JRE (1.7.0-b147), built on Jun 27 2011 02:25:52 by "java_re" with unknown MS VC++:1600 time: Sat Oct 26 12:35:14 2013 elapsed time: 0 seconds

    Read the article

  • Node.js Lockstep Multiplayer Architecture

    - by Wakaka
    Background I'm using the lockstep model for a multiplayer Node.js/Socket.IO game in a client-server architecture. User input (mouse or keypress) is parsed into commands like 'attack' and 'move' on the client, which are sent to the server and scheduled to be executed on a certain tick. This is in contrast to sending state data to clients, which I don't wish to use due to bandwidth issues. Each tick, the server will send the list of commands on that tick (possibly empty) to each client. The server and all clients will then process the commands and simulate that tick in exactly the same way. With Node.js this is actually quite simple due to possibility of code sharing between server and client. I'll just put the deterministic simulator in the /shared folder which can be run by both server and client. The server simulation is required so that there is an authoritative version of the simulation which clients cannot alter. Problem Now, the game has many entity classes, like Unit, Item, Tree etc. Entities are created in the simulator. However, for each class, it has some methods that are shared and some that are client-specific. For instance, the Unit class has addHp method which is shared. It also has methods like getSprite (gets the image of the entity), isVisible (checks if unit can be seen by the client), onDeathInClient (does a bunch of stuff when it dies only on the client like adding announcements) and isMyUnit (quick function to check if the client owns the unit). Up till now, I have been piling all the client functions into the shared Unit class, and adding a this.game.isServer() check when necessary. For instance, when the unit dies, it will call if (!this.game.isServer()) { this.onDeathInClient(); }. This approach has worked pretty fine so far, in terms of functionality. But as the codebase grew bigger, this style of coding seems a little strange. Firstly, the client code is clearly not shared, and yet is placed under the /shared folder. Secondly, client-specific variables for each entity are also instantiated on the server entity (like unit.sprite) and can run into problems when the server cannot instantiate the variable (it doesn't have Image class like on browsers). So my question is, is there a better way to organize the client code, or is this a common way of doing things for lockstep multiplayer games? I can think of a possible workaround, but it does have its own problems. Possible workaround (with problems) I could use Javascript mixins that are only added when in a browser. Thus, in the /shared/unit.js file in the /shared folder, I would have this code at the end: if (typeof exports !== 'undefined') module.exports = Unit; else mixin(Unit, LocalUnit); Then I would have /client/localunit.js store an object LocalUnit of client-side methods for Unit. Now, I already have a publish-subscribe system in place for events in the simulator. To remove the this.game.isServer() checks, I could publish entity-specific events whenever I want the client to do something. For instance, I would do this.publish('Death') in /shared/unit.js and do this.subscribe('Death', this.onDeathInClient) in /client/localunit.js. But this would make the simulator's event listeners list on the server and the client different. Now if I want to clear all subscribed events only from the shared simulator, I can't. Of course, it is possible to create two event subscription systems - one client-specific and one shared - but now the publish() method would have to do if (!this.game.isServer()) { this.publishOnClient(event); }. All in all, the workaround off the top of my head seems pretty complicated for something as simple as separating the client and shared code. Thus, I wonder if there is an established and simpler method for better code organization, hopefully specific to Node.js games.

    Read the article

  • Upgraded to EF6 blew up Universal provider session state for Azure

    - by Ryan
    I have an ASP.NET MVC 4 application that using the Universal providers for session state: <sessionState mode="Custom" sqlConnectionString="DefaultConnection" customProvider="DefaultSessionProvider"> <providers> <add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" /> </providers> </sessionState> When I upgraded to entity framework 6 I now get this error: Method not found: 'System.Data.Objects.ObjectContext System.Data.Entity.Infrastructure.IObjectContextAdapter.get_ObjectContext()'. I tried adding the reference to System.Data.Entity.dll back in but that didn't work and I know that your not suppose to add that with the new entity framework..

    Read the article

  • mvc4 receive form in a controller

    - by Marco Dinatsoli
    i have a form in html and i want to submit it to a controler what i have tried @using (Html.BeginForm("RegisterApartmentOwner", "Home", FormMethod.Post, new { enctype = "multipart/form-data" })) { <p> <label>First Name</label> <input type="text" placeholder="Enter your first Name" name="firstName" /> <span class="errorMessage"></span> </p> <p> <label>Last Name</label> <input type="text" placeholder="Enter your last Name" /> <span class="errorMessage"></span> </p> <p> <label>Password</label> <input type="text" placeholder="Enter your password" name="Password"/> <span class="errorMessage"></span> </p> <p> <label>Password Again</label> <input type="text" placeholder="Enter your password again" name="Password2"/> <span class="errorMessage"></span> </p> <p> <label>Mobile Number</label> <input type="text" placeholder="Enter your mobile number" /> <span class="errorMessage"></span> </p> <p> <input type="submit" value="Register" class="submit"/> </p> } </div> and in the controller i receive the submit in this function public String RegisterTenant() { return "done"; } i can see the done message, however, i want to receive the values of the input that i used in the form, how please? i just to know what to receive the form in the controller

    Read the article

  • Generic Method to find the tuples used for computation in Postgres?

    - by Rahul
    If I have a table col1 | name | pay ------+------------------+------ 1 | Steve Jobs | 1006 2 | Mike Markkula | 1007 3 | Mike Scott | 1978 4 | John Sculley | 1983 5 | Michael Spindler | 1653 The user executes a sum query which sums the pay of people getting paid more than $1500. Is there a way to also implicitly know which tuples have been used which satisfy the condition for sum ? I know you can separately write another query to just return the primary key ids which satisfy the condition. But, Is there any other way to do that in the same query ? probably rewrite the query in some way ? or... any suggestion ?

    Read the article

  • Strange behavior with ajax call complete in JavaScript modules

    - by user2598794
    I have 3 simple modules with JavaScript code and JQuery ajax call. First module lots.js: var Lots = (function ($) { var self = this; var processIsRunning; return { getLots: function (lotsUrl) { var items = []; self.processIsRunning = true; var request = $.ajax({ url: lotsUrl, type: 'POST', success: function (data) { //some code } }); $.when(request).done(function() { //some code self.processIsRunning = false; }); }, isComplete: function () { return !self.processIsRunning; } }; }(jQuery)); Module bids.js: var Bids = (function ($) { return { makeBids: function (bidUrl) { //some code } }; }(jQuery)); Module app.js which bundles all together: var App = (function () { var lots_url = null; var bid_url = null; var self = this; return { if (!self.lots_url) { self.lots_url = lotsUrl; } GetLots: function (lotsUrl) { Lots.getLots(self.lots_url); }, MakeBids: function makeBid(bidUrl) { //some code var isComp = Lots.isComplete(); while (!isComp) { isComp = Lots.isComplete(); } Bids.makeBids(self.bid_url); } }; }()); But in the 'while' loop I always get 'isComplete=false'. In debug I see that 'processIsRunning' in Lots module is always true. What's the problem?

    Read the article

  • How to refresh ListAdapter/ListView in android

    - by user2463990
    I have database with 2 table, custom layout for my listView, and I'm using ListAdapter to display all data on ListView - this works fine. But, I have problem when I wish display something other on listView from my Database. The data is just append on my ListView - I won't this! How I refresh/update ListAdapter? This is my MainActivity: ListAdapter adapter; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); search = (EditText) findViewById(R.id.search); lista = (ListView) findViewById(android.R.id.list); sqlite = new Sqlite(MainActivity.this); //When apps start, listView is populated with data adapter = new SimpleAdapter(this, sqlite.getAllData(), R.layout.lv_layout, new String[]{"ime","naziv","kolicina","adresa"}, new int[]R.id.kupac,R.id.proizvod,R.id.kolicina,R.id.adresa}); setListAdapter(adapter); search.addTextChangedListener(new TextWatcher() { @Override public void onTextChanged(CharSequence s, int start, int before,int count) { // TODO Auto-generated method stub String tekst = s.toString(); ArrayList<HashMap<String, String>> rez = Sqlite.getFilterData(tekst); adapter = new SimpleAdapter(MainActivity.this, rez,R.layout.lv_layout, new String[]{"ime","naziv","kolicina","adresa"}, new int[]{R.id.kupac,R.id.proizvod,R.id.kolicina,R.id.adresa}); lista.setAdapter(adapter); } } The problem is when the method onTextChanged is called. I get all the data but the data just append to my ListView. How to fix it? And this is my Sqlite class where is needed method: ArrayList<HashMap<String,String>> results_criteria = new ArrayList<HashMap<String,String>>(); public ArrayList<HashMap<String, String>> getFilterData(String criteria) { String ime_kupca = ""; String product = ""; String adress = ""; String kolicina = ""; SQLiteDatabase myDb = this.getReadableDatabase(); Cursor cursor = myDb.rawQuery("SELECT " + DB_COLUMN_IME + "," + DB_COLUMN_NAZIV + "," + DB_COLUMN_KOLICINA + "," + DB_COLUMN_ADRESA + " FROM " + DB_TABLE1_NAME + "," + DB_TABLE2_NAME + " WHERE kupac.ID = proizvod.ID AND " + DB_COLUMN_IME + " LIKE '%" + criteria + "%'", null); if(cursor != null){ if(cursor.moveToFirst()){ do{ HashMap<String,String>map = new HashMap<String,String>(); ime_kupca = cursor.getString(cursor.getColumnIndex(DB_COLUMN_IME)); product = cursor.getString(cursor.getColumnIndex(DB_COLUMN_NAZIV)); kolicina = cursor.getString(cursor.getColumnIndex(DB_COLUMN_KOLICINA)); adress = cursor.getString(cursor.getColumnIndex(DB_COLUMN_ADRESA)); map.put("ime", ime_kupca); map.put("naziv", product); map.put("kolicina", kolicina); map.put("adresa", adress); results_criteria.add(map); }while(cursor.moveToNext()); //cursor.close(); } cursor.close(); } Log.i("Rez", "" + results_criteria); return results_criteria;

    Read the article

  • Why is fulltextsearch for phrase ignored in SQL Server?

    - by cpt.oneeye
    I am executing the following SQL statement on an indexed SQL Server 2008 R2 database. SELECT * FROM mydatabase WHERE (CONTAINS(ColumnA,'"The Apple is red"')) The problem is that it returns too many entries. It also returns entries where 'ColumnA' contains only one of the words ('Apple' or 'is' or 'red'...) and not only the entries which contains the exact phrase. According to MSDN this should be the way to search for a phrase. Thanks cpt.oneeye

    Read the article

  • Zend Framework Error:Invalid parameter number: no parameters were bound'

    - by roast_soul
    I'm using the Zend Frameworker 1.12. According to the help file, I used the Zend_Db_Statement to execute my sql. Below is my php code: $sql = "delete from options where id=?"; $stmt = new Zend_Db_Statement_Mysqli($this->getAdapter(), $sql); return $stmt->execute(array('1')); But the error is exception 'PDOException' with message 'SQLSTATE[HY093]: Invalid parameter number: no parameters were bound' in D:\Zend\workspaces\DefaultWorkspace.metadata.plugins\org.zend.php.framework.resource\resources\ZendFramework-1\library\Zend\Db\Statement\Mysqli.php:209 Stack trace: ......... ......... I googled for days, but nothing works. Any one know how to fix it?

    Read the article

  • Java for loop with multiple incrementers

    - by user2517280
    Im writing a program which combines the RGB pixel values for 3 images, e.g. red pixel of image 1, green pixel of image 2 and blue pixel of image 3 and I want to then create a final image of it. Im using the code below, but this seems to be incrementing x2 and x3 whilst x1 is the same, i.e. not giving the right pixel value for same co-ordinate for each image. for (int x = 0; x < image.getWidth(); x++) { for (int x2 = 0; x2 < image2.getWidth(); x2++) { for (int x3 = 0; x3 < image3.getWidth(); x3++) { for (int y = 0; y < image.getHeight(); y++) { for (int y2 = 0; y2 < image2.getHeight(); y2++) { for (int y3 = 0; y3 < image3.getHeight(); y3++) { So I was wondering if anyone can tell me how to iterate through each of the 3 images on the same co-ordinate, so for example read 1, 1 of each image and record the red, green and blue value accordingly. Apologies if it doesnt make complete sense, its a bit hard to explain. I can iterate the values for one image fine but when I add in another, things start to go a bit wrong as obviously its quite a bit more complicated! I was thinking it might be easier to create an array and replace the according values in that just not sure how to do that effectively either. Thanks

    Read the article

  • multiplying all elements in an array by an outside number?

    - by prodo
    I need to multiple all the values in an array by 3000 which in turn would create a new array that I will use to subtract from another array. I've tried to create a separate method that would do that for me but all I got back in the multiplied array was a bunch of numbers and symbols strangely? here is the code that I wrote public static void main(String[] args) { int numberOfTaxpayers = Integer.parseInt(JOptionPane.showInputDialog("Enter how many users you would like to calculate taxes for: "); int[] usernumChild = new int[numberOfTaxPayers]; for (int i = 0; i < usernumChild.length; i++) { usernumChild[i] = Integer.parseInt(JOptionPane.showInputDialog("Enter number of children for user "+ (i+1) +": ")); }//this for loop finds out the number of children per user so we can later multiply each input by 3000 to create an array that determine dependency exemption for each user int[] depndExemp = multiply(usernumChild, 3000);//this was the calling of the multiply method... somewhere here is the error!! }//end main method public static int[] multiply(int[] children, int number) { int array[] = new int[children.length]; for( int i = 0; i < children.length; i++) { children[i] = children[i] * number; }//end for return array; }//this is the method that I was shown in a previous post on how to create return an array in this the dependency exemption array but when I tested this by printing out the dependency array all I received were a jumble of wrong numbers.

    Read the article

  • Problems sorting by date

    - by Nathan
    I'm attempting to only display data added to my database 24 hours ago or less. However, for some reason, the code I've written isn't working, and both entries in my database, one from 1 hour ago, one from 2 days ago, show up. Is there something wrong with my equation? Thanks! public void UpdateValues() { double TotalCost = 0; double TotalEarned = 0; double TotalProfit = 0; double TotalHST = 0; for (int i = 0; i <= Program.TransactionList.Count - 1; i++) { DateTime Today = DateTime.Now; DateTime Jan2013 = DateTime.Parse("01-01-2013"); //Hours since Jan12013 int TodayHoursSince2013 = Convert.ToInt32(Math.Round(Today.Subtract(Jan2013).TotalHours)); //7 int ItemHoursSince2013 = Program.TransactionList[i].HoursSince2013; //Equals 7176, and 7130 if (ItemHoursSince2013 - TodayHoursSince2013 <= 24) { TotalCost += Program.TransactionList[i].TotalCost; TotalEarned += Program.TransactionList[i].TotalEarned; TotalProfit += Program.TransactionList[i].TotalEarned - Program.TransactionList[i].TotalCost; TotalHST += Program.TransactionList[i].TotalHST; } } label6.Text = "$" + String.Format("{0:0.00}", TotalCost); label7.Text = "$" + String.Format("{0:0.00}", TotalEarned); label8.Text = "$" + String.Format("{0:0.00}", TotalProfit); label10.Text = "$" + String.Format("{0:0.00}", TotalHST); }

    Read the article

  • Is there some advantage to filling a stack with nils and interpreting the "top" as the last non-nil value?

    - by dwilbank
    While working on a rubymonk exercise, I am asked to implement a stack with a hard size limit. It should return 'nil' if I try to push too many values, or if I try to pop an empty stack. My solution is below, followed by their solution. Mine passes every test I can give it in my IDE, while it fails rubymonk's test. But that isn't my question. Question is, why did they choose to fill the stack with nils instead of letting it shrink and grow like it does in my version? It just makes their code more complex. Here's my solution: class Stack def initialize(size) @max = size @store = Array.new end def pop empty? ? nil : @store.pop end def push(element) return nil if full? @store.push(element) end def size @store.size end def look @store.last end private def full? @store.size == @max end def empty? @store.size == 0 end end and here is the accepted answer class Stack def initialize(size) @size = size @store = Array.new(@size) @top = -1 end def pop if empty? nil else popped = @store[@top] @store[@top] = nil @top = @top.pred popped end end def push(element) if full? or element.nil? nil else @top = @top.succ @store[@top] = element self end end def size @size end def look @store[@top] end private def full? @top == (@size - 1) end def empty? @top == -1 end end

    Read the article

  • What is the most common way to use a middleware in node with express and connect

    - by Bernhard
    Thinking about the correct way, how to make use of middlewares in a node.js web project using express and connect which is growing up at the moment. Of course there are middlewares right now wich has to pass or extend requests globally but in a lot of cases there are special jobs like prepare incoming data and in this case the middleware would only work for a set of http-methods and routes. I've a component based architecture and each component brings it's own middleware layer which can implement those for requests this component can handle. On app startup any required component is loaded and prepared. Is it a good idea to bind the middleware code execution to URLs to keep cpu load lower or is it better to use middlewares only for global purposes? Here's some dummy how an url related middleware look like. app.use(function(req, res, next) { // Check if requested route is a part of the current component // or if the middleware should be passed on any request if (APP.controller.groups.Component.isExpectedRoute(req) || APP.controller.groups.Component.getConfig().MIDDLEWARE_PASS_ALL === true) { // Execute the midleware code here console.log('This is a route which should be afected by middleware'); ... next(); }else{ next(); } });

    Read the article

  • Is MSDN referencing a system.thread, a worker thread, an io thread or all three?

    - by w0051977
    Please see the warning below taken from the StreamWriter class specification (http://msdn.microsoft.com/en-us/library/system.io.streamwriter.aspx): "Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe." I understand that a W3WC process contains two thread pools i.e. worker threads and I/O threads. A worker thread could contain many threads of its own (if the application creates its own System.Thread instances). Does the warning only relate to System.Threads or does it relate to worker threads and I/O threads as well I.e. as the instance variables of the streamwriter class are not thread safe then does this mean that there would be problems if multiple worker threads access it eg if two users on two different web clients attempt to write to the log file at the same time, then could one lock out the other?

    Read the article

  • In which year was the date the same as the original year?

    - by Marta
    It's my first question on this site, but I always found this site really useful. What I mean with my question is: you ask the person to give a date (eg. Fill in a date [dd-mm-yyyy]: 16-10-2013) you than have to ask an interval between 2 years (eg. Give an interval [yyyy-yyyy]:1800-2000) When the program runs, it has to show what day of the week the given date is. In this case it was a Wednesday. Than the program has to look in which year, in between the interval, the date 16 October also fell on a Wednesday. So in the end it has to look something like this: Fill in a date: [dd-mm-yyyy]: 16-10-2013 Give an interval [yyyy-yyyy]: 1900-2000 16 October was a wednesday in the following years: 1905 1911 1916 1922 1933 1939 1944 1950 1961 1967 1972 1978 1989 1995 2000 The full date is Wednesday 16 October, 2013 The small (or biggest) problem is, I am not allowed to use the DATE.function in java. If someone can help me with the second part I would be really really happy, cause I have no idea how I am supposed to do this To find out what day of the week the given date falls, I use the Zeller Congruence class Day { Date date; //To grab the month and year form the Date class int day; final static String[] DAYS_OF_WEEK = { "Saturday", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday" }; public void dayWeekInterval{ //code to grab the interval from interval Class, and doing stuff here } public void dayOfTheWeek { int m = date.getMonth(); int y = date.getYear(); if (m < 3) { m += 12; y -= 1; } int k = y % 100; int j = y / 100; int day = ((q + (((m + 1) * 26) / 10) + k + (k / 4) + (j / 4)) + (5 * j)) % 7; return day; } public string ToString(){ return "" + DAYS_OF_WEEK[day] + day; } }

    Read the article

  • How to get a number closest to the average in c++?

    - by Alex Zielinski
    What I'm trying to achieve is to take the average of the numbers stored in the array and find the number which is closest to it. My code compiles, but has an error just after starting. I think it's something to do with the memory handling (I don't feel confident with pointers, etc. yet) Could some nice guy take a look at my code and tell me what's wrong with it? (don't be hard on me, I'm a beginner) #include <iostream> #include <cmath> using namespace std; double* aver(double* arr, size_t size, double& average); int main() { double arr[] = {1,2,3,4,5,7}; size_t size = sizeof(arr)/sizeof(arr[0]); double average = 0; double* p = aver(arr,size,average); cout << *p << " " << average << endl; } double* aver(double* arr, size_t size, double& average){ int i,j,sum; double* m = 0; int tmp[7]; for(i=0;i<size;i++) sum += arr[i]; average = sum/size; for(j=0;j<size;j++){ tmp[j] = arr[j] - average; if(abs(tmp[j])>*m) *m = tmp[j]; } return m; }

    Read the article

  • Write file at a specific value and line

    - by user2828891
    I want to write data at a specified value in a text file from a text box. Here is a example: item_begin etcitem 3344 item_type=etcitem is first line and item_begin weapon 3343 item_type=weapon is second. Well i want to replace item_type=weapon at second line with item_type=armor. Here is code so far: var data2 = File.WriteAllLines("itemdata.txt") .Where(x => x.Contains("3343")) .Take(1) .SelectMany(x => x.Split('\t')) .Select(x => x.Split('=')) .Where(x => x.Length > 1) .ToDictionary(x => x[0].Trim(), x => x[1]); But returns error at WriteAllLines. Here is the readline part code: var data = File.ReadLines("itemdata.txt") .Where(x => x.Contains("3343")) .Take(1) .SelectMany(x => x.Split('\t')) .Select(x => x.Split('=')) .Where(x => x.Length > 1) .ToDictionary(x => x[0].Trim(), x => x[1]); //call values textitem_type.Text = data["item_type"]; And want to write the same value I change on textitem_type.Text after read. I used this to reaplace but replaces all values with same name from line and returns me in text only 1 line. Code: private void button2_Click(object sender, EventArgs e) { var data = File .ReadLines("itemdata.txt") .Where(x => x.Contains(itemSrchtxt.Text)) .Take(1) .SelectMany(x => x.Split('\t')) .Select(x => x.Split('=')) .Where(x => x.Length > 1) .ToDictionary(x => x[0].Trim(), x => x[1]); StreamReader reader = new StreamReader(Directory.GetCurrentDirectory() + @"\itemdata.txt"); string content = reader.ReadLine(); reader.Close(); content = Regex.Replace(content, data["item_type"], textitem_type.Text); StreamWriter write = new StreamWriter(Directory.GetCurrentDirectory() + @"\itemdata.txt"); write.WriteLine(content); write.Close(); }

    Read the article

  • Login with Google OAuth api and return url with variable

    - by user2833721
    I am using the Google API for login in my site and I appending my variable with URL and I want that variable in the return URL of OAuth API because of update purpose can I return back that variable For example: <a href="<?php echo($authUrl); ?>&kicker"> I append the kicker in $authUrl and when I return back from Oauth api print $me['displayName']; print $user['email']; print $me['gender']; print $me['id']; with this output I also want my variable "kicker" how can I get it

    Read the article

  • function taking in an input image and different kernel size

    - by drifterOcean19
    I have this filtering function that takes an input image, performs convolution using a given kernel, and returns the resulting image. However, I can't seem to work it out how to make it takes different kernel sizes.For example instead of pre-defined 3x3 kernel as below in the code, it could instead take 5x5 or 7x7. and then the user could input the type of kernel/filter they want(Depending on the intended effect). I can't seem to put my head around it. i'm quite new to matlab. function [newImg] = kernelFunc(imgB) img=imread(imgB); figure,imshow(img); img2=zeros(size(img)+2); newImg=zeros(size(img)); for rgb=1:3 for x=1:size(img,1) for y=1:size(img,2) img2(x+1,y+1,rgb)=img(x,y,rgb); end end end for rgb=1:3 for i= 1:size(img2,1)-2 for j=1:size(img2,2)-2 window=zeros(9,1); inc=1; for x=1:3 for y=1:3 window(inc)=img2(i+x-1,j+y-1,rgb); inc=inc+1; end end kernel=[1;2;1;2;4;2;1;2;1]/16; med=window.*kernel; disp(med); med=sum(med); med=floor(med); newImg(i,j,rgb)=med; end end end newImg=uint8(newImg); figure,imshow(newImg); end

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >