Search Results

Search found 125 results on 5 pages for 'kenny peng'.

Page 2/5 | < Previous Page | 1 2 3 4 5  | Next Page >

  • $stdin compatibility with std::istream using swig, C++, and Ruby

    - by Kenny Peng
    I have a function in C++ that takes in an std::istream as the input: class Foo { Foo(std::istream &); } Using SWIG, I've bound it to Ruby, but Ruby's $stdin variable is fundamentally different from anything like the stream classes in C++, so I'm not sure how to either 1) expose the C++ class to Ruby in a way that I can use $stdin, or 2) convert $stdin into something the C++ class can understand. Anyone have experience with binding iostreams in C++ to Ruby? Thanks.

    Read the article

  • Ruby TypeErrors involving `expected Data`

    - by Kenny Peng
    I've ran into situations where I have gotten these expected Data errors before, but they have always pointed to ActiveRecord not playing well with other libraries in the past. This piece of code: def load(kv_block, debug=false) # Converts a string block to a Hash using split kv_map = StringUtils.kv_array_to_hash(kv_block) # Loop through each key, value kv_map.each do |mem,val| # Format the member from camel case to underscore member = mem.camel_to_underscore() # If the object includes a method to set the key (i.e. the key # is a member of self), invoke the method, setting the value of # the member) if self.methods.include?(member.to_set_method_name()) then # Exception thrown here self.send(member.to_set_method_name(), val) # Else, check for the same case, this time for an instance variable elsif self.instance_variable_defined?(member.to_instance_var_name()) self.instance_variable_set(member.to_instance_var_name(), val) # Else, complain that the object doesn't understand the key with # respect to its class definition. else raise ArgumentError, "I don't know what to do with #{member}. #{self.class} does not have a member or function called #{member}" end end end produces the error wrong argument type #<Class:0x11a02088> (expected Data) (TypeError) in the each loop on the first if test. I've inspected a post-mortem debugging instance using rdebug, and running that line manually, it works without a hitch. Has anyone seen this error before and what's been your solution to it? I used to think it was ActiveRecord and other gems stomping on each other's definitions, but I removed any references to ActiveRecord and this still occurs.

    Read the article

  • Pass Types as arguments to a function in Haskell?

    - by Charles Peng
    The following two functions are extremely similar. They read from a [String] n elements, either [Int] or [Float]. How can I factor the common code out? I don't know of any mechanism in Haskell that supports passing types as arguments. readInts n stream = foldl next ([], stream) [1..n] where next (lst, x:xs) _ = (lst ++ [v], xs) where v = read x :: Int readFloats n stream = foldl next ([], stream) [1..n] where next (lst, x:xs) _ = (lst ++ [v], xs) where v = read x :: Float I am at a beginner level of Haskell, so any comments on my code are welcome.

    Read the article

  • how to insert based on the date

    - by Gaolai Peng
    I have a table table1 (account, last_contact_date, insert_date), account and last_contact_date are primary keys. The insert_date is set with the time the recored being added by calling getdate(). I also have a temporary table #temp(account, last_contact_date) which I use to update the table1. Here are sample data: table1 account last_contact_date insert_date 1 2012-09-01 2012-09-28 2 2012-09-01 2012-09-28 3 2012-09-01 2012-09-28 #temp account last_contact_date 1 2012-09-27 2 2012-09-27 3 2012-08-01 The result table depends on the inserting date. If the date is 2012-09-28, the result will be table1 account last_contact_date insert_date 1 2012-09-27 2012-09-28 2 2012-09-27 2012-09-28 3 2012-09-01 2012-09-28 If the date is 2012-09-29, the result will be table1 account last_contact_date insert_date 1 2012-09-01 2012-09-28 2 2012-09-01 2012-09-28 3 2012-09-01 2012-09-28 1 2012-09-27 2012-09-29 2 2012-09-27 2012-09-29 Basically the rule is (1) if the inserting date is the same day, i will pick the lastest last_contact_date, otherwise, (2) if the last_contact_date is later than the current last_contact_date, I will insert a new one. How do I write a query for this insert?

    Read the article

  • how to multi-boot/upgrade linux from LVM-based partition

    - by kenny-bobby
    i currently have FC3 linux which installed itself on the hard disk using LVM partitioning, so it is basically all one big partition. i would like to try some other distributions and upgrade to something newer, but don't want to lose my current capabilities and data files, and i know nothing or less about LVM. Is it possible (and if so an example would be nice) to install a non-LVM-based distribution on the LVM disk and have multi-boot options? Or do i have to start over new and drop the LVM? My guess is that i should save my /home (data files and .rc files) on a backup device first, then somewhere/somehow create a new partion for installing another distribution. Any LVM experts out there that have tried anything like this--well i sure could use some pointers and advice...

    Read the article

  • Can I rebuild degraded RAID1 on a SAS 5 i controller with a larger mirror drive size?

    - by Kenny
    A drive failed on a Dell SAS 5i controller - see controller bios screengrab: http://imagebin.ca/view/SkZbszA.html The primary is a 160GB 10k sata drive. I added a 250GB 7k rpm drive in the hope that the array would rebuild onto this drive. This did not happen. (assuming that the controller would just operate at the speed of the slowest drive) The controller could see the new drive, but it didn't automatically rebuild the raid1 onto this drive. (my assumption is that it did not do this rebuild as the drive sizes are different). There was an option to add the new drive to the existing raid1 array - but when I tried this a message appeared stating that all data on the array would be lost. (I didn't get a screenshot of this message, I will later) Should the SAS 5i allow me to rebuild the array onto a larger drive? Is the option to add the drive to the array the right way to go? Many thanks!

    Read the article

  • Can I be a wireless server WITHOUT offering internet?

    - by Kenny Hendrick
    I would like to pull into a truck stop and offer a folder of free documentaries to quell some of the ignorance LOL I run Linux ";-) Very happy to have made that switch by the way...and have an internal wireless in the laptop but my bus has an antenna on the roof which I connect via usb to create a wireless signal (this is the one I'd like to focus on since it will offer the most reach to all those truckers out there. My question is this. I'm running apache2 and have a bunch of videos tossed into the www folder and can access it locally and would like others that frown on paying to use the truckstops slow internet service and would like an alternative by simply logging onto me and getting the narrow content I offer freely without passwords and the like. Has anyone a good means of doing this? p.s. I've done this in the past but am getting old and forgetful (my crutch)

    Read the article

  • Fast Ethernet module for Cisco 2620

    - by Kenny Rasschaert
    I have a Cisco 2620 Router. It comes with one fast ethernet port built in (circled in red), and one old AUI ethernet module is installed (circled in blue). I figure I can put a transceiver on the AUI interface to get a second RJ45 connector. What I'd really like to have is a second fast ethernet connector. The ideal candidate to achieve this would be the NM-1FE-TX module. Cisco claims on their website that this module is not suitable for the Cisco 2620 and Cisco 2620XM. It says so in "Table 2 Physical Limitation of Serial Modules per Chassis". Indeed, this module was designed for the 3600 series of routers. I've seen claims on the internet, however, of people having this module on a 2620XM, and it being fully functional. This claim gains some credibility because of the fact that in Cisco's own Packet Tracer software, you can install this module on the 2620XM router. I'm looking for a definitive answer. Will this module work on a Cisco 2620? Is there perhaps another way to get a second fast ethernet port on this device?

    Read the article

  • Roundcube can't connect to PostgreSQL database

    - by kenny.r
    I'm trying to install Roundcube on a CentOS 5.5 server, with a PostgreSQL 8.1.22 database. The first page of the installer script, that checks for the presence of php libraries and such, gives me green OKs across the board. I even went out of my way to install the optional ones. Page two generates me two configuration files (main.inc.php and db.inc.php) which I put into place. Page three is where things go wrong: Check DB config DSN (write): NOT OK(MDB2 Error: connect failed) Make sure that the configured database exists and that the user has write privileges DSN: pgsql://roundcube:password@localhost/roundcubemail The info you see there (user roundcube, password password, server localhost and database roundcubemail) is all correct. The database roundcubemail belongs to the user roundcube and it has write permissions. I have no clue why it can't connect to that database. I'm managing it with phpPgAdmin, which is running on the very same Apache, on the same server!

    Read the article

  • Windows Share authentication from Active Directory Linux login

    - by Kenny
    I'm using Active Directory to log into RHEL. To do this, I followed the steps outlined here: http://www.markwilson.co.uk/blog/2007/05/using-active-directory-to-authenticate-users-on-a-linux-computer.htm I'd like to be able to read data from Windows Servers shared folders without being prompted for a password. On Windows I log into an AD domain, and when I access windows file shares on a server on the LAN (also part of the AD domain) my I can just access them with no authentication step. I've used SMBclient on Linux to access these shares, but it asks for my password. I would like to be able to script access to the data on the shares, but I can't if there's a password prompt in the way. Well, I could, but it's not how I want to do it. Now, since I'm logged in using my active directory username & password, can't I just access the shares without jumping that extra hoop? I know I can mount the share using something like: //192.168.0.5/share /mnt/windows cifs auto,username=steve,password=secret,rw 0 0 but access will depend who is logged in... each user logging in should have their own unique AD access privelages. Thanks for reading!

    Read the article

  • Windows Share authentication from Active Directory Linux login

    - by Kenny
    Hi, I'm using Active Directory to log into RHEL. To do this, I followed the steps outlined here: http://www.markwilson.co.uk/blog/2007/05/using-active-directory-to-authenticate-users-on-a-linux-computer.htm I'd like to be able to read data from Windows Servers shared folders without being prompted for a password. On Windows I log into an AD domain, and when I access windows file shares on a server on the LAN (also part of the AD domain) my I can just access them with no authentication step. I've used SMBclient on Linux to access these shares, but it asks for my password. I would like to be able to script access to the data on the shares, but I can't if there's a password prompt in the way. Well, I could, but it's not how I want to do it. Now, since I'm logged in using my active directory username & password, can't I just access the shares without jumping that extra hoop? I know I can mount the share using something like: //192.168.0.5/share /mnt/windows cifs auto,username=steve,password=secret,rw 0 0 but access will depend who is logged in... each user logging in should have their own unique AD access privelages. Thanks for reading!

    Read the article

  • Django, wsgi, py. what's the difference?

    - by Kenny
    I'm trying to get a django application up and running on my cpanel system. I've installed mod_wsgi, and am following the guide here: http://www.nerdydork.com/setting-up-django-on-a-whm-cpanel-vps-liquidweb.html However, I'm now confused as I don't know what to do next. The application has .py files, and I am able to run it via this: python manage.py runserver 211.144.131.148:8000 However, that's via command line and binds to port 8000. I want to use Apache instead. The question is, that tutorial doesn't go further into how to get apache to recognize .py files and run the application as I want it. What do I do next?

    Read the article

  • WDS - Access to network share via local user

    - by Kenny Bones
    When installing Windows 7 using WDS, a local user account is used during the set up after the main image of Win7 is installed. And I've got this application that lies on the network and not the deploymentshare itself that I want to install. But logically I get no access to that share via the local user account. Is it possible to do this somehow? Or do I have to move the Share to the Deployment share? Or possibly map the share to a separate drive or something?

    Read the article

  • Can I rebuild degraded RAID1 on a SAS 5 i controller with a larger mirror drive size?

    - by Kenny
    Hi, A drive failed on a Dell SAS 5i controller - see controller bios screengrab: http://imagebin.ca/view/SkZbszA.html The primary is a 160GB 10k sata drive. I added a 250GB 7k rpm drive in the hope that the array would rebuild onto this drive. This did not happen. (assuming that the controller would just operate at the speed of the slowest drive) The controller could see the new drive, but it didn't automatically rebuild the raid1 onto this drive. (my assumption is that it did not do this rebuild as the drive sizes are different). There was an option to add the new drive to the existing raid1 array - but when I tried this a message appeared stating that all data on the array would be lost. (I didn't get a screenshot of this message, I will later) Should the SAS 5i allow me to rebuild the array onto a larger drive? Is the option to add the drive to the array the right way to go? Many thanks!

    Read the article

  • Windows 8 Automatic Logon Tick Box Missing

    - by Luke Kenny
    Recently (in the past few days,) perhaps following the latest Windows Update, it appears the tick box to allow automatic logon in "control userpasswords2" or "netplwiz" has disappeared. I have two machines running Windows 8 and the option is no longer available for either. Both machines user a Microsoft account, rather than a local account, for the primary user to logon. The only other recent change I can think of, and I am confident this change was made well before this issue arose, was enabling HomeGroup. How can I re-enable automatic logon for the affected user?

    Read the article

  • Sharepoint 2007 - Transaction log full

    - by Kenny Bones
    So I have this SharePoint 2007 site that is basically trash. I'm supposed to just toss it, but I'm in need of copying all of the data in form of traditional files and folders from certain projects. And since the transaction log is full, it's so damn slow. Even opening SharePoint takes up to 15 minutes, or it won't open at all. Copying of files is extremely slow. So I'm in need of a quick fix here. Just to be able to copy out some files and folders. I don't need to fix the problem per se. What can I do to fix it temporarily to be able to copy out the data?

    Read the article

  • GPO - Setting not applied, although policy is applied

    - by Kenny Bones
    This is rather strange. In our domain we have several terminal servers and this morning a user reported that no drives are mapped when he logs on to the terminal server. So, I checked Group Policy Results and compare two users. Both users have the exact same policies applied. But for this particular user, the Script section under User Configuration - Policies - Windows Settings is just not there. For the other user, which this is working fine for, it says under the Script section that Winning GPO is Terminal2008, which is the GPO that contains the script section. And the Terminal2008 GPO is applied to both users. Also, the loopback processing is set to Replace. What could be the cause for this? I've never seen this particular issue before. I mean, both users are in the same OU, they log on to the same terminal server and the same policies are applied to both. They do not however have the exact same group memberships, but should that matter? It's not stated that the script should be run only if the user is a member of a certain group either. Not sure if that could be done through that specific setting either.All I know is, the very same policies are applied to both users, in the same OU and the same computer. Meaning, the same policies should be applied? Edit: I just ran Group Policy Results on one of the other terminal servers, which are also in the same OU, and the Scripts section is there! This means that this particular user don't get this setting when he's logged onto this particular server. What could be the cause of this?

    Read the article

  • How to manipulate this string of text to make it readable?

    - by Kenny
    I have this string in an excel file: 4603,2504603#;4616,2504616#;4617,2504617#;4519,2504519#;4620,2504620 (It's actually a lot longer than that, but the pattern is the same). I need to be able to some how sort this into something that can be read easier. I want the end result to look like this: 4603,2504603 4616,2504616 4617,2504617 I guess I need a program or command that can replace #; with a line break. I need something that will work in Windows 7. I remember doing something similar to this in a Linux class using shell scripting but I can't remember how it was done. Note: This is NOT homework. It is something my boss has asked me to do at work.

    Read the article

  • Google I/O 2011: Map your business, inside and out

    Google I/O 2011: Map your business, inside and out Brendan Kenny, Chris Broadfoot Your map doesn't have to end at the front door of the building! In this session we will discuss approaches to mapping all of your business locations, and not just on the outside. We'll show how to build a sensational storefinder, and then add floorplans, indoor Street View, and resource search. From: GoogleDevelopers Views: 4896 28 ratings Time: 51:31 More in Science & Technology

    Read the article

  • Silverlight Cream for June 10, 2010 -- #879

    - by Dave Campbell
    In this Issue: Emiel Jongerius, Nokola, Christian Schormann, Tim Heuer, David Poll, Mike Snow(-2-), John Papa, and Charles Petzold. Shoutout: Viktor Larsson has a frank look at WP7 based on information from MIX10 and what was said this week in his post: Licking Windows Phone 7... yeah licking, not liking :) .. my guess is even that didn't allow him to keep it! If you haven't already noticed, the CodeProject reader's choice awards are out this week and Telerik won for their RadColorPicker and RadCalendar for Silverlight Telerik also needs congratulations for winning Telerik wins “Best of TechEd” award in the “Components and Middleware” category... check out that trophy... Steven Forte has a picture up of the Telerikers after getting the award. Koen Zwikstra has a new release of Silverlight Spy up that supports the latest release: Silverlight Spy 3.0.0.12 From SilverlightCream.com: Localization of XAML files in Silverlight Emiel Jongerius is back with another post, this time discussing Localizing XAM files... external links and source included. Coolest Silverlight Sound Library for Games I've Seen Yet Nokola talks up a Sound Library for Silverlight 4 Games ... and has links to a great demo, plus the source. SketchFlow: Firing Actions when a Storyboard is Complete Christian Schormann responded to some Twitter questions and demonstrates using the StoryboardCompleted trigger with a Navigate action. Hosting cross-domain Silverlight applications (XAP) Tim Heuer responds to a question from a reader and demonstrates how to host a XAP from a domain other than the one you're working on. Taking Microsoft Silverlight 4 Applications Beyond the Browser (TechEd WEB313) David Poll has all his material up from his TechEd presentation earlier this week on Silverlight OOB... and he covered some pretty extensive material ... check it out! Silverlight Tip of the Day #29 – Configuring Service Reference to Back to LocalHost Mike Snow has a couple new tips up... this first one is quick, but very useful... how to switch your service reference back to localhost without pulling out your hair. Silverlight Tip of the Day #30 – Sending Email from Silverlight In Mike Snow's latest tip, he shows how to send email from your Silverlight app... using a WCF service... and a step-by-step set of instructions. Creating Rich Interactions Using Blend 4: Transition Effects, Fluid Layout and Layout States (Silverlight TV #32) John Papa has Silverlight TV #32 up, and he's talking with Kenny Young of the Expression Blend team while Kenny uses some built-om effects and also creates some impressive examples from scratch -- code included. Simulating Touch Inertia on Windows Phone 7 Charles Petzold has a post up on simulating inertia on WP7... demos in WPF and then moves into WP7... math, source, and external links. Stay in the 'Light! Twitter SilverlightNews | Twitter WynApse | WynApse.com | Tagged Posts | SilverlightCream Join me @ SilverlightCream | Phoenix Silverlight User Group Technorati Tags: Silverlight    Silverlight 3    Silverlight 4    Windows Phone MIX10

    Read the article

  • Google I/O 2012 - Spatial Data Visualization

    Google I/O 2012 - Spatial Data Visualization Brendan Kenny, Enoch Lau Maps were among the first data visualizations, but they can also provide the backdrop for visualizing your own spatial data. In this session, we'll take a voyage through the world of map based data visualization, arming you with the tools you need to most effectively bring your data to life on a map using the Maps API v3. For all I/O 2012 sessions, go to developers.google.com From: GoogleDevelopers Views: 1053 26 ratings Time: 01:00:17 More in Science & Technology

    Read the article

  • Experiments in Big Data Visualization on Maps

    Experiments in Big Data Visualization on Maps Brendan Kenny and Mano Marks continue their series on using the CanvasLayer library and HTML5 APIs to visualize large amounts of data on top of Google maps. This week they look at loading Shapefiles and KML directly in the browser and using WebGL to render their content over a map. From: GoogleDevelopers Views: 0 1 ratings Time: 00:00 More in Science & Technology

    Read the article

  • IE7 not digesting JSON: "parse error" [resolved]

    - by Kenny Leu
    While trying to GET a JSON, my callback function is NOT firing. $.ajax({ type:"GET", dataType:'json', url: myLocalURL, data: myData, success: function(returned_data){alert('success');} }); The strangest part of this is that my JSON(s) validates on JSONlint this ONLY fails on IE7...it works in Safari, Chrome, and all versions of Firefox, (EDIT: and even in IE8). If I use 'error', then it reports "parseError"...even though it validates! Is there anything that I'm missing? Does IE7 not process certain characters, data structures (my data doesn't have anything non-alphanumeric, but it DOES have nested JSONs)? I have used tons of other AJAX calls that all work (even in IE7), but with the exception of THIS call. An example data return (EDIT: This is a structurally-complete example, meaning it is only missing a few second-tier fields, but follows this exact hierarchy)here is: {"question":{ "question_id":"19", "question_text":"testing", "other_crap":"none" }, "timestamp":{ "response":"answer", "response_text":"the text here" } } I am completely at a loss. Hopefully someone has some insight into what's going on...thank you! EDIT Here's a copy of the SIMPLEST case of dummy data that I'm using...it still doesn't work in IE7. { "question":{ "question_id":"20", "question_text":"testing :", "adverse_party":"none", "juris":"California", "recipients":"Carl Chan" } } EDIT 2 I am starting to doubt that it is a JSON issue...but I have NO idea what else it could be. Here are some other resources that I've found that could be the cause, but they don't seem to work either: http://firelitdesign.blogspot.com/2009/07/jquerys-getjson.html (Django uses Unicode by default, so I don't think this is causing it) Anybody have any other ideas? ANSWER I finally managed to figure it out...mostly via tedious trial-and-error. I want to thank everyone for their suggestions...as soon as I have 15 rep, I'll upvote you, I promise. :) There was basically no way that you guys could have figured it out, because the issue turned out to be a strange bug between IE7 and Django (my research didn't bring up any similar issues). We were basically using Django template language to generate our JSON...and in the midst of this particular JSON, we were using custom template tags: {% load customfilter %} { "question":{ "question_id":"{{question.id}}", "question_text":"{{question.question_text|customfilterhere}}" } } As soon as I deleted anything related to the customfilter, IE7 was able to parse the JSON perfectly! We still don't have a workaround yet, but at least we now know what's causing it. Has anyone seen any similar issues? Once again, thank you everyone for your contributions.

    Read the article

  • Error using eclipse for Android - No resource found that matches the given name.

    - by Kenny
    Common problem I'm sure, but I can't figure it out. In my AndroidManifest.xml and main.xml I'm getting the no resource found that matches the given name. I've double checked for typos and it used to work, but now I'm popping up with all these errors saying it can't find my strings in my strings.xml. These are the ones I'm getting errors for in my main.xml. <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="10dip" android:text="@string/instructions" /> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="10dip" android:text="@string/level_prompt" /> <Spinner android:id="@+id/spinner" android:layout_width="fill_parent" android:layout_height="wrap_content" android:prompt="@string/level_array" /> These are the ones I'm getting for my androidmanifest.xml. <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".HelloFormStuff" android:label="@string/title"> This is what my strings.xml looks like. <string name="title">Title</string> <string name="app_name">Application name</string> <string name="instructions">Enter instructions here.</string> <string name="level_prompt">Choose an item</string> <string-array name="level_array"> <item>Item One</item> <item>Item Two</item> <item>Item Three</item> <item>Item Four</item> </string-array> Any ideas? Any help would be appreciated!!

    Read the article

< Previous Page | 1 2 3 4 5  | Next Page >