Search Results

Search found 1202 results on 49 pages for 'specs'.

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

  • how can I convert String to SecretKey

    - by Alaa
    I want to convert String to secretKey public void generateCode(String keyStr){ KeyGenerator kgen = KeyGenerator.getInstance("AES"); kgen.init(128); // 192 and 256 bits may not be available // Generate the secret key specs. secretKey skey=keyStr; //How can I make the casting here //SecretKey skey = kgen.generateKey(); byte[] raw = skey.getEncoded(); } I try to use BASE64Decoder instead of secretKey, but I face a porblem which is I cannot specify key length. EDIT: I want to call this function from another place static public String encrypt(String message , String key , int keyLength) throws Exception { // Get the KeyGenerator KeyGenerator kgen = KeyGenerator.getInstance("AES"); kgen.init(keyLength); // 192 and 256 bits may not be available // Generate the secret key specs. //decode the BASE64 coded message SecretKey skey = key; //here is the error raw = skey.getEncoded(); SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES"); // Instantiate the cipher Cipher cipher = Cipher.getInstance("AES"); cipher.init(Cipher.ENCRYPT_MODE, skeySpec); System.out.println("msg is" + message + "\n raw is" + raw); byte[] encrypted = cipher.doFinal(message.getBytes()); String cryptedValue = new String(encrypted); System.out.println("encrypted string: " + cryptedValue); return cryptedValue; } Any one can help, i'll be very thankful.

    Read the article

  • Is Google the only OpenID provider that requires "identifier_select"?

    - by Skrat
    I am developing an OpenID consumer in PHP and am using the fantastic LightOpenID library (http://gitorious.org/lightopenid). Basing my code off of that found in the example client script I have successfully created a consumer. However, I've run across a snag: Google requires the openid.identity and openid.claimed_id to be set to "http://specs.openid.net/auth/2.0/identifier_select" (see here). If I do that it works but other providers (i.e. AOL) don't. Here are my questions: Is Google a corner case –– is it the only OpenID provider where identifier_select is required, contrary to the OpenID specs? Is there a shortcoming in the LightOpenID library? Is my understanding of how OpenID works incorrect? If Google is not the only provider that requires identifier_select are there a finite number of them which I'll just hardcode in, or is there someway to determine this through the OpenID spec? I'm new to the internals of OpenID so I wouldn't be surprised if this is a dumb question. I haven't been able to find any info on this subject after scouring the Internet.

    Read the article

  • Python alignment of assignments (style)

    - by ikaros45
    I really like following style standards, as those specified in PEP 8. I have a linter that checks it automatically, and definitely my code is much better because of that. There is just one point in PEP 8, the E251 & E221 don't feel very good. Coming from a JavaScript background, I used to align the variable assignments as following: var var1 = 1234; var2 = 54; longer_name = 'hi'; var lol = { 'that' : 65, 'those' : 87, 'other_thing' : true }; And in my humble opinion, this improves readability dramatically. Problem is, this is dis-recommended by PEP 8. With dictionaries, is not that bad because spaces are allowed after the colon: dictionary = { 'something': 98, 'some_other_thing': False } I can "live" with variable assignments without alignment, but what I don't like at all is not to be able to pass named arguments in a function call, like this: some_func(length= 40, weight= 900, lol= 'troll', useless_var= True, intelligence=None) So, what I end up doing is using a dictionary, as following: specs = { 'length': 40, 'weight': 900, 'lol': 'troll', 'useless_var': True, 'intelligence': None } some_func(**specs) or just simply some_func(**{'length': 40, 'weight': 900, 'lol': 'troll', 'useless_var': True, 'intelligence': None}) But I have the feeling this work around is just worse than ignoring the PEP 8 E251 / E221. What is the best practice?

    Read the article

  • C++ Switch won't compile with externally defined variable used as case

    - by C Nielsen
    I'm writing C++ using the MinGW GNU compiler and the problem occurs when I try to use an externally defined integer variable as a case in a switch statement. I get the following compiler error: "case label does not reduce to an integer constant". Because I've defined the integer variable as extern I believe that it should compile, does anyone know what the problem may be? Below is an example: test.cpp #include <iostream> #include "x_def.h" int main() { std::cout << "Main Entered" << std::endl; switch(0) { case test_int: std::cout << "Case X" << std::endl; break; default: std::cout << "Case Default" << std::endl; break; } return 0; } x_def.h extern const int test_int; x_def.cpp const int test_int = 0; This code will compile correctly on Visual C++ 2008. Furthermore a Montanan friend of mine checked the ISO C++ standard and it appears that any const-integer expression should work. Is this possibly a compiler bug or have I missed something obvious? Here's my compiler version information: Reading specs from C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/specs Configured with: ../gcc-3.4.5-20060117-3/configure --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable-languages=c,c++,f77,ada,objc,java --disable-win32-registry --disable-shared --enable-sjlj-exceptions --enable-libgcj --disable-java-awt --without-x --enable-java-gc=boehm --disable-libgcj-debug --enable-interpreter --enable-hash-synchronization --enable-libstdcxx-debug Thread model: win32 gcc version 3.4.5 (mingw-vista special r3)

    Read the article

  • Python: Created nested dictionary from list of paths

    - by sberry2A
    I have a list of tuples the looks similar to this (simplified here, there are over 14,000 of these tuples with more complicated paths than Obj.part) [ (Obj1.part1, {<SPEC>}), (Obj1.partN, {<SPEC>}), (ObjK.partN, {<SPEC>}) ] Where Obj goes from 1 - 1000, part from 0 - 2000. These "keys" all have a dictionary of specs associated with them which act as a lookup reference for inspecting another binary file. The specs dict contains information such as the bit offset, bit size, and C type of the data pointed to by the path ObjK.partN. For example: Obj4.part500 might have this spec, {'size':32, 'offset':128, 'type':'int'} which would let me know that to access Obj4.part500 in the binary file I must unpack 32 bits from offset 128. So, now I want to take my list of strings and create a nested dictionary which in the simplified case will look like this data = { 'Obj1' : {'part1':{spec}, 'partN':{spec} }, 'ObjK' : {'part1':{spec}, 'partN':{spec} } } To do this I am currently doing two things, 1. I am using a dotdict class to be able to use dot notation for dictionary get / set. That class looks like this: class dotdict(dict): def __getattr__(self, attr): return self.get(attr, None) __setattr__ = dict.__setitem__ __delattr__ = dict.__delitem__ The method for creating the nested "dotdict"s looks like this: def addPath(self, spec, parts, base): if len(parts) > 1: item = base.setdefault(parts[0], dotdict()) self.addPath(spec, parts[1:], item) else: item = base.setdefault(parts[0], spec) return base Then I just do something like: for path, spec in paths: self.lookup = dotdict() self.addPath(spec, path.split("."), self.lookup) So, in the end self.lookup.Obj4.part500 points to the spec. Is there a better (more pythonic) way to do this?

    Read the article

  • Flushing writes in buffer of Memory Controller to DDR device

    - by Rohit
    At some point in my code, I need to push the writes in my code all the way to the DIMM or DDR device. My requirement is to ensure the write reaches the row,ban,column of the DDR device on the DIMM. I need to read what I've written to the main memory. I do not want caching to get me the value. Instead after writing I want to fetch this value from main memory(DIMM's). So far I've been using Intel's x86 instruction wbinvd(write back and invalidate cache). However this means the caches and TLB are flushed. Write-back requests go to the main memory. However, there is a reasonable amount of time this data might reside in the write buffer of the Memory Controller( Intel calls it integrated memory controller or IMC). The Memory Controller might take some more time depending on the algorithm that runs in the Memory Controller to handle writes. Is there a way I force all existing or pending writes in the write buffer of the memory controller to the DRAM devices ?? What I am looking for is something more direct and more low-level than wbinvd. If you could point me to right documents or specs that describe this I would be grateful. Generally, the IMC has a several registers which can be written or read from. From looking at the specs for that for the chipset I could not find anything useful. Thanks for taking the time to read this.

    Read the article

  • Sorcery/Capybara: Cannon log in with :js => true

    - by PlankTon
    I've been using capybara for a while, but I'm new to sorcery. I have a very odd problem whereby if I run the specs without Capybara's :js = true functionality I can log in fine, but if I try to specify :js = true on a spec, username/password cannot be found. Here's the authentication macro: module AuthenticationMacros def sign_in user = FactoryGirl.create(:user) user.activate! visit new_sessions_path fill_in 'Email Address', :with => user.email fill_in 'Password', :with => 'foobar' click_button 'Sign In' user end end Which is called in specs like this: feature "project setup" do include AuthenticationMacros background do sign_in end scenario "creating a project" do "my spec here" end The above code works fine. However, IF I change the scenario spec from (in this case) scenario "adding questions to a project" do to scenario "adding questions to a project", :js => true do login fails with an 'incorrect username/password' combination. Literally the only change is that :js = true. I'm using the default capybara javascript driver. (Loads up Firefox) Any ideas what could be going on here? I'm completely stumped. I'm using Capybara 2.0.1, Sorcery 0.7.13. There is no javascript on the sign in page and save_and_open_page before clicking 'sign in' confirms that the correct details are entered into the username/password fields. Any suggestions really appreciated - I'm at a loss.

    Read the article

  • Ajax and JSF 1.1 using hidden iframe with "proxy forms", what do you think about this development st

    - by Steel Plume
    Hi, currently I am using yet 1.1 specs, so I am trying to make simple what is too complex for me :p, managing backing beans with conflicting navigation rules, external params breaking rules and so on... for example when I need a backing bean used by other "views" simply I call it using FacesContext inside other backing beans, but often it's too wired up to JSF navigation/initialization rules to be really usable, and of course more simple is more useful become the FacesContext. So with only a bit of cross browser Javascript (simply a form copy and a read-write on a "proxy" form), I create a sort of proxy form inside the main user page (totally disassociated from JSF navigation rules, but using JSF taglibs). Ajax gives me flexibility on the user interaction, but data is always managed by JSF. Pratically I demand all "fictious" user actions to an hidden "iframe" which build up all needed forms according JSF rules, then a javascript simply clone its form output and put it into the user view level (CSS for showing/hiding real command buttons and making pretty), the user plays around and when he click submit, a script copies all "proxied" form values into the real JSF form inside the "iframe" that invokes the real submit of the form, what it returns is obviously dependent by your choice. Now JSF is really a pleasure :-p My real interest is to know what are your alternative strategy for using pure Ajax and JSF 1.1 without adopting middle layer like ajax4jsf and others, all good choices but too much "plugins" than specs.

    Read the article

  • Terminal-based snake game: input thread manipulates output

    - by enlightened
    I'm writing a snake game for the terminal, i.e. output via print. The following works just fine: while status[snake_monad] do print to_string draw canvas, compose_all([ frame, specs, snake_to_hash(snake[snake_monad]) ]) turn! snake_monad, get_dir move! snake_monad, specs sleep 0.25 end But I don't want the turn!ing to block, of course. So I put it into a new Thread and let it loop: Thread.new do loop do turn! snake_monad, get_dir end end while status[snake_monad] do ... # no turn! here ... end Which also works logically (the snake is turning), but the output is somehow interspersed with newlines. As soon as I kill the input thread (^C) it looks normal again. So why and how does the thread have any effect on my output? And how do I work around this issue? (I don't know much about threads, even less about them in ruby. Input and output concurrently on the same terminal make the matter worse, I guess...) Also (not really important): Wanting my program as pure as possible, would it be somewhat easily possible to get the input non-blockingly while passing everything around? Thank you!

    Read the article

  • What's the difference between UI development and front-end development?

    - by Nick Lowman
    I'm a front-end developer and really enjoy jQuery and JavaScript. I've built a lot a websites, done some good jQuery work and built a few JavaScript based applications and would really like to get in UI development. Or so I thought. I guessed it would be pretty similar to what I already do except maybe a little more JavaScript heavy but when I looked into it all the job specs said I needed to know about Scrum or Agile development, knowledge of testing frameworks and a good knowledge of JavaScript frameworks and custom events. So, from the specs I get the idea that a UI developer is actually a dedicated JavaScript developer. Is that the case? I understand (with much help from the users on stackoverflow), about JavaScript OO, inheritance, closures, custom events, debugging in Firefox or Aptana etc, and the people I work with seem to think I pretty OK at what I do but clearly my knowledge is not good enough to go for UI jobs. If anyone could tell me a little more about UI development and if there are any good resources for learning about it I would be most grateful as I couldn't find much on the internet.

    Read the article

  • Hackintosh EEE PC 1000HE

    - by user10580
    I've really wanted to dual boot windows with snow leopard on my EEE PC 1000HE netbook, and am looking for advice or a guide. I've found several guides for other EEE PC models with the same processor and similar specs, but am nervous about setting out on the task without a specialized guide. Any help or suggestions will be appreciated.

    Read the article

  • New Computer Build Questions

    - by MJ
    I'm in the process of gathering parts and specs for a new machine. I wear many hats, so the machine needs to do a lot. I need at least 2 monitor support, if not three. I also play many online MMOs (wow, aion, war hammer, etc), along with some freelance programming projects. I already have a case which is very large, so it will fit anything. I have 2 other SATA HDs. They are more for storage and basic programs. I feel that the best improvement could be done with a solid state HD, true or not? I'm more of a software/programming guy, so ANY input at all on improving this system build would be appreciated. I have a few questions with this list. AMD or Intel? I don't know enough about either to choose what would best fit me. Thanks! **EDIT: Thanks for the input everyone! Here are some answers: I do a lot of programming and gaming, so I do need things for both. The newer video card covers the gaming aspect, as well as allowing me to have many monitors. (hopefully upgrade to dual 30' or more) I don't need any additional HDs at this time. I have a SATA 160g and 120g from my previous computer, and a NAS system with over 2TB of storage on the homenetwork. I just wanted a fast HD for OS/programs/games. With the memory. I have used G.SKILL before in 2 system builds. It's done excellent for me in them. Very stable. **EDIT2: Made some additional changes. Lowered the power supply down to 750, which saves me more $$. Also changed the SSD to 2 WD 650G HDs. Thinking of doing a CPU upgrade to the 3.4GHZ AMD Phenom II X4 965 Black Edition Deneb 3.4GHz System Specs - Budget:$1500 CPU: AMD Phenom II X4 955 Black Edition Deneb 3.2GHz MB: GIGABYTE GA-MA790GPT-UD3H AM3 AMD 790GX HDMI ATX Memory: G.SKILL 4GB (2 x 2GB) 240-Pin DDR3 SDRAM DDR3 1333 (PC3 1066 Video: DIAMOND 5870PE51G Radeon HD 5870 (Cypress XT) 1GB 256-bit GD Power Supply: XCLIO GREATPOWER 1000W ATX12V SLI Ready CrossFire Ready HD:Intel X25-M Mainstream SSDSA2MH080G2C1 2.5" 80GB SATA II MLC Changes: Power Supply: CORSAIR CMPSU-750TX 750W ATX12V / EPS12V HD: 2x Western Digital Caviar Blue WD6400AAKS 640GB CPU: AMD Phenom II X4 965 Black Edition Deneb 3.4GHz

    Read the article

  • proftpd on debian - authuserfile

    - by dirknibleck
    I have installed proftpd on my debian 4.0 server. I have modified the proftpd.conf file so that there is a statement for AuthUserFile, which points to a valid file. The file is configured per the proftpd specs, however the user that I have placed in this file is not able to log-in to the server. What could I be doing wrong? AuthUserFile is of the format: username:passwd:999:1002:www:/var/www:/bin/bash

    Read the article

  • Difference between Xen PV, Xen KVM and HVM?

    - by JP19
    Hi, I know that Xen is usually better than OpenVZ as the provider cannot oversell in Xen. However, what is the difference between Xen PV, Xen KVM and HVM (I was going through this provider's specs? Which one is better for what purposes and why? Edit: For an end-user who will just be hosting websites, which is better? From efficiency or other point of view, is there any advantage of one over the other?

    Read the article

  • How to get ASUS UEFI BIOS EZ Mode utility on my asus laptop?

    - by Manoj Kumar
    i have asus laptop with the following specs: Manufacturer ASUSTeK Computer Inc. Model K53SC (CPU 1) Version 1.0 Chipset Vendor IntelBIOS Brand American Megatrends Inc. Version K53SC.208 Chipset Model Sandy Bridge BIOS Brand American Megatrends Inc. Version K53SC.208 Operating System MS Windows 7 Ultimate 64-bit In the BIOS setting i have enabled 'UEFI' but im not unable to see the graphical interface of UEFI.

    Read the article

  • Remap paths used in Windows Movie Maker projects

    - by Fuxi
    I need to rebuild path structures for old Windows Movie Maker projects under a new Windows 7 install. The problem is that those projects refer to files of a certain file path that can't be rebuiltd in Windows 7 ("Documents and Settings" is blocked). Is there a way to batch convert those projects with updated paths? Some file specs of the WMM file format (for coding a little utility) would be helpful as well.

    Read the article

  • Float table to bottom of page in Word 2007

    - by Christian W
    Is it possible to float a table to the bottom of a page in Word 2007? I am making a template for revisable documents for work (specs, routines etc) and I want the front page to contain the document title, and a table of revisions. I want to float this table to the bottom of the page. So as I add rows to it, it grows upwards towards the title (which is at top of page, and not middle.) Is this possible?

    Read the article

  • Windows 7 x64 installation freezes on new PC build

    - by jhsowter
    Symptoms While attempting to install Windows 7 (64 bit) on my new PC build, it freezes usually at the point where it is expanding the windows image, but has frozen as early as accepting the licence agreement, and as late as just after the first restart. My specs are at the bottom of the post. So far I have tried the following to identify the problem, in rough chronological order: Tried different hard drives with different sata cables. Same symptoms. I later used a different computer to install windows on the same hard drive with no problems. Tried the RAM in different slots, and tried one RAM stick instead of two. Same symptoms. Updated the BIOS to 1.60. Same symptoms. Ran Memtest86+ with RAM in dual channel. It passed about 6 times when I left it running overnight. Used USB to install windows instead of an optical drive. Same symptoms. Change SATA configuration from AHCI to IDE. Same symptoms. Tried various different SATA ports. Same symptoms. Updated BIOS to 1.70. Same symptoms. I saw the RAM did not list my motherboard as being supported even though the motherboard did list the RAM as being supported. So I tried some Kingston DDR3 1333MHz RAM instead. Same symptoms. Other (possibly) pertinent information My CPU idles at about 30 °C. I can't tell what it gets to when it's working. When I installed the CPU, the lever which locks the CPU in place took quite a bit of force to pull down. Now I didn't just yank it down without rechecking the CPU was seated properly about 5 times, but it does seems unusual, and I wonder if the CPU was seated badly if I would see these symptoms? I am out of ideas and don't know how to diagnose any further. I suppose either the motherboard or CPU must be the problem. I am on the verge of taking it to a specialist. The Question How should I proceed from here? Is there anything I can rule out as being the source of the symptoms I am seeing? My Specs CPU: Intel i5 3570k RAM: G.Skill RipjawsX 8GB kit HDD: single 3.5" 500GB SATA or 160GB 2.5" SATA (at different times and sometime together. But no RAID or anything). MB: ASRock Extreme4 Z77 PSU: Silverstone Strider Plus 600W ST60F-P

    Read the article

  • Dealing with Word spell check in technical documents?

    - by Robert MacLean
    I have waste millions of hours clicking the Ignore Once button in Word, while trying to spell check a document related to development. Be that something light on terms like a proposal or something worse like technical specs. I'm beginning to think that this is a huge waste and someone may have developed a dictionary for Word with common development terms that I could add and no longer have this problem. Does such a dictionary exist or is there some other tricks to use to improve this process?

    Read the article

  • Mobile CPU vs. Ultra-low CPU: performance

    - by Mike
    I'm choosing a new laptop and one of the questions is a type of CPU — mobile or ultra-low voltage. If to be more precise, I'm torn between two models of Intel Core i5 — i5-2410M and i5-3317U. Here is a comparison table. According to official specs the first-one has 2.3 GHz clock speed, while the second-one has only 1.7 GHz, that's about 25% difference. Is it really important parameter and which CPU is more preferable for a laptop for development, media and internet purposes?

    Read the article

  • AMD Opteron BSOD - A clock interrupt was not received on a secondary processor within the allocatio

    - by laurens
    On one of our servers we got an -for me new- BSOD with the error message: "A clock interrupt was not received on a secondary processor within the allocation time interval" The server's specs: HP XW9400 2x Dual-Core AMD Opeteron 2224 SE 3,20Ghz (4CPUs) 16GB HP ECC RAM Windows 2008 R2 Enterprise 64bit Nvidia Quadro 4xxx graphics (?) Sounds familiar to someone ? Thanks in advance

    Read the article

  • movie maker problem: re-map paths

    - by Fuxi
    hi, i've upgraded to win7 (on a new machine) and wanted to use my old moviemaker projects again. the problem is that those projects refer to files of a certain path-structure which i can't rebuild under win7 ("documents and settings" is blocked). is there a way to kind of batch-convert those projects? some file specs of the MSWMM file format (for coding a little utility) would be helpful aswell. thx

    Read the article

  • Installing and using 32-bit software in 64-bit Linux

    - by Isxek
    Is there a way to install and run i386 software packages inside an AMD64 version of Xubuntu (v9.10)? Just to get an idea, how much effort would it require to port it to something usable within the said OS. I imagine it would be a lot. Thanks! If you need more info (specs, etc.) let me know.

    Read the article

  • Black screen when switching users on HP laptop (running vista)

    - by davepreston
    Vista machine: When I switch users I get a black screen for 30+ seconds. Doesn't seem to matter who is logged in. Delay happens when I click "switch user" but not when I lock the screen and log back in as same user. Specs: Windows Vista 64-bit; HP pavilion dv9710t laptop; 17" screen (best guess is that it has something to do with display settings, not sure)

    Read the article

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