Search Results

Search found 4637 results on 186 pages for 'john deerikio'.

Page 101/186 | < Previous Page | 97 98 99 100 101 102 103 104 105 106 107 108  | Next Page >

  • R: How can I use apply on rows of a data.frame and get out $column_name?

    - by John
    I'm trying to access $a using the following example: df<-data.frame(a=c("x","x","y","y"),b=c(1,2,3,4)) > df a b 1 x 1 2 x 2 3 y 3 4 y 4 test_fun <- function (data.frame_in) { print (data.frame_in[1]) } I can now access $a if I use an index for the first column: apply(df, 1, test_fun) a "x" a "x" a "y" a "y" [1] "x" "x" "y" "y" But I cannot access column $a with the $ notation: error: "$ operator is invalid for atomic vectors" test_fun_2 <- function (data.frame_in) { print (data.frame_in$a) } >apply(df, 1, test_fun_2) Error in data.frame_in$a : $ operator is invalid for atomic vectors Is this not possible?

    Read the article

  • Does a program exist for checking two similar directories for file differences?

    - by John Sullivan
    Is there a program to compare one folder and all subfolders to another folder and all subfolders for differences in the files contained therein (presence, absence of files, size and list of filenames)? Example of usage: I have 100 DLL files from environment 1 and I want to check if any of them are different (in size and date modified) from the 100 DLL files in environment 2. So I copy and paste all the DLLs in environment 1 into directory A, and all the DLLs in environment 2 into directory B. I then run my "directory comparison" program on directories A and B and find out that, aha, here is a list of 7 DLLs that have different modified dates and times between the two directories. EDIT: OS is windows XP

    Read the article

  • Model a Zero or One to Many Relationship

    - by John
    How should I model a zero or one to a many relationship in the database? For example, a user record may or may not have a parent. So should my user table have a t_user.parent_id or should I have an associative table called t_user_hierarchy with the columns t_user_hierarchy.parent_id and t_user_hierarchy.user_id?

    Read the article

  • Drupal's not reading correct values from DB

    - by John
    Hey Everyone, Here is my current problem. I am working with the chat module and I'm building a module that notifies users via AJAX that they have been invited to a chat. The current table structure for the invites table looks like this: |-------------------------------------------------------------------------| | CCID | NID | INVITER_UID | INVITEE_UID | NOTIFIED | ACCEPTED | |-------------------------------------------------------------------------| | int | int | int | int | (0 or 1) | (0 or 1) | |-------------------------------------------------------------------------| I'm using the periodical updater plug-in for JQuery to continually poll the server to check for invites. When an invite is found, I set the notified from 0 to 1. However, my problem is the periodical updater. When I first see that there is an invite, I notify the user, and set notified to 1. On the next select though, I get the same results before, as if the update didn't work. But, when I got check the database, I can see that it worked just fine. It's as if the query is querying a cache, but I can't figure it out. My code for the periodical updater is as follows: window.onload = function() { var uid = $('a#chat_uid').html(); $.PeriodicalUpdater( '/steelylib/sites/all/modules/_chat_whos_online/ajax/ajax.php', //url to service { method: 'get', //send data via... data: {uid: uid}, //data to send minTimeout: '1000', //min time before server is polled (milli-sec.) maxTimeout: '20000', //max time before server is polled (milli-sec.) multiplyer: '1.5', //multiply against curretn poll time every time constant data is returned type: 'text', //type of data recieved (response type) maxCalls: 0, //max calls to make (0=unlimited) autoStop: 0 //max calls with constant data (0=unlimited/disabled) }, function(data) //callback function { alert( data ); //for now, until i get it working } ); } And my code for the ajax call is as follows: <?php #bootstrap Drupal, and call function, passing current user's uid. function _create_chat_node_check_invites($uid) { cache_clear_all('chatroom_chat_list', 'cache'); $query = "SELECT * FROM {chatroom_chat_invite} WHERE notified=0 AND invitee_uid=%d and accepted=0"; $query_results = db_query( $query, $uid ); $json = '{"invites":['; while( $row = db_fetch_object($query_results) ) { var_dump($row); global $base_url; $url = $base_url . '/content/privatechat' . $uid .'-' . $row->inviter_uid; $inviter = db_fetch_object( db_query( "SELECT name FROM {users} WHERE uid = %d", $row->inviter_uid ) ); $invitee = db_fetch_object( db_query( "SELECT name FROM {users} WHERE uid = %d", $row->invitee_uid ) ); #reset table $query = "UPDATE {chatroom_chat_invite} " ."SET notified=1 " ."WHERE inviter_uid=%d AND invitee_uid=%d"; db_query( $query, $row->inviter_uid, $row->invitee_uid ); $json .= '['; $json .= '"' . $url . '",'; $json .= '"' . ($inviter->name) . '",'; $json .= '"' . ($invitee->name) . '"' ; $json .= '],'; } $json = substr($json, 0, -1); $json .= ']}'; return $json; } ?> I can't figure out what is going wrong, any help is greatly appreciated!

    Read the article

  • Working with EnumSet class in GWT

    - by zenmonkey
    I am having trouble using EnumSet on the client side. I get this runtime error message: java.util.EnumSet.EnumSetImpl is not default instantiable (it must have a zero-argument constructor or no constructors at all) and has no custom serializer. Is this is a known issue? Here is what I am doing (basically a hello world app) Service: String echo (EnumSet<Names> name) throws IllegalArgumentException; Client: echoServ.echo (EnumSet.of(Names.JOHN), new AsyncCallback<String>() { ....... }); Shared enum class enum Names { JOHN, NUMAN, OBAMA }

    Read the article

  • firefox object height ignored when data

    - by John Rygielski
    I have a flash video loading in a modal window. It works in others browsers but not Firefox. Firefox opens the modal window to the correct width of the object, but with no height. I have come to learn that Firefox does not recognize <param> and instead uses the data attribute. However, when I remove this attribute, the modal opens with correct height. What is going on? Here is the code the modal window loads: <object width="720" height="520" type="application/x-shockwave-flash" data="proxymovie.SWF?file=proxymovie.MP4"> <param name="movie" value="proxymovie.SWF?file=proxymovie.MP4" /> <img src="images/poster.png" width="720" height="480" alt="" title="Download the video below" /> </object>

    Read the article

  • How can I have a web link perform an action in a specific desktop application?

    - by John
    The specific situation is I have a .zip file that I want to open with a certain application. However, I don't want all ZIP files associated with that application. I think the answer is that instead of saying, "download this zip file, and open it with application X" I could have the browser basically go well my desktop application to go fetch it on its own (the same way directives like itunes: mailto: or aim: do things like launch the itunes store, add buddies, etc). Thoughts?

    Read the article

  • Data model for timesheet to task and/or timesheet to project?

    - by John
    Let's say I want to make a simple project tracking system. A manager can create a project. Then he can create tasks for that project. Team members can record the hours they work for each task or for the project as a whole. Is the following design for the t_timesheet table a good idea? timesheet_id - primary key, autoincrement project_id - not null, foreign key constraint to t_project task_id - nullable, foreign key constraint to t_task user_id - not null, foreign key constraint to t_user hours - decimal Or should I do something like this: timesheet_id - primary key, autoincrement task_id - not null, foreign key constraint to t_task user_id - not null, foreign key constraint to t_user hours - decimal In the second option, I intend to always have a record in t_task labelled "miscellaneous items" with a foreign key to the relevant t_project record. Then I'll be able to track all hours for a project that aren't for any particular task. Are any of the ideas above good? What would be better?

    Read the article

  • Change value before sending an email in Microsoft Dynamic CRM

    - by jk
    Hi I have created one Email Template in Dynamic CRM 4. The template look like as following Dear {!User:Full Name} you received one assignment. output of the email as following Dear John Smith you received one assignment. now I need to change the value as just John. we do not have attribute like first name and last name. but when we send an email it only take first word of the string. Can anybody please tell me how can i achieve this functionality Without writing any workflow or plug ins? Thanks

    Read the article

  • Read in Contents of a Folder, onto HTML

    - by John
    I am trying to create a news ticker for a website that reads in the contents of a folder, where each file in the folder would hold a news update, and I am trying to do this without having to manually create 10 different Iframes for each individual file, and having to keep files names etc. the same. Is this possible, and if so how is it done? Thanks for the help The software I am working with is Dreamweaver CS4

    Read the article

  • StackPanel position

    - by John Espinosa
    How can I find the position of a StackPanel after it has been animated? I have a button which slides the stackpanel to the left. But if I want it to slide to the left again, the animation does not work.

    Read the article

  • How to make dynamic object?

    - by John
    I am using the XmlSerializer like this, XmlSerializer xs = new XmlSerializer(typeof(myType)); Now I have 5 different "myType". How do I pass the specific type dynamically so I don't have to repeat the same code 5 times? Thanks

    Read the article

  • Automatically number items in a wpf listbox

    - by evan
    I have a person class with two properties, Name an Age. I know how to use databinding to display a collection of person in a wpf list box and how to modify the listitemtemplate to customize how each person is displayed. Now I'd like to number each person on the list according to the order they appear on the list (which could change as the the items were sorted via name or age in the display). Is there a way to do that with the item template so instead of having a list like Rob - 14 John - 56 Suzy - 32 it would be 1) Rob - 14 2) John - 56 3) Suzy - 32 Basically i'd like to do something like: <ListView.ItemTemplate> <DataTemplate> <WrapPanel> **<TextBlock Text="{Binding CurrentPositionInList}" />** <TextBlock Text="{Binding Path=Name}" /> <TextBlock Text="{Binding Path=Age}" /> </WrapPanel> </DataTemplate> Thanks in advance!

    Read the article

  • javascript function document.location working incorrectly

    - by john
    When I change on proxy-server page from cnn.com (I add javascript, that call document.location), result of the document.location is some url of advertisement: http://ads.cnn.com/html.ng/site=cnn_international&cnn_intl_pagetype=mmst&cnn_intl_position=336x850_rgt&cnn_intl_rollup=asia&page.allowcompete=yes&params.styles=fs&tile=5656033441721&domId=894131 and not current url:http://edition.cnn.com/2010/WORLD/asiapcf/04/13/soccer.world.cup.pakistan/index.html?hpt=C1 Do you know, where can be problem?

    Read the article

  • accessing required modules from other modules

    - by john smith
    I have a bare-bone express application, exactly the one that is created with the express command. I have installed socket.io and attached it to my server, like this: var app = express(), server = http.createServer(app), io = io.listen(server); server.listen(8000); Now, I also have the routes files, which is called like this: app.get('/', routes.index); Inside this module I have the following function: exports.index = function(req, res){ socket.emit('news', { message: "foo" }); }; This obviously leads to a 500 reference error, because the routes file is an exportable module, and obviously has no idea what the socket is, as it is located in the app.js file. Is there a way I can access this socket object from this, or any other file? Please note that it is attached to the express generated app. extra: what about getting/setting session data? Thanks in advance.

    Read the article

  • Clean way to display/hide a bunch of buttons based on a ComboBox selection

    - by John at CashCommons
    I'm writing a standalone application in VB.NET using Visual Studio 2005. I want to display/hide a bunch of Buttons based on the selected value of a ComboBox. Each selection would have a different set of Buttons to display, and I'd like to have them arranged in a nice grid. Driving a TabControl with the ComboBox value would be the kind of behavior I want, but I don't want it to look like a TabControl to the user because it might be confusing. Is there a way to do this? Basically, I'd like Selection1 of the ComboBox to show Buttons 1-4, Selection2 to show Buttons 5-11, Selection3 to show (maybe) Buttons 1, 3, 5, 6, and 8, etc., have them arranged nicely, and have the GUI show only the ComboBox and the buttons. Thanks in advance as always!

    Read the article

  • Lamda expression will not compile

    - by John Soer
    I am very confused I have this lamba expression tvPatientPrecriptionsEntities.Sort((p1, p2) => p1.MedicationStartDate.Value.CompareTo(p2.MedicationStartDate.Value)); Visual studio will not compile it and complains about syntax. I converted the lamba expression to an anonymous delegate as so tvPatientPrecriptionsEntities.Sort( delegate(PatientPrecriptionsEntity p1, PatientPrecriptionsEntity p2) { return p1.MedicationStartDate.Value.CompareTo(p2.MedicationStartDate.Value); } ); and it works fine. The project is uses the .net 3.5 framework and I have a reference to system.linq.

    Read the article

  • Replicating iPhone Calendar View Lame?

    - by John Wright
    I am building an iPhone app that will need to display info primarily in a calendar view. Users will need to be able to search for entries and view them by day, month or in a list view. It seems like the built-in calendar type interface is ideal for my app. So I could build a similar calendar with 3 buttons at the bottom for list/day/month view as well as a button for today, in short a very similar interface to the built in iPhone calendar with different colors primarily. However, if I replicate it am I a) a lame copycat for replicating the built-in interface or smart for using a well-known iPhone metaphor and b) in danger of having my app rejected?

    Read the article

  • rewrite rule for codeigniter

    - by John
    this is my controller in CI class Welcome extends Controller { function Welcome() { parent::Controller(); } function index() { } function bil($model='') { } I want to do a rewrite so that http://example.com/index.php/welcome/bil/model becomes http://example.com/model in my htaccess I have RewriteBase / RewriteCond $1 !^(index\.php|images|robots\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php/welcome/$1 [L] #RewriteRule ^(.*)$ /index.php/welcome/bil/$1 [L] I thought it should be as easy as removing the /index.php/welcome/ part but when I uncomment the last line it get 500 internal server error

    Read the article

  • Suggestions for VS+Resharper keyboard shortcuts on a Mac

    - by John Miller
    I just upgraded to a Macbook Pro as my development machine but still primarily develop .Net applications with Visual Studio and Resharper (via VMWare Fusion). By far, the biggest obstacle I'm running into is getting used to the keyboard layout change (ex. not being able to do ALT-Insert). Do any of you Windows-on-Mac veterans have any suggestions on how to ease the pain of transitioning (without moving to an external keyboard)? Are you changing mappings via VMWare's keyboard preferences? Or are you using something like AutoHotkey? Any other windows development tips for a Mac newb?

    Read the article

  • Stopping Backtracking

    - by John Retallack
    Is there any way in C/C++ to stop a backtracking algorithm after finding the first solution without exiting the program. I want my function to immediately exit the function,not to quit every level of recurrsion one by one stating return.

    Read the article

  • Extract data from PostgreSQL DB without using pg_dump

    - by John Horton
    There is a PostgreSQL database on which I only have limited access (e.g, I can't use pg_dump). I am trying to create a local "mirror" by exporting certain tables from the database. I do not have the permissions needed to just dump a table as SQL from within psql. Right now, I just have a Python script that iterates through my table_names, selects all fields and then exports them as a CSV: for table_name, file_name in zip(table_names, file_names): cmd = """echo "\\\copy (select * from %s)" to stdout WITH CSV HEADER | psql -d remote_db | gzip > ./%s/%s.gz"""%(table_name,dir_name,file_name) os.system(cmd) I would like to not use CSV if possible, as I lose the field types and the encoding can get messed up. First best would probably be some way of getting the generating SQL code for the table using \copy. Next best would be XML, ideally with some way of preserving the field types. If that doesn't work, I think the final option might be two queries---one to get the field data types, the other to get the actual data. Any thoughts or advice would be greatly appreciated - thanks!

    Read the article

< Previous Page | 97 98 99 100 101 102 103 104 105 106 107 108  | Next Page >