Vote count: 0 I want to create a caretaker. This is my model: class Caretaker(models.Model): user = models.OneToOneField(User) language = models.ForeignKey('Translation', blank=True, null=True, on_delete=models.SET_NULL, verbose_name=_('language')) patients = models.ManyToManyField('Patient', through='CaretakerPatient') specialists = models.ManyToManyField('Caretaker', through='CaretakerSpecialist') name = models.CharField(_('name'), max_length=50) email = models.CharField(_('e-mail'), max_length=100) time_zone = models.CharField(_('time zone'), max_length=50) is_primary = models.BooleanField(default=False) active = models.BooleanField(default=True) As you see there is a relation oneTOone wi...
ادامه مطلبVote count: 0 I have read all the tutorial about AJAX in this site but I still can't figure this out. I need to get the userid variable from a PHP page. Here is what I am doing: code HERE is what I am getting Result How can I only get the variable and not the whole page? thanks, asked 1 min agouser3352263 Let's block ads! بخوانید...
ادامه مطلبVote count: 0 pic of the problem I have a problem. I'm making a simple unet game for 2 players. They should face each other and the host should be on the left and the client on the right. Round Robin only works with the host discoects and re-run. But first thing first, inside the tank's script in OnStartLocalPlayer() I make the check if the player was spawned in the left side or the right (simple transform.position.x is greater than a value or not). The host flip both to the wrong direction and the client sees the right direction but the tanks shoot from their behinds (as the host sees this). The player prefab is a red tank facing right (blue is colored also in OnStartLocalPlayer() to make o...
ادامه مطلبVote count: 0 How to create sub menu in ionic framework? I am new to both AngularJs and ionic framework. I am trying to create a drop down list component. I was able to do that with the below code. Dashboard Accounts sub Accounts 1 sub Accounts 2 asked 2 mins agosridharan Let's block ads! بخوانید...
ادامه مطلبVote count: 0 On my login page, there is a script that gets called when the user clicks Log In, if they have to change their password upon logging in. This script calls window.showModalDialog or window.open depending on the browser. It directs to a page "popup_main.aspx" which redirects the window to the actual page they're trying to access, which is passed as an argument to the url, so the url looks something like this: pStrUrl = '/popup_main.aspx?Destination = ' + someValue; In this case, someValue is ChangePW.aspx. On that page, once they change their password I need to close this popup and redirect the main browser window to a certain page. I've tried a handful of different methods: open...
ادامه مطلبVote count: 0 I have the problem, that my Aotation is still a pin! I want the Button and the picture, for the information displayed about the User and it works. But it doesn't change the look of the pin on the Map! This is my aotationView: func mapView(mapView: MKMapView, viewForAotation aotation: MKAotation) -> MKAotationView? { // 1 let identifier = "pinAotation" // 2 if aotation.isKindOfClass(pinAotation.self) { // 3 var aotationView = mapView.dequeueReusableAotationViewWithIdentifier(identifier) if aotationView == nil { //4 aotationView = MKPinAotationView(aotation: aotation, reuseIdentifier: identifier) aotationView!.canShowCallout = true // 5 let btn = UIButton(type: .InfoDark) aotatio...
ادامه مطلبVote count: 0 template class Student When I declare int main() { Student stud1; } it tells me this error [Error] missing template arguments before 'stud1' What is the proper form to do it then? Thanks a lot in advance :D asked 1 min agoblackstreet23 Let's block ads! بخوانید...
ادامه مطلبVote count: 0 What I want to do:I am trying to implement the Travelling Salesman Problem using a weighted directed graph. That means that I will need to visit different vertices, but I can't figure out how to get the vertices using JGraphT. I want to do something like: getVertex(Chicago); for (edges coected to chicagoVertex) pick the one with the smallest weight Problem/What I've tried:But I can't figure out how to do the getVertex(x) part. JGraphT has a getEdge(), but there's not a getVertex() method. I read here about picking a random vertex with vertexSet(), but I don't understand how it works. It is just creating a vertex and storing it in an object array, but if I use that, that means e...
ادامه مطلبVote count: 0 I tried reading and inserting the document function in this code but I have no idea what im doing. Can someone tell where I should put the document initialization and why? this would be of great help. thanks. Here's a fiddle of what the jquery is for $('.quantity, .drink').change(calculateTotal); function calculateTotal() { var $form = $(this).closest('form'), total = 0; $form.find('.drink:checked').each(function() { total += $(this).data('price') * parseInt($(this).next('.quantity').val() || 0, 10); }); $('#totalDiv').text(total); } asked 37 secs agoKevinG Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I know, TL;DR - please bear with me. This Javascript function is supposed to take in two strings inputted by the user (useame, password), guess both fields correctly using the random function to generate random character guesses (out 92 characters) that are stored in a "guess array," and also tell how many times (trials) it took to guess both your useame and password in the same instance by comparing the values of two sets of two arrays: the guess array for the useame vs the user inputted array for the useame, and the guess array for the password vs the user inputted array for the password. The main line of code I'm having trouble with: while (userNameArray != userNameGuessArra...
ادامه مطلبVote count: 0 I have two tables, one for the guards and one for the cities. Linked by the cityID. I want to allow update the name of the city, located in the cities table. I did "DropDownList" inside "DetailsView" to enable select the cities on the list, end update the "SelectCommand" and "UpdateCommand" with "left jion for the two tables. The city name is not Updating.. what should I do? Thank you...
ادامه مطلبVote count: 0 How do you enable shading in Three.js? Various examples have shown it should be as simple as assigning THREE.FlatShading to your material, but when I do this, my shape has no shading at all. My JS: CANVAS_WIDTH = 200, CANVAS_HEIGHT = 200; var camera, scene, renderer; var mesh; init(); animate(); function init() { camera = new THREE.PerspectiveCamera( 70, CANVAS_WIDTH / CANVAS_HEIGHT, 1, 1000 ); camera.position.z = 400; scene = new THREE.Scene(); var geometry = new THREE.BoxBufferGeometry( 200, 200, 200 ); var material = new THREE.MeshBasicMaterial( {color: 0xff0000} ); material.shading = THREE.FlatShading; for(var i=0; i...
ادامه مطلبVote count: 0 MainActivity launches FullActivity (which has no status bar). When the user presses the back button from the FullActivity, FullActivity is dismissed and MainActivity will be shown again. The problem is that when the MainActivity gets shown again, it seems as if the MainActivity is transitioning from fullscreen to normal screen. The whole UI moves down by the height of the status bar. This looks aoying. I never meant the MainActivity to be fullscreen. Why is this happening, and how can I prevent this? In short, I want the MainActivity stay normal and never go fullscreen. I tried adding the following code to the MainActivity's onCreate, according to an answer to a similar questio...
ادامه مطلبVote count: 0 How do I manually delete an instance of a class? Please note that this is not a complex question about scope, how objects are managed on the stack, new'd and destructed on the heap, or managed with smart pointers. I just want to dissolve the instance and re-instantiate it. Example: #include #include class Cheese { private: string brand; float cost; public: Cheese(); // Default constructor Cheese(string brand, float cost); // Parametrized constructor Cheese(const Cheese & rhs); // Copy construtor ~Cheese(); // Destructor // etc... other useful stuff follows } int main() { Cheese cheddar("Cabot Clothbound", 8.99); Cheese swiss("Jarlsberg", 4.99); eradicate swiss; // fairly certai...
ادامه مطلبVote count: 0 I tried installing code ception in windows with composer following this http://codeception.com/install#.VvLvLuJ96M9 but when I run command php vendor/bin/codecept I get following in cmd : >#!/usr/bin/env sh > >dir=$(d=${0%[/\]*}; cd "$d"; cd "../codeception/codeception" && pwd) > ># See if we are ruing in Cygwin by checking for cygpath program >if command -v 'cygpath' >/dev/null 2>&1; then > # Cygwin paths start with /cygdrive/ which will break windows PHP, > # so we need to translate the dir path to windows format. However > # we could be using cygwin PHP which does not require this, so we > # test if the path to PHP starts with /cygdrive/ rather than /usr/bin > if [[ $(which ...
ادامه مطلبVote count: 0 I want to use jQuery to manipulate a cloned element that is not on the DOM, to perform actions like .remove() on it. Say I have the following code: var div= $(' '); div.remove('#div1'); console.log(div.html()); The result on the console will still show that the element was not removed. string manipulation is not desirable, I'm looking for something analogue to $().remove() asked 1 min agoRicardo 1 Answer Vote count: 0 Using the context argument of the jQuery() function: $('div', div).remove('#div1'); answered 1 min agoRicardo Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I'm generating a chart in my code, and displaying it on the screen, and it looks fine: a nice curve with X and Y axis labels. But when I go to save it as an image, the labels and title are blacked out. Here's the xaml for the chart... And the save image method: private void buttonSaveImage_Click(object sender, RoutedEventArgs e) { int width = (int)ML100SampleGrid.ActualWidth; int height = (int)ML100SampleGrid.ActualHeight; double printScale = 96; // pixels per inch // RenderTargetBitmap/Render renders the GUI element in the context of the parent control. // The area of the parent control that is not the desired element is masked in black pixels. // We render the chart inside th...
ادامه مطلبVote count: 0 Access to the path 'C:WebSite1' is denied while downloaing and after uploading file/image file name is showing up in gridview in asp.net using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.Odbc; using System.Data; using System.Configuration; using System.IO; public partial class Default2 : System.Web.UI.Page { OdbcCoection co= new OdbcCoection(ConfigurationManager...
ادامه مطلبVote count: 0 I would like to extract urban end-members from a Minimum Noise Fraction(MNF) Image of my study area. But i am not sure how pixel purity index(PPI) image is converted to the four fundamental end-members (Vegetation, High Albedo, Low Albedo and Soil). I have a 3 band MNF image, and derived the PPI but have no idea how to extract four classes of pure pixels. asked 1 min agoKaleab Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I am building a website and being new to the Angular JS, I am unable to find out the way to redirect to the login page in case user is not logged in and after login to the referrer. I am using ui-router for routing. asked 1 min agoPuneet Aggarwal Let's block ads! بخوانید...
ادامه مطلب