Search Results

Search found 3 results on 1 pages for 'j c leitao'.

Page 1/1 | 1 

  • Java method for android:layout_gravity

    - by André Leitão
    Hi folks, I would like to know if is there a way to call android:layout_gravity property from a java method. I didn't found any method in Android documentation to do it. This is the picture of the layout I want to implement: I know to do it through xml, as following: <FrameLayout xlmns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content"> <Button android:layout_gravity="left|center_vertical" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="<" /> <Button android:layout_gravity="right|center_vertical" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=">" /> </FrameLayout> But in my situation, I need to do it through Java code, because I'll implement another layout views dinamically. To avoid merging xml layout with Java code, I would prefer make all layout using Java. Can you help me? Thanks. André Leitão

    Read the article

  • Can't install or update Ubuntu after using parameter acpi_osi = Linux

    - by Lucas Leitão
    I recently had an issue with my acer 4736z notebook because I was having a blank screen after booting the OS, then someone told me to use the parameter GRUB_CMDLINE_LINUX_DEFAULT = "quiet splash acpi_osi = Linux" after quiet splash inside the grub. It worked for me, but since then I can't install a thing or update anything on Linux because it says Removing linux-image-extra-3.5.0-17-generic ... Examining /etc/kernel/postrm.d . run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.5.0-17-generic /boot/vmlinuz-3.5.0-17-generic update-initramfs: Deleting /boot/initrd.img-3.5.0-17-generic run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.5.0-17-generic /boot/vmlinuz-3.5.0-17-generic /usr/sbin/grub-mkconfig: 11: /etc/default/grub: GRUB_CMDLINE_LINUX_DEFAULT: not found run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127 Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-extra-3.5.0-17-generic.postrm line 328. dpkg: erro ao processar linux-image-extra-3.5.0-17-generic (--remove): sub-processo script post-removal instalado retornou estado de saída de erro 1 Removendo linux-image-3.5.0-17-generic ... Examining /etc/kernel/postrm.d . run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.5.0-17-generic /boot/vmlinuz-3.5.0-17-generic update-initramfs: Deleting /boot/initrd.img-3.5.0-17-generic run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.5.0-17-generic /boot/vmlinuz-3.5.0-17-generic /usr/sbin/grub-mkconfig: 11: /etc/default/grub: GRUB_CMDLINE_LINUX_DEFAULT: not found run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127 Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-3.5.0-17-generic.postrm line 328. dpkg: erro ao processar linux-image-3.5.0-17-generic (--remove): sub-processo script post-removal instalado retornou estado de saída de erro 1 Erros foram encontrados durante o processamento de: linux-image-extra-3.5.0-17-generic linux-image-3.5.0-17-generic E: Sub-process /usr/bin/dpkg returned an error code (1) I already tried to remove older kernels but it gives me the same message. Do you have a clue about what should I do?

    Read the article

  • Using a permutation table for simplex noise without storing it

    - by J. C. Leitão
    Generating Simplex noise requires a permutation table for randomisation (e.g. see this question or this example). In some applications, we need to persist the state of the permutation table. This can be done by creating the table, e.g. using def permutation_table(seed): table_size = 2**10 # arbitrary for this question l = range(1, table_size + 1) random.seed(seed) # ensures the same shuffle for a given seed random.shuffle(l) return l + l # see shared link why l + l; is a detail and storing it. Can we avoid storing the full table by generating the required elements every time they are required? Specifically, currently I store the table and call it using table[i] (table is a list). Can I avoid storing it by having a function that computes the element i, e.g. get_table_element(seed, i). I'm aware that cryptography already solved this problem using block cyphers, however, I found it too complex to go deep and implement a block cypher. Does anyone knows a simple implementation of a block cypher to this problem?

    Read the article

1