Search Results

Search found 1495 results on 60 pages for 'student pdas'.

Page 13/60 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • Lightweight ad-blocker for firefox

    - by student
    On a old machine (512 MB RAM) I am currently running ubuntu jaunty and firefox 3.0.15. I tried the ad blocker addon add block plus but it eats lots of RAM (300 MB). Is high memory load of this add-on a bug, which is fixed in a newer version or just normal? If so, why is the memory usage so high? Is there another ad blocker add-on for firefox or another browser- add-on combination for linux (ubuntu jaunty) which uses significant less RAM?

    Read the article

  • "The usage of semaphores is subtly wrong"

    - by Hoonose
    This past semester I was taking an OS practicum in C, in which the first project involved making a threads package, then writing a multiple producer-consumer program to demonstrate the functionality. However, after getting grading feedback, I lost points for "The usage of semaphores is subtly wrong" and "The program assumes preemption (e.g. uses yield to change control)" (We started with a non-preemptive threads package then added preemption later. Note that the comment and example contradict each other. I believe it doesn't assume either, and would work in both environments). This has been bugging me for a long time - the course staff was kind of overwhelmed, so I couldn't ask them what's wrong with this over the semester. I've spent a long time thinking about this and I can't see the issues. If anyone could take a look and point out the error, or reassure me that there actually isn't a problem, I'd really appreciate it. I believe the syntax should be pretty standard in terms of the thread package functions (minithreads and semaphores), but let me know if anything is confusing. #include <stdio.h> #include <stdlib.h> #include "minithread.h" #include "synch.h" #define BUFFER_SIZE 16 #define MAXCOUNT 100 int buffer[BUFFER_SIZE]; int size, head, tail; int count = 1; int out = 0; int toadd = 0; int toremove = 0; semaphore_t empty; semaphore_t full; semaphore_t count_lock; // Semaphore to keep a lock on the // global variables for maintaining the counts /* Method to handle the working of a student * The ID of a student is the corresponding minithread_id */ int student(int total_burgers) { int n, i; semaphore_P(count_lock); while ((out+toremove) < arg) { n = genintrand(BUFFER_SIZE); n = (n <= total_burgers - (out + toremove)) ? n : total_burgers - (out + toremove); printf("Student %d wants to get %d burgers ...\n", minithread_id(), n); toremove += n; semaphore_V(count_lock); for (i=0; i<n; i++) { semaphore_P(empty); out = buffer[tail]; printf("Student %d is taking burger %d.\n", minithread_id(), out); tail = (tail + 1) % BUFFER_SIZE; size--; toremove--; semaphore_V(full); } semaphore_P(count_lock); } semaphore_V(count_lock); printf("Student %d is done.\n", minithread_id()); return 0; } /* Method to handle the working of a cook * The ID of a cook is the corresponding minithread_id */ int cook(int total_burgers) { int n, i; printf("Creating Cook %d\n",minithread_id()); semaphore_P(count_lock); while ((count+toadd) <= arg) { n = genintrand(BUFFER_SIZE); n = (n <= total_burgers - (count + toadd) + 1) ? n : total_burgers - (count + toadd) + 1; printf("Cook %d wants to put %d burgers into the burger stack ...\n", minithread_id(),n); toadd += n; semaphore_V(count_lock); for (i=0; i<n; i++) { semaphore_P(full); printf("Cook %d is putting burger %d into the burger stack.\n", minithread_id(), count); buffer[head] = count++; head = (head + 1) % BUFFER_SIZE; size++; toadd--; semaphore_V(empty); } semaphore_P(count_lock); } semaphore_V(count_lock); printf("Cook %d is done.\n", minithread_id()); return 0; } /* Method to create our multiple producers and consumers * and start their respective threads by fork */ void starter(int* c){ int i; for (i=0;i<c[2];i++){ minithread_fork(cook, c[0]); } for (i=0;i<c[1];i++){ minithread_fork(student, c[0]); } } /* The arguments are passed as command line parameters * argv[1] is the no of students * argv[2] is the no of cooks */ void main(int argc, char *argv[]) { int pass_args[3]; pass_args[0] = MAXCOUNT; pass_args[1] = atoi(argv[1]); pass_args[2] = atoi(argv[2]); size = head = tail = 0; empty = semaphore_create(); semaphore_initialize(empty, 0); full = semaphore_create(); semaphore_initialize(full, BUFFER_SIZE); count_lock = semaphore_create(); semaphore_initialize(count_lock, 1); minithread_system_initialize(starter, pass_args); }

    Read the article

  • Copy seleted row to another worksheet

    - by ???? ???????
    There are for ex. 10 rows in one worksheet. When user clicks on one row it should be presented on another worksheet. Is it possible? Any help to do it? EDIT: To clarify: In one sheet are presented for example student exam marks on first year: John 10 8 10 7 Nick 8 9 8 9 Maria 7 8 8 7 On 2nd sheet there are student informations on the second year: John 9 9 10 8 Nick 8 8 9 7 Maria 7 6 8 8 I want to have give some kind of final certificate for student so summary information should be presented on the third sheet. I doesn't need to be on click. There could be drop down list on the third sheet.

    Read the article

  • Groups issue on Ubuntu

    - by grobarTN
    Hello, I am member of couple of groups lets say Master, Student, Web. The problem is that by default whatever I do is first created under student group. I need to set it so it is created with Web group. Folder www/ where I need to write file is already mode 770. But because it picks up my student group it does not allow me to write to that folder. Is there any way to change the group that I create files under. If I execute groups it lists all groups so I am member of correct group I just cant write to the folder. Anyone?

    Read the article

  • How to backup/restore OSX Parental Controls before/after complete reimage?

    - by Jim Anderson
    We typically "nuke and pave" users Mac OSX laptops if they have software issue. Prior to doing so, we backup the primary (non-admin) user's home folder. Our standard image has four accounts: Admin (uber admin user); Parent (admin account for the parents of students); Loaner (so our standard image will also work for our loaner laptop pool); Student (this is the primary, non-admin user of the laptop) Our standard image has only minimal Parental controls on the Loaner and Student accounts. Some parents choose to tighten the parental controls. We never know when parents have made changes to parental controls, or what those changes are. Once we have reimaged the machine with our standard image (minimal parental controls) we would like to be able to restore any custom parental controls parents may have placed on their student's account. Any help in this would be appreciated. Thanks.

    Read the article

  • SCP command Clarification

    - by david.colais
    I'm using the scp commands to pull some files from the remote server and one variation of the command is not working. I have 2 files names one.xml and two.xml in a remote server and I'm pulling these two files into the current dir using the following command: scp [email protected]:/student/class/Intermediate/one.xml . scp [email protected]:/student/class/Intermediate/two.xml . The above command works fine but if I use wildcards to pull all the xml files in a single shot as shown below it returns scp: No match. scp [email protected]:/student/class/Intermediate/*.xml . Why is it working if I pull the files individually and not working if I try to pull using wildcards.

    Read the article

  • ADO.NET (WCF) Data Services Query Interceptor Hangs IIS

    - by PreMagination
    I have an ADO.NET Data Service that's supposed to provide read-only access to a somewhat complex database. Logically I have table-per-type (TPT) inheritance in my data model but the EDM doesn't implement inheritance. (Limitation of EF and navigation properties on derived types. STILL not fixed in EF4!) I can query my EDM directly (using a separate project) using a copy of the query I'm trying to run against the web service, results are returned within 10 seconds. Disabling the query interceptors I'm able to make the same query against the web service, results are returned similarly quickly. I can enable some of the query interceptors and the results are returned slowly, up to a minute or so later. Alternatively, I can enable all the query interceptors, expand less of the properties on the main object I'm querying, and results are returned in a similar period of time. (I've increased some of the timeout periods) Up til this point Sql Profiler indicates the slow-down is the database. (That's a post for a different day) But when I enable all my query interceptors and expand all the properties I'd like to have the IIS worker process pegs the CPU for 20 minutes and a query is never even made against the database. This implies to me that yes, my implementation probably sucks but regardless the Data Services "tier" is having an issue it shouldn't. WCF tracing didn't reveal anything interesting to my untrained eye. Details: Data model: Agent-Person-Student Student has a collection of referrals Students and referrals are private, queries against the web service should only return "your" students and referrals. This means Person and Agent need to be filtered too. Other entities (Agent-Organization-School) can be accessed by anyone who has authenticated. The existing security model is poorly suited to perform this type of filtering for this type of data access, the query interceptors are complicated and cause EF to generate some entertaining sql queries. Sample Interceptor [QueryInterceptor("Agents")] public Expression<Func<Agent, Boolean>> OnQueryAgents() { //Agent is a Person(1), Educator(2), Student(3), or Other Person(13); allow if scope permissions exist return ag => (ag.AgentType.AgentTypeId == 1 || ag.AgentType.AgentTypeId == 2 || ag.AgentType.AgentTypeId == 3 || ag.AgentType.AgentTypeId == 13) && ag.Person.OrganizationPersons.Count<OrganizationPerson>(op => op.Organization.ScopePermissions.Any<ScopePermission> (p => p.ApplicationRoleAccount.Account.UserName == HttpContext.Current.User.Identity.Name && p.ApplicationRoleAccount.Application.ApplicationId == 124) || op.Organization.HierarchyDescendents.Any<OrganizationsHierarchy>(oh => oh.AncestorOrganization.ScopePermissions.Any<ScopePermission> (p => p.ApplicationRoleAccount.Account.UserName == HttpContext.Current.User.Identity.Name && p.ApplicationRoleAccount.Application.ApplicationId == 124))) > 0; } The query interceptors for Person, Student, Referral are all very similar, ie they traverse multiple same/similar tables to look for ScopePermissions as above. Sample Query var referrals = (from r in service.Referrals .Expand("Organization/ParentOrganization") .Expand("Educator/Person/Agent") .Expand("Student/Person/Agent") .Expand("Student") .Expand("Grade") .Expand("ProblemBehavior") .Expand("Location") .Expand("Motivation") .Expand("AdminDecision") .Expand("OthersInvolved") where r.DateCreated >= coupledays && r.DateDeleted == null select r); Any suggestions or tips would be greatly associated, for fixing my current implementation or in developing a new one, with the caveat that the database can't be changed and that ultimately I need to expose a large portion of the database via a web service that limits data access to the data authorized for, for the purpose of data integration with multiple outside parties. THANK YOU!!!

    Read the article

  • Dropdown dependent values to be fetch from multiple models using ajax in Yii

    - by newuser
    I searched all the documentation over Yii but not got the answer of it.So I came here finally. I have the following schema Table Schools +------------------+--------------+------+-----+---------------------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------------+--------------+------+-----+---------------------+----------------+ | id | int(10) | NO | PRI | NULL | auto_increment | | school_name | varchar(100) | NO | | | | +------------------+--------------+------+-----+---------------------+----------------+ Table Students +------------------+--------------+------+-----+---------------------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------------+--------------+------+-----+---------------------+----------------+ | id | int(10) | NO | PRI | NULL | auto_increment | | school_id | int(10) | NO | FK | | | | student_name | varchar(100) | NO | | | | | roll_no | varchar(80) | NO | | | | | class | varchar(20) | NO | | | | | | subjects | varchar(100) | NO | | | | +------------------+--------------+------+-----+---------------------+----------------+ I have made models and CRUD for the both models.In models my relation is like this In Students.php the relation is like public function relations() { // NOTE: you may need to adjust the relation name and the related // class name for the relations automatically generated below. return array( 'School' => array(self::BELONGS_TO,'Schools','school_id'), ); } In Schools.php the relation is like public function relations() { // NOTE: you may need to adjust the relation name and the related // class name for the relations automatically generated below. return array( 'student' => array(self::HAS_MANY, 'Students', 'school_id'), ); } Now I made the two models rendered in a single page so that I can enter all the respective fields in a single form. In the _form.php file of Students I have made some change in student_name like this <div class="row"> <?php echo $form->labelEx($model,'student_name'); ?> <?php echo $form->dropdownList($model,'student_name', CHtml::listData(Students::model()->findAll(), 'id', 'student_name'), array('empty'=>array('Select'=>'--Select One---'))); ?> <?php echo $form->error($model,'student_name'); ?> Now for this piece of code I got all the student name from the Student model. So my problem is when I am getting the student name from the dropdown list and going to select a student it will also fetch all the respective values of the student to be rendered in the _form.php without click on save button.So that user don't have to put it again manually. I think ajax and json encode will work here but don't know how to make them work here. [Update] Here is StudentsController code public function actionDisCoor() { $model = School::model()->findByPk($_POST['Students']['student_id']); $data=CHtml::listData($data,'id','name'); foreach($data as $value=>$name) { echo CHtml::tag('option',array('value'=>$value),CHtml::encode($name),true); } } Here is _form.php code for Students <div class="row"> <?php echo $form->labelEx($model,'student_name'); ?> <?php $List = CHtml::listData(Students::model()->findAll(), 'id', 'student_name'); ?> <?php echo $form->dropdownList($model,'student_name',$List, array('onChange'=>CHtml::ajax(array( 'url' => CController::createUrl('DisCoor'), 'type' => 'POST', 'update'=>'#school_id', )),'style'=>'width:180px;' ) )?> <?php echo $form->error($model,'student_name'); ?> </div> After all that when I saw in firebug I got the error.Here is the screen shot

    Read the article

  • Future direction for a developer who is expert in latest software technologies…

    - by Muaz Khan
    Hi everyone, If a (new-coming) developer that learns latest technologies as well as can develop amazing stuff with those technologies and did Bachelors in Arts (BA). So what ’ll be the future of this kind of developer? I meant did he can get good job without degree? I think (but it is the universal truth that) no one (org or company) permit these kind of developers to join them because degree is must for job!! I’m worried about why the world depends upon degree? Why degree is necessary for good job? If a developer has a good experience, why he cannot be able to get good job without degree? What is the future of developer that starts his life as a freelancer and learns everything himself with the help of online available resources? Why companies prerequisite the degree for a good job? A developer without degree can be expert than that who have a degree of MSC etc. Because in 3rd world countries especially Pakistan, a BSC level student taught VB6 and the MSC level student learns C/C++. The common student doesn’t know about latest innovative technologies and he think that the world is depending upon VB6 or C/C++. What is the comparison of that students with a developer that do Bachelors in Arts but know (and can do well with) latest technologies.

    Read the article

  • What should I recommend a small company looking for C# developers

    - by Coder
    Here is the issue. I am a senior developer, and one of the start-ups I designed the system (management system/database/web) a long time ago, have grown and need software updates. I have left their system to another developer long time ago, but apparently he has left the job, and so they are asking me if I can suggest them where to find a new one. The problem is that the company has no clue that the IT is not cheap. They expect multiple features to be added for 40$, so that's an issue. Actually one of the reasons why I left the project when I did. Lots of expectations, little pay, also I know those people outside work, so I decided to avoided stressing the nonwork-relationships and left the project gracefully. Today they asked me for an advice, and I told them that the feature list they want is probably going to cost some if they'll get a senior developer for the job. So I guess their best bet is to find someone who loves coding and has just finished the school. Which would give someone a chance to code for money which is good for a student, and at the same time, allow the student to get some hands on experience. Then again, the system is not exactly 20 line console program, there is an MSSQL database, ASP.NET web page and content management system with all the AJAX stuff and some other things. So student straight out of school could have some problems with that. But, I thought about the issue some more, and I think that junior developer is a tricky deal, without mentoring, he can either screw up royally, or just do what's asked. Also, it seems no one is coming to interviews at all, which is weird, or maybe not. What should I suggest them?

    Read the article

  • How should I structure a site with content dependent on visitor type (not user)?

    - by Pedr
    I have a website that displays different content depending on two selections made by a visitor: Whether they are a teacher or student, and their learning level (from 4 options). Everything is public and they don't need to authenticate to access the content. Depending on their selection, different content is displayed across the whole site, other than a contact and about page. The tone of the language changes depending on whether the visitor is a student or teacher and the materials available on each page also change depending on the learning level, however in all cases, the structure of the site is identical. Currently I'm using a cookie to store the visitor's selections and render different content appropriately, so I have a single set of URLs which display different content depending on the cookie, with one of the permutations as default. I appreciate this is far from ideal, but what is the better option? Would I be better using a distinguishing segment for each selection, for example: http://example.com/teacher/lv3/resources/activities http://example.com/teacher/lv4/resources/activities http://example.com/student/lv4/resources/activities etc. What is the most sensible way to handle this situation?

    Read the article

  • Storing simulation results in a persistent manner for Python?

    - by Az
    Background: I'm running multiple simuations on a set of data. For each session, I'm allocating projects to students. The difference between each session is that I'm randomising the order of the students such that all the students get a shot at being assigned a project they want. I was writing out some of the allocations in a spreadsheet (i.e. Excel) and it basically looked like this (tiny snapshot, actual table extends to a few thousand sessions, roughly 100 students). | | Session 1 | Session 2 | Session 3 | |----------|-----------|-----------|-----------| |Stu1 |Proj_AA |Proj_AB |Proj_AB | |----------|-----------|-----------|-----------| |Stu2 |Proj_AB |Proj_AA |Proj_AC | |----------|-----------|-----------|-----------| |Stu3 |Proj_AC |Proj_AC |Proj_AA | |----------|-----------|-----------|-----------| Now, the code that deals with the allocation currently stores a session in an object. The next time the allocation is run, the object is over-written. Thus what I'd really like to do is to store all the allocation results. This is important since I later need to derive from the data, information such as: which project Stu1 got assigned to the most or perhaps how popular Proj_AC was (how many times it was assigned / number of sessions). Question(s): What methods can I possibly use to basically store such session information persistently? Basically, each session output needs to add itself to the repository after ending and before beginning the next allocation cycle. One solution that was suggested by a friend was mapping these results to a relational database using SQLAlchemy. I kind of like the idea since this does give me an opportunity to delve into databases. Now the database structure I was recommended was: |----------|-----------|-----------| |Session |Student |Project | |----------|-----------|-----------| |1 |Stu1 |Proj_AA | |----------|-----------|-----------| |1 |Stu2 |Proj_AB | |----------|-----------|-----------| |1 |Stu3 |Proj_AC | |----------|-----------|-----------| |2 |Stu1 |Proj_AB | |----------|-----------|-----------| |2 |Stu2 |Proj_AA | |----------|-----------|-----------| |2 |Stu3 |Proj_AC | |----------|-----------|-----------| |3 |Stu1 |Proj_AB | |----------|-----------|-----------| |3 |Stu2 |Proj_AC | |----------|-----------|-----------| |3 |Stu3 |Proj_AA | |----------|-----------|-----------| Here, it was suggested that I make the Session and Student columns a composite key. That way I can access a specific record for a particular student for a particular session. Or I can merely get the entire allocation run for a particular session. Questions: Is the idea a good one? How does one implement and query a composite key using SQLAlchemy? What happens to the database if a particular student is not assigned a project (happens if all projects that he wants are taken)? In the code, if a student is not assigned a project, instead of a proj_id he simply gets None for that field/object. I apologise for asking multiple questions but since these are closely-related, I thought I'd ask them in the same space.

    Read the article

  • Changing backgroundcolor in listview (expandable listview)

    - by Stofke
    I'm trying to dynamically change a backgroundcolor in a part of a listview, I have on example that works fine in a listview when I try to replicate it in another part with an expandable listview it fails This piece of code works and displays a different color if a student is online or not ... map.put(KEY_FIRSTNAME, temp.firstName); map.put(KEY_NAME, temp.name); map.put(KEY_EMAIL, temp.email); map.put(KEY_ISONLINE, temp.isOnLine); // change image if student is online or not Log.d("demo", "is on line= " + temp.isOnLine); if (temp.isOnLine.equalsIgnoreCase("1")) { map.put(KEY_IMAGE_ISONLINE, R.color.greenColor); } else { map.put(KEY_IMAGE_ISONLINE, R.color.greyColor); } listItem.add(map); } myListView = (ListView) findViewById(R.id.listViewTabLeerlingen); SimpleAdapter adapter = new SimpleAdapter(StudentTab.this, listItem, R.layout.list_item_student, new String[] { KEY_FIRSTNAME, KEY_NAME, KEY_IMAGE_ISONLINE }, new int[] { R.id.firstNameTextView, R.id.lastNameTextView, R.id.logo }); myListView.setAdapter(adapter); the xml that goes along with it <ImageView android:id="@+id/logo" android:layout_width="85dp" android:layout_height="match_parent" android:background="@color/greenColor" android:contentDescription="Image if student is online or not" android:src="@drawable/transparent_pixel" /> The above works fine however the following code (just part of the code) ... ArrayList<Map<String, Object>> children = new ArrayList<Map<String, Object>>(); for (int i = 0; i < _data.length(); i++) { try { JSONArray tmp = _data.getJSONArray(i); HashMap<String, Object> map = new HashMap<String, Object>(); // change image if student is online or not if (tmp.getString(3).equalsIgnoreCase("0")) { map.put(KEY_POINTS,R.color.redColor); }else{ map.put(KEY_POINTS,R.color.greenColor); } map.put(KEY_QUESTIONTEXT, tmp.getString(1)); map.put(KEY_ANSWER, tmp.getString(2)); children.add(map); } catch (JSONException e) { e.printStackTrace(); } childData.add(children); ... ... ArrayList<ArrayList<Map<String, Object>>> childData) { SimpleExpandableListAdapter listAdapter = new SimpleExpandableListAdapter( this, groupData, R.layout.list_item_results_students, new String[] { KEY_FIRSTNAME, KEY_NAME, KEY_ISJUIST }, new int[] { R.id.firstnameResults, R.id.nameResults, R.id.resultsTextView }, childData, R.layout.list_item_results_results, new String[] { KEY_QUESTIONTEXT, KEY_ANSWER, KEY_POINTS }, new int[] { R.id.questionTextView, R.id.answerTextTextView, R.id.score }); ExpandableListView myListView = (ExpandableListView) findViewById(R.id.listViewTabResultaten); myListView.setAdapter(listAdapter); with xml: <ImageView android:id="@+id/score" android:layout_width="16dp" android:layout_height="match_parent" android:background="@color/greenColor" android:contentDescription="Image if student has correct answer" android:src="@drawable/transparent_pixel" /> I will get this error: 06-09 10:35:21.490: E/AndroidRuntime(4406): java.lang.ClassCastException: android.widget.ImageView cannot be cast to android.widget.TextView

    Read the article

  • one to many jpa relationship

    - by user309944
    Hai I have created two table first table as student package com.crimson.rship; import javax.persistence.Basic; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.Id; import javax.persistence.OneToMany; @Entity(name="student") public class student { @Id private String stumailid; @Basic private String fathername; @Basic private String mothername; @Basic private String doa; @Basic private String dob; public student(String stumailid,String fathername,String mothername,String doa,String dob) { // TODO Auto-generated constructor stub this.stumailid=stumailid; this.fathername=fathername; this.mothername=mothername; this.doa=doa; this.dob=dob; } public void setStumailid(String stumailid) { this.stumailid = stumailid; } public String getStumailid() { return stumailid; } public void setFathername(String fathername) { this.fathername = fathername; } public String getFathername() { return fathername; } public void setMothername(String mothername) { this.mothername = mothername; } public String getMothername() { return mothername; } public void setDoa(String doa) { this.doa = doa; } public String getDoa() { return doa; } public void setDob(String dob) { this.dob = dob; } public String getDob() { return dob; } } Second table as mark package com.crimson.rship; import java.util.Collection; import javax.persistence.Basic; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.JoinTable; import javax.persistence.OneToMany; @Entity(name="mark") public class mark { @Id private String stumailid; @Basic private String fathername; @Basic private String mothername; @OneToMany(mappedBy="mark",targetEntity=student.class,fetch=FetchType.EAGER) private Collection orders; public mark(String stumailid,String fathername,String mothername) { // TODO Auto-generated constructor stub this.stumailid=stumailid; this.fathername=fathername; this.mothername=mothername; } public void setStumailid(String stumailid) { this.stumailid = stumailid; } public String getStumailid() { return stumailid; } public void setFathername(String fathername) { this.fathername = fathername; } public String getFathername() { return fathername; } public void setMothername(String mothername) { this.mothername = mothername; } public String getMothername() { return mothername; } public void setOrders(Collection orders) { this.orders = orders; } public Collection getOrders() { return orders; } } But this above coding working is not working correctly.can any one help me Thanks in advance

    Read the article

  • How to navigate to another html page?

    - by newbie
    In my application there's a usual login page sending username and password to the server script, where it needs to be authenticated, and in case of an authentic user, the server should redirect to a page student.html. This is my code var ports = 3000; var portt = 3001; var express = require('express'); var student = require('express')(); var teacher = require('express')(); var server_s = require('http').createServer(student); var server_t = require('http').createServer(teacher); var ios = require('socket.io').listen(server_s); var iot = require('socket.io').listen(server_t); var path = require('path'); server_s.listen(ports); server_t.listen(portt); student.use(express.static(path.join(__dirname, 'public'))); student.get('/', function(req,res){ res.sendfile(__dirname + '/login.html'); }); teacher.use(express.static(path.join(__dirname, 'public'))); teacher.get('/', function(req,res){ res.sendfile(__dirname + '/mytry.html'); }); ios.sockets.on('connection', function(socket){ var username, password; socket.on('check',function(data){ username = data[0]; password = data[1]; //************* Database connection and query ************* var mysql = require('mysql'); var connection = mysql.createConnection({ host : 'localhost', user : 'user', password: '*******', database: 'my_db' }); connection.connect(); var qstring = 'SELECT s_id FROM login_student WHERE username='+username+'AND password='+password; connection.query(qstring, function(err, rows, fields) { if (err) { console.log('ERROR: ' + err); socket.emit('login_failure','DB error'); return; } console.log('The solution is: ', rows[0].solution); if (rows>0) //***** Here i want redirection to another page ****** else socket.emit('login_failure','Invalid Username or password'); }); connection.end(); }); }); iot.sockets.on('connection', function(socket){ ; }); }); Can anyone suggest what should I do?

    Read the article

  • 256 Worker Role 3D Rendering Demo is now a Lab on my Azure Course

    - by Alan Smith
    Ever since I came up with the crazy idea of creating an Azure application that would spin up 256 worker roles (please vote if you like it ) to render a 3D animation created using the Kinect depth camera I have been trying to think of something useful to do with it. I have also been busy working on developing training materials for a Windows Azure course that I will be delivering through a training partner in Stockholm, and for customers wanting to learn Windows Azure. I hit on the idea of combining the render demo and a course lab and creating a lab where the students would create and deploy their own mini render farms, which would participate in a single render job, consisting of 2,000 frames. The architecture of the solution is shown below. As students would be creating and deploying their own applications, I thought it would be fun to introduce some competitiveness into the lab. In the 256 worker role demo I capture the rendering statistics for each role, so it was fairly simple to include the students name in these statistics. This allowed the process monitor application to capture the number of frames each student had rendered and display a high-score table. When I demoed the application I deployed one instance that started rendering a frame every few minutes, and the challenge for the students was to deploy and scale their applications, and then overtake my single role instance by the end of the lab time. I had the process monitor running on the projector during the lab so the class could see the progress of their deployments, and how they were performing against my implementation and their classmates. When I tested the lab for the first time in Oslo last week it was a great success, the students were keen to be the first to build and deploy their solution and then watch the frames appear. As the students mostly had MSDN suspicions they were able to scale to the full 20 worker role instances and before long we had over 100 worker roles working on the animation. There were, however, a few issues who the couple of issues caused by the competitive nature of the lab. The first student to scale the application to 20 instances would render the most frames and win; there was no way for others to catch up. Also, as they were competing against each other, there was no incentive to help others on the course get their application up and running. I have now re-written the lab to divide the student into teams that will compete to render the most frames. This means that if one developer on the team can deploy and scale quickly, the other team still has a chance to catch up. It also means that if a student finishes quickly and puts their team in the lead they will have an incentive to help the other developers on their team get up and running. As I was using “Sharks with Lasers” for a lot of my demos, and reserved the sharkswithfreakinlasers namespaces for some of the Azure services (well somebody had to do it), the students came up with some creative alternatives, like “Camels with Cannons” and “Honey Badgers with Homing Missiles”. That gave me the idea for the teams having to choose a creative name involving animals and weapons. The team rendering architecture diagram is shown below.   Render Challenge Rules In order to ensure fair play a number of rules are imposed on the lab. ·         The class will be divided into teams, each team choses a name. ·         The team name must consist of a ferocious animal combined with a hazardous weapon. ·         Teams can allocate as many worker roles as they can muster to the render job. ·         Frame processing statistics and rendered frames will be vigilantly monitored; any cheating, tampering, and other foul play will result in penalties. The screenshot below shows an example of the team render farm in action, Badgers with Bombs have taken a lead over Camels with Cannons, and both are  leaving the Sharks with Lasers standing. If you are interested in attending a scheduled delivery of my Windows Azure or Windows Azure Service bus courses, or would like on-site training, more details are here.

    Read the article

  • Display image from database with p:graphicImage

    - by minhltnt
    I'm trying to display image type byte which saved in database to return StreamedContent to the p:graphicImage, as follows: private StreamedContent content; // getter and setter public StreamedContent getImageF() { if (student.getImage() != null) { InputStream is = new ByteArrayInputStream(student.getImage()); System.out.println("Byte :"+student.getImage()); content = new DefaultStreamedContent(is, "", student.getStuID()); System.out.println("ddd ------------------------------- " + content); return content; } return content; } This return blank image. Can Someone explain why? <p:graphicImage value="#{item.imageF}" width="50" id="grpImage" height="80"/> When i try to print the ouput : INFO: Byte :[B@a2fb48 INFO: ddd ------------------------------- org.primefaces.model.DefaultStreamedContent@b0887b INFO: Byte :[B@a2fb48 INFO: ddd ------------------------------- org.primefaces.model.DefaultStreamedContent@1d06a92 INFO: Byte :[B@d52f0b INFO: ddd ------------------------------- org.primefaces.model.DefaultStreamedContent@39a60 INFO: Byte :[B@d52f0b INFO: ddd ------------------------------- org.primefaces.model.DefaultStreamedContent@8c3daa INFO: Byte :[B@124728a INFO: ddd ------------------------------- org.primefaces.model.DefaultStreamedContent@1dbe05b INFO: Byte :[B@124728a INFO: ddd ------------------------------- org.primefaces.model.DefaultStreamedContent@66a266 INFO: Byte :[B@a2fb48 INFO: ddd ------------------------------- org.primefaces.model.DefaultStreamedContent@1293976 INFO: Byte :[B@a2fb48 INFO: ddd ------------------------------- org.primefaces.model.DefaultStreamedContent@17b7399 INFO: Byte :[B@d52f0b INFO: ddd ------------------------------- org.primefaces.model.DefaultStreamedContent@1e245a5 INFO: Byte :[B@d52f0b INFO: ddd ------------------------------- org.primefaces.model.DefaultStreamedContent@4a7153 INFO: Byte :[B@124728a INFO: ddd ------------------------------- org.primefaces.model.DefaultStreamedContent@1561bfd INFO: Byte :[B@124728a INFO: ddd ------------------------------- org.primefaces.model.DefaultStreamedContent@47a8c2<br/> I don't know the reason why p:grpalicImage return blank.Help me,please

    Read the article

  • C++ CIN cin skips randomly

    - by user69514
    I have this program, but cin in randomly skips.. I mean sometimes it does, and sometimes it doesn't. Any ideas how to fix this? int main(){ /** get course name, number of students, and assignment name **/ string course_name; int numb_students; string assignment_name; Assignment* assignment; cout << "Enter the name of the course" << endl; cin >> course_name; cout << "Enter the number of students" << endl; cin >> numb_students; cout << "Enter the name of the assignment" << endl; cin >> assignment_name; assignment = new Assignment(assignment_name); /** iterate asking for student name and score **/ int i = 0; string student_name; double student_score = 0.0; while( i < numb_students ){ cout << "Enter the name for student #" << i << endl; cin >> student_name; cout << "Enter the score for student #" << i << endl; cin >> student_score; assignment->addScore( Student( student_name, student_score )); i++; } }

    Read the article

  • How does this code break the Law of Demeter?

    - by Dave Jarvis
    The following code breaks the Law of Demeter: public class Student extends Person { private Grades grades; public Student() { } /** Must never return null; throw an appropriately named exception, instead. */ private synchronized Grades getGrades() throws GradesException { if( this.grades == null ) { this.grades = createGrades(); } return this.grades; } /** Create a new instance of grades for this student. */ protected Grades createGrades() throws GradesException { // Reads the grades from the database, if needed. // return new Grades(); } /** Answers if this student was graded by a teacher with the given name. */ public boolean isTeacher( int year, String name ) throws GradesException, TeacherException { // The method only knows about Teacher instances. // return getTeacher( year ).nameEquals( name ); } private Grades getGradesForYear( int year ) throws GradesException { // The method only knows about Grades instances. // return getGrades().getForYear( year ); } private Teacher getTeacher( int year ) throws GradesException, TeacherException { // This method knows about Grades and Teacher instances. A mistake? // return getGradesForYear( year ).getTeacher(); } } public class Teacher extends Person { public Teacher() { } /** * This method will take into consideration first name, * last name, middle initial, case sensitivity, and * eventually it could answer true to wild cards and * regular expressions. */ public boolean nameEquals( String name ) { return getName().equalsIgnoreCase( name ); } /** Never returns null. */ private synchronized String getName() { if( this.name == null ) { this.name == ""; } return this.name; } } Questions How is the LoD broken? Where is the code breaking the LoD? How should the code be written to uphold the LoD?

    Read the article

  • UPDATE query that fixes orphaned records

    - by Jed
    I have an Access database that has two tables that are related by PK/FK. Unfortunately, the database tables have allowed for duplicate/redundant records and has made the database a bit screwy. I am trying to figure out a SQL statement that will fix the problem. To better explain the problem and goal, I have created example tables to use as reference: You'll notice there are two tables, a Student table and a TestScore table where StudentID is the PK/FK. The Student table contains duplicate records for students John, Sally, Tommy, and Suzy. In other words the John's with StudentID's 1 and 5 are the same person, Sally 2 and 6 are the same person, and so on. The TestScore table relates test scores with a student. Ignoring how/why the Student table allowed duplicates, etc - The goal I'm trying to accomplish is to update the TestScore table so that it replaces the StudentID's that have been disabled with the corresponding enabled StudentID. So, all StudentID's = 1 (John) will be updated to 5; all StudentID's = 2 (Sally) will be updated to 6, and so on. Here's the resultant TestScore table that I'm shooting for (Notice there is no longer any reference to the disabled StudentID's 1-4): Can you think of a query (compatible with MS Access's JET Engine) that can accomplish this goal? Or, maybe, you can offer some tips/perspectives that will point me in the right direction. Thanks.

    Read the article

  • A question about entities, roles and interfaces in Entity Framework 4.

    - by mvole
    Hi, I am an experienced .NET developer but new to EF - so please bear with me. I will use an example of a college application to illustrate my problem. I have these user roles: Lecturer, Student, Administrator. In my code I envisage working with these entities as distinct classes so e.g. a Lecturer teaches a collection of Students. And work with 'is Student' 'TypeOf' etc. Each of these entities share lots of common properties/methods e.g. they can all log onto the system and do stuff related to their role. In EF designer I can create a base entity Person (or User...) and have Lecturer, Student and Administrator all inherit from that. The difficulty I have is that a Lecturer can be an Administrator - and in fact on occasion a Student can be a Lecturer. If I were to add other entities such as Employee and Warden then this gets even more of an issue. I could presumably work with Interfaces so a person could implement ILecturer and IStudent, however I do not see how this fits within EF. I would like to work within the EF designer if possible and I'm working model-first (coding in C#). So any help and advice/samples would be very welcome and much appreciated. Thanks

    Read the article

  • create controls at run-time in .net

    - by ahmed naguib
    i add a course then search in students grid view and select multiple students after i choose students say they are 50 student user enter the number of students in each group say =10 mean that i will have 5 groups each group contain 10 student when user click button a five container appear whatever these container are ul or listboxes user can move one student from one group to another group cause every group start course at specific date notice : number of students user determine it and number of students in each group also user determine container i didnot decide ul as i will write or text boxes but how to transfer student from one listbox to another <ul group1> <li>student1</li> <li>student2</li> <li>student3</li> <li>student4</li> <li>student5</li> </ul> <ul group1> <li>student1</li> <li>student2</li> <li>student3</li> <li>student4</li> <li>student5</li> </ul>

    Read the article

  • Help with SQL query (Calculate a ratio between two entitiess)

    - by Mestika
    Hi, I’m going to calculate a ratio between two entities but are having some trouble with the query. The principal is the same to, say a forum, where you say: A user gets points for every new thread. Then, calculate the ratio of points for the number of threads. Example: User A has 300 points. User A has started 6 thread. The point ratio is: 50:6 My schemas look as following: student(studentid, name, class, major) course(courseid, coursename, department) courseoffering(courseid, semester, year, instructor) faculty(name, office, salary) gradereport(studentid, courseid, semester, year, grade) The relations is a following: Faculity(name) = courseoffering(instructor) Student(studentid) = gradereport (studentid) Courseoffering(courseid) = course(courseid) Gradereport(courseid) = courseoffering(courseid) I have this query to select the faculty names there is teaching one or more students: SELECT COUNT(faculty.name) FROM faculty, courseoffering, gradereport, student WHERE faculty.name = courseoffering.instructor AND courseoffering.courseid = gradereport.courseid AND gradereport.studentid = student.studentid My problem is to find the ratio between the faculty members salary in regarding to the number of students they are teaching. Say, a teacher get 10.000 in salary and teaches 5 students, then his ratio should be 1:5. I hope that someone has an answer to my problem and understand what I'm having trouble with. Thanks Mestika

    Read the article

  • C# xml read, show error

    - by gloris
    Whats wrong with my code? XmlTextReader textReader = new XmlTextReader(@"D:\xml_file.xml"); textReader.Read(); // If the node has value while (textReader.Read()) { // Move to fist element textReader.MoveToElement(); Console.WriteLine("XmlTextReader Properties Test"); Console.WriteLine("==================="); // Read this element's properties and display them on console Console.WriteLine("id:" + textReader.id.ToString()); Console.WriteLine("name:" + textReader.name.ToString()); Console.WriteLine("time:" + textReader.time.ToString()); } Console.ReadLine() show erron on: id, name, time My XML file: <students> <student> <id>1</id> <name>Rikko Nora</name> <time>2010-03-12</time> </student> <student> <id>2</id> <name>Rikko Nora2</name> <time>2010-05-15</time> </student> </students>

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >