Daily Archives

Articles indexed Tuesday May 27 2014

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

  • Fixed timestep and interpolation question

    - by Eric
    I'm following Glenn Fiedlers excellent Fix Your Timestep! tutorial to step my 2D game. The problem I'm facing is in the interpolation phase in the end. My game has a Tween-function which lets me tween properties of my game entites. Properties such as scale, shear, position, color, rotation etc. Im curious of how I'd interpolate these values, since there's a lot of them. My first thought is to keep a previous value of every property (colorPrev, scalePrev etc.), and interpolate between those. Is this the correct method? To interpolate my characters I use their velocity; renderPostion = position + (velocity * interpolation), but I cannot apply that to color for example. So what is the desired method to interpolate various properties or a entity? Is there any rule of thumb to use?

    Read the article

  • JXTreeTable and BorderHighlighter Drawing Border on All Rows

    - by Kevin Rubin
    I'm using a BorderHighlighter on my JXTreeTable to put a border above each of the table cells on non-leaf rows to give a more clear visual separator for users. The problem is that when I expand the hierarchical column, all cells in the hierarchical column, for all rows, include the Border from the Highlighter. The other columns are displaying just fine. My BorderHighlighter is defined like this: Highlighter topHighlighter = new BorderHighlighter(new HighlightPredicate() { @Override public boolean isHighlighted(Component component, ComponentAdapter adapter) { TreePath path = treeTable.getPathForRow(adapter.row); TreeTableModel model = treeTable.getTreeTableModel(); Boolean isParent = !model.isLeaf(path.getLastPathComponent()); return isParent; } }, BorderFactory.createMatteBorder(2, 0, 0, 0, Color.RED)); I'm using SwingX 1.6.5.

    Read the article

  • R - Subsetting XTS via Time and Which

    - by user2844947
    Currently, I have a XTS, called Data, which contains a Date, and two value columns which are numbers. I would like to get a single number as output and which would be the mean of Value1 in the time period from a point where Value2 < mean(Value2) and going forward 14 data points, weeks in this particular data set. In order to get the dates where Value2 < mean(Value2), I wrote the below code Data[which(Data$Value2 < mean(Data$Value2)),"Date"] However, I am not sure how to get the mean of Value1 in the period, going 14 days forward from each of the resultant dates from the above code.

    Read the article

  • How can I configure apigee to fail stale if the backend is unavialble?

    - by Anurag Kapur
    We have an API proxy configured with cache ttl of 2mins. Is it possible to configure apigee to serve stale cached content if the backend goes down so that our end users don't see errors? We would rather have our end users get copies of stale cached content (even after the configured ttl of 2mins expires) instead of errors when the backend goes down. Would appreciate if someone could point me to the relevant documentation if this is possible.

    Read the article

  • Differentiate generic methods by type parameters only using reflection?

    - by Brian Vallelunga
    I'm trying to use reflection to get a specific MethodInfo of a class, but am unsure how to differentiate between the two following methods: public class Test { public IBar<T1> Foo<T1>(); public IBar<T1, T2> Foo<T1, T2>(); } How can I get a reference to the different Foo methods, assuming I know the number of type parameters? Just calling typeof(Test).GetMethod("Foo") will throw an exception that the method name is ambiguous and there aren't a differing number of parameters to check.

    Read the article

  • Unable to add CRM 2011's Organization service as Service Reference to VS project

    - by Scorpion
    I have problem accessing Organization Service when I try to add it as a Service Reference in Visual Studio. However, I can Access the Service in browser. I have tried to add OrganizationData service and there is no issue with that. An Error occurred while attempting to find service at 'http://xxxxxxxx/xxxxx/XRMServices/2011/Organization.svc'. Error Details There was an error downloading 'http://xxxxxxxx/xxxxx/XRMServices/2011/Organization.svc/_vti_bin/ListData.svc/$metadata'. The request failed with HTTP status 400: Bad Request. Metadata contains a reference that cannot be resolved: 'http://xxxxxxxx/xxxxx/XRMServices/2011/Organization.svc'. Metadata contains a reference that cannot be resolved: 'http://xxxxxxxx/xxxxx/XRMServices/2011/Organization.svc'. If the service is defined in the current solution, try building the solution and adding the service reference again.

    Read the article

  • UIDocumentInteractionController & ARC: [UIPopoverController dealloc] reached while popover is still visible

    - by muffel
    This issue or similar issues have been discussed here before, but I didn't find any working solution for me. I am using the following code to display a UIDocumentInteractionController on an ARC-enabled iOS 7 project: - (void) exportDoc{ // [...] docController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:path]]; docController.delegate = self; [docController presentOpenInMenuFromBarButtonItem:mainMenuButton animated:YES]; } First I didn't want to create a property that holds the controller reference, but as many people said that there are not alternatives to it. It is defined as @property (strong) UIDocumentInteractionController* docController; exportDoc is run in the main thread using NSOperationQueue. Whenever it is executed, I get the following error message: Terminating app due to uncaught exception 'NSGenericException', reason: '-[UIPopoverController dealloc] reached while popover is still visible.' This is what the backtrace says: (lldb) bt * thread #1: tid = 0x1c97d9, 0x000000019a23c1c0 libobjc.A.dylibobjc_exception_throw, queue = 'com.apple.main-thread', stop reason = breakpoint 2.1 frame #0: 0x000000019a23c1c0 libobjc.A.dylibobjc_exception_throw frame #1: 0x000000018d982e90 CoreFoundation+[NSException raise:format:] + 128 frame #2: 0x0000000190bc348c UIKit-[UIPopoverController dealloc] + 96 frame #3: 0x0000000190e18fc8 UIKit-[UIDocumentInteractionController dealloc] + 168 frame #4: 0x000000019a255474 libobjc.A.dylib(anonymous namespace)::AutoreleasePoolPage::pop(void*) + 524 frame #5: 0x000000018d881988 CoreFoundation_CFAutoreleasePoolPop + 28 frame #6: 0x000000018e42cb18 Foundation-[NSOperationInternal _start:] + 892 frame #7: 0x000000018e4eea38 Foundation__NSOQSchedule_f + 76 frame #8: 0x000000019a813fd4 libdispatch.dylib_dispatch_client_callout + 16 frame #9: 0x000000019a8171dc libdispatch.dylib_dispatch_main_queue_callback_4CF + 336 frame #10: 0x000000018d942c2c CoreFoundation__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 12 frame #11: 0x000000018d940f6c CoreFoundation__CFRunLoopRun + 1452 frame #12: 0x000000018d881c20 CoreFoundationCFRunLoopRunSpecific + 452 frame #13: 0x0000000193511c0c GraphicsServicesGSEventRunModal + 168 frame #14: 0x00000001909b2fdc UIKitUIApplicationMain + 1156 * frame #15: 0x000000010000947c MyApplicationmain(argc=1, argv=0x000000016fdfbc80) + 108 at main.m:16 frame #16: 0x000000019a82faa0 libdyld.dylibstart + 4 As far as I understand the autoreleasepool just releases the controller. Shouldn't this be prevented by using a strong property just as I did? Do you have any idea what the problem can be and how I can solve it?

    Read the article

  • Codeigniter php activerecord orm limit and offset

    - by user2167174
    I am a bit stuck with this problem I have in phpactiverecord. What I am trying to do is a pagination so I need to limit and offset the query results. I am accessing all of the user posts like so: $user-post; How can I query this to limit and offset the results? Thanx in advance. Code: public function office() { if (!$this->session->userdata('username')) { redirect(base_url()); } $data = array(); $data['posts'] = []; $user = User::find('first', array('id' => $this->session->userdata('id'))); if ($user != null) { if ($user->post != null) { foreach ($user->post as $post) { $posts = array($post->name, $post->description, $post->date,'<a href="'.base_url().'Posts/edit/'.$post->id.'">Edit</a> <br /><a href="'.base_url().'Posts/delete/'.$post->id.'">Delete</a>'); array_push($data['posts'], $posts); } $this->table->set_heading('Name', 'Description', 'Date', '<a href="'.base_url().'Posts/create">+Add</a>'); $tmpl = array('table_open' => '<table class="table table-stripped table-bordered user-posts">'); $this->table->set_template($tmpl); $data['table'] = $this->table->generate($data['posts']); } $this->load->view('template/header.php'); $this->load->view('Users/office.php', $data); $this->load->view('template/footer.php'); } else { redirect(base_url()); } }

    Read the article

  • issue occur while implementing tabs in css

    - by user3592205
    i was implementing tabbed feature using radio button hack,here is the tutorial from where i was learning. http://tympanus.net/codrops/2012/04/12/animated-content-tabs-with-css3/ and this is the final output http://tympanus.net/Tutorials/CSS3ContentTabs/ while implementing i am stuck at this, i suppose this issue occurs because content's opacity is set to 0 when radio button is checked or clearfix issue. here is what i got so far http://jsfiddle.net/parasrochiya/F8zva/ please help me out ..I hope you'll understand what i'm trying to implement. thanks in advance for your help.

    Read the article

  • -[__NSCFArray objectForKeyedSubscript:] error?

    - by jckly
    I'm trying to get the data from a JSON response object in my iOS app after I log in. I keep getting this error though. Error: 'NSInvalidArgumentException', reason: '-[__NSCFArray objectForKeyedSubscript:]: unrecognized selector sent to instance 0x8fc29b0' Here is my code for the request, I'm using AFNetworking: self.operation = [manager GET:urlString parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) { NSDictionary *JSON = (NSDictionary *)responseObject; NSDictionary *user = JSON[@"user"]; NSString *token = user[@"auth_token"]; NSString *userID = user[@"id"]; // NSString *avatarURL = user[@"avatar_url"]; // weakSelf.credentialStore.avatarURL = avatarURL; weakSelf.credentialStore.authToken = token; weakSelf.credentialStore.userId = userID; weakSelf.credentialStore.username = self.usernameField.text; weakSelf.credentialStore.password = self.passwordField.text; [SVProgressHUD dismiss]; [self dismissViewControllerAnimated:YES completion:nil]; } failure:^(AFHTTPRequestOperation *operation, NSError *error) { if (operation.isCancelled) { return; } [SVProgressHUD showErrorWithStatus:@"Login Failed"]; NSLog(@"%@", error); }]; What the JSON response object looks like logged: <__NSCFArray 0x8cac0b0>( { user = { "auth_token" = b3a18e0fb278739649a23f0ae325fee1e29fe5d6; email = "[email protected]"; id = 1; username = jack; }; } ) I'm converting the array to a Dictionary using pointers like this: NSDictionary *JSON = (NSDictionary *)responseObject; I'm new to iOS, apologies if problem is obvious. Thanks for any help.

    Read the article

  • jquery issue if checked change bg color

    - by user3058067
    Hello i made a script that is supposed to change background when radio is selected. It works but when another radio is selected the previous still remains with the selected color. It works for checkboxes but not for radio. <script type="text/javascript"> $(".table").change(function(){ var c = this.checked ? "#18b9e7" : "#b6bf34"; $(this).parent().css("background-color", c); }); </script> Here is a jsfiddle

    Read the article

  • MySQL: Count occurrences of known (or enumerated) distinct values

    - by Eilidh
    After looking at how to count the occurrences of distinct values in a field, I am wondering how to count the occurrences of each distinct value if the distinct values are known (or enumerated). For example, if I have a simple table - TrafficLight Colour ------------ ------ 1 Red 2 Amber 3 Red 4 Red 5 Green 6 Green where one column (in this case Colour) has known (or enumerated) distinct values, how could I return the count for each colour as a separate value, rather than as an array, as in the linked example. To return an array with a count of each colour (using the same method as in the linked example), the query would be something like SELECT Colour COUNT(*) AS ColourCount FROM TrafficLights GROUP BY Colour, and return an array - Colour ColourCount ------ ----------- Red 3 Amber 1 Green 2 What I would like to do is to return the count for each Colour AS a separate total (e.g. RedCount). How can I do this?

    Read the article

  • My javascript doesn't work on IE. What should I change?

    - by klm
    I'm making simple site for my school project. My code doesn't work on my teacher's PC (he has IE 6 or 7 - I don't remember). I use it to change content on site (kind of menu). html: <ul> <li onclick="run(1)"> ... </li> <li onclick="run(2)"> ... </li> <li onclick="run(3)"> ... </li> <li onclick="run(4)"> .... </li> <li onclick="run(5)"> .... </li> <li onclick="run(6)"> .... </li> </ul> Script: function run(x) { ///New Content: var a = ... var e = "<a href='xxxx'> aaaaaa</a>" //example ///////////////////// var p = document.getElementById("content"); if(x === 1) { p.innerHTML=a; } else if(x === 2) { p.innerHTML=b; } else if(x === 3) { p.innerHTML=c; } else if(x === 4) { p.innerHTML=d; } else if(x === 5) { p.innerHTML=e; } else { p.innerHTML=f; } };

    Read the article

  • Get more error information from unhandled error

    - by Andrew Simpson
    I am using C# in a desktop application. I am calling a DLL written in C that I do not have the source code for. Whenever I call this DLL I get an untrapped error which I trap in an UnhandledException event/delegate. The error is : object reference not set to an instance of an object But the stack trace is empty. When I Googled this the info back was that the error was being hanlded eleswhere and then rethrown. But this can only be in the DLL I do not have the source code for. So, is there anyway I can get more info about this error? This is my code... in program.cs... AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { try { Exception _ex = (Exception)e.ExceptionObject; //the stact trace property is empty here.. } finally { Application.Exit(); } } My DLL... [DllImport("AutoSearchDevice.dll", EntryPoint = "Start", ExactSpelling = false, CallingConvention = CallingConvention.StdCall)] public static extern int Start(int ASD_HANDLE); An I call it like so: public static void AutoSearchStart() { try { Start(m_pASD); } catch (Exception ex) { } }

    Read the article

  • MySQL query works in PHPMyAdmin but not PHP

    - by Su4p
    I do not understand what's happening. I have a query in PHP who crashes -with a strange error-. When I copy/paste the exact same request in PHPMyAdmin it works as expected. What am I doing wrong here ? SELECT oms_patient.id, oms_patient.date, oms_patient.date_modif, date_modif, AES_DECRYPT(nom,"xxxxx") AS "Nom", AES_DECRYPT(prenom,"xxxxx") AS "Prénom usuel", DATE_FORMAT(ddn, "%d/%m/%Y") AS "Date de naissance", villeNaissance AS "Lieu de naissance (ville)", CONCAT(oms_departement.libelle,"(",id_departement,")") AS "Lieu de vie", CONCAT(oms_pays.libelle,"(",id_pays,")") AS "Pays", CONCAT(patientsexe.libelle,"(",id_sexe,")") AS "Sexe", CONCAT(patientprofession.libelle,"(",id_profession,")") AS "Profession", IF(asthme>0,"Oui","Non") AS "Asthme", IF(rhinite>0,"Oui","Non") AS "Rhinite", IF(bcpo>0,"Oui","Non") AS "BPCO", IF(insuffisanceResp>0,"Oui","Non") AS "Insuffisance respiratoire chronique", IF(chirurgieOrl>0,"Oui","Non") AS "Chirurgie ORL du ronflement", IF(autreChirurgie>0,"Oui","Non") AS "Autre chirurgie ORL", IF(allergies>0,"Oui","Non") AS "Allergies", IF(OLD>0,"Oui","Non") AS "OLD", IF(hypertensionArterielle>0,"Oui","Non") AS "Hypertension artérielle", IF(infarctusMyocarde>0,"Oui","Non") AS "Infarctus du myocarde", IF(insuffisanceCoronaire>0,"Oui","Non") AS "Insuffisance coronaire", IF(troubleRythme>0,"Oui","Non") AS "Trouble du rythme", IF(accidentVasculaireCerebral>0,"Oui","Non") AS "Accident vasculaire cérébral", IF(insuffisanceCardiaque>0,"Oui","Non") AS "Insuffisance cardiaque", IF(arteriopathie>0,"Oui","Non") AS "Artériopathie", IF(tabagismeActuel>0,"Oui","Non") AS "Tabagisme actuel", CONCAT(nbPaquetsActuel," ","PA") AS "", IF(tabagismeAncien>0,"Oui","Non") AS "Tabagisme ancien", CONCAT(nbPaquetsAncien," ","PA") AS "", IF(alcool>0,"Oui","Non") AS "Alcool (conso régulière)", IF(refluxGastro>0,"Oui","Non") AS "Reflux gastro-oesophagien", IF(glaucome>0,"Oui","Non") AS "Glaucome", IF(diabete>0,"Oui","Non") AS "Diabète", CONCAT(patienttypeDiabete.libelle,"(",id_typeDiabete,")") AS "", IF(hypercholesterolemie>0,"Oui","Non") AS "Hypercholestérolémie", IF(hypertriglyceridemie>0,"Oui","Non") AS "Hypertriglycéridémie", IF(dysthyroidie>0,"Oui","Non") AS "Dysthyroïdie", IF(depression>0,"Oui","Non") AS "Dépression", IF(sedentarite>0,"Oui","Non") AS "Sédentarité", IF(syndromeDApneesSommeil>0,"Oui","Non") AS "SAS", IF(obesite>0,"Oui","Non") AS "Obésité", IF(dysmorphieFaciale>0,"Oui","Non") AS "Dysmorphie faciale", TextObservations AS "", id_user FROM oms_patient LEFT JOIN oms_departement ON oms_departement.id = id_departement LEFT JOIN oms_pays ON oms_pays.id = id_pays LEFT JOIN patientsexe ON patientsexe.id = id_sexe LEFT JOIN patientprofession ON patientprofession.id = id_profession LEFT JOIN patienttypeDiabete ON patienttypeDiabete.id = id_typeDiabete WHERE oms_patient.id=1 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'small"(conso régulière)", IF(refluxGastro0,"Oui","Non") as "Reflux ga' at line 1 "near 'small" <-- where is small o_O The PHP code isn't really relevant cause you won't see a lot. $db = mysql_connect(); mysql_select_db();//TODO SWITCH TO PDO mysql_query("SET NAMES UTF8"); $fields = $form->getFields($form); $settingsForm = $form->getSettings(); $sql = 'SELECT oms_patient.id,oms_patient.date,oms_patient.date_modif,'; foreach ($fields as $field) { if (!$field->isMultiSelect()) { $field->select_full(&$sql, 'oms_patient', null); } } if (isset($settingsForm['linkTo'])) { $idLinkTo = 'id_' . str_replace('oms_', '', $settingsForm['linkTo']); $sql .= $idLinkTo; } $sql.=' FROM oms_patient'; foreach ($fields as $field) { if (!$field->isMultiSelect() && $field->getTable('oms_patient')) { $sql .=' LEFT JOIN ' . $field->getTable('oms_patient') . ' ON ' . $field->getTable('oms_patient') . '.id = '.$field->getFieldName().' '; } } $sql.=' where oms_patient.id=' . $this->m_settings['e']; $result = mysql_query($sql) or die('Erreur SQL !<br>' . $sql . '<br>' . mysql_error()); $data = mysql_fetch_assoc($result); var_dump of $sql string(2663) "SELECT oms_patient.id,oms_patient.date,oms_patient.date_modif,date_modif,AES_DECRYPT(nom,"xxxxx") as "Nom",AES_DECRYPT("prenom","xxxxx") as "Prénom usuel",DATE_FORMAT(ddn, "%d/%m/%Y") as "Date de naissance",villeNaissance as "Lieu de naissance (ville)",CONCAT(oms_departement.libelle,"(",id_departement,")") as "Lieu de vie",CONCAT(oms_pays.libelle,"(",id_pays,")") as "Pays",CONCAT(patientsexe.libelle,"(",id_sexe,")") as "Sexe",CONCAT(patientprofession.libelle,"(",id_profession,")") as "Profession", IF"... can't go further to see what is in the output after the "..." <-- if you have an idea

    Read the article

  • Paging Recordsets from SQL Serverside

    - by Jonno
    I've been banging my head off this one for a while. I want to call 1k records from a SQL database and page them per 100. In classic ASP (where I'm moving from) this was dead easy to do with ADODB but with VB using ADO.net I can't find a single way that doesn't involve stored procs (which I want to avoid for now). It seems really stupid to call all 1k and sort it programmatically. Edit: It's SQL Server 2005 / .net 4.0 / Visual Studio 2010. Edit 2: Just to reiterate, I have Googled extensively and don't want to use stored procedures. There are many ways to get paged data but everything I see involves paging the data in the program rather than from the server.

    Read the article

  • How to perform bulk update using rails admin

    - by Shubham Kedia
    ![enter image description here][2] I just have to perform a Bulk update for my products using the action which i have defined. While inspecting the link, it displays the following: onclick="jQuery('#bulk_action').val('bulk_add_to_categories'); jQuery('#bulk_form').submit(); return false;" But when I click on it I get this error. I need to do something like this I need to have an separate UI for all the products that have came from that bulk action, and then put them into the selected categories, but I am not able to do that. Can anyone help me on this? Any help would be great. I have seen lot of tutorial and read the rails admin github page but I was not able to find anything helpful. Please guide me.

    Read the article

  • Disable/Enable applicationbar Button in runtime with event textchanged (Windows Phone)

    - by user3621634
    In this part of the code is the event TextChanged to enable the button in te applicationbar Code in C# private void Textbox_TextChanged(object sender, EventArgs e) { ApplicationBarIconButton btn_guardar = ApplicationBar.Buttons[0] as applicationBarIconButton; if (!string.IsNullOrEmpty(txt_nom_usuario.Text) && !string.IsNullOrEmpty(txt_edad_usuario.Text) && !string.IsNullOrEmpty(txt_peso_usuario.Text)) { btn_guardar.IsEnabled = true; } else btn_guardar.IsEnabled = false; } Code XAML <phone:PhoneApplicationPage.ApplicationBar> <shell:ApplicationBar Mode="Default" IsVisible="True"> <shell:ApplicationBarIconButton x:Name="btn_guardar" IconUri="/icons/appbar.save.rest.png" Text="Guardar" Click="btn_guardar_Click" IsEnabled="False" /> <shell:ApplicationBarIconButton x:Name="btn_atras" IconUri="/icons/appbar.back.rest.png" Text="Atrás" Click="btn_atras_Click" /> </shell:ApplicationBar> </phone:PhoneApplicationPage.ApplicationBar> <TextBlock x:Name="lbl_ingresanombre" Height="39" Margin="60,28,0,0" TextWrapping="Wrap" HorizontalAlignment="Left" VerticalAlignment="Top" Width="248" FontSize="29.333" FontFamily="{StaticResource Helvetica}"><Run Text="Ingresa "/><Run Text="tu nombre"/></TextBlock> <TextBox x:Name="txt_nom_usuario" Height="63" Margin="47,58,69,0" TextWrapping="Wrap" Text="&#xa;" FontSize="21.333" VerticalAlignment="Top" IsEnabled="True" /> <TextBlock x:Name="lbl_edad" Height="38" Margin="60,117,0,0" TextWrapping="Wrap" Text="Ingresa tu edad" VerticalAlignment="Top" FontSize="29.333" HorizontalAlignment="Left" FontFamily="{StaticResource Helvetica}"/> <TextBox x:Name="txt_edad_usuario" InputScope="TelephoneLocalNumber" Height="63" TextWrapping="Wrap" Text="&#xa;" FontSize="21.333" Margin="47,147,69,0" VerticalAlignment="Top" MaxLength="3" />

    Read the article

  • Inscribe and center an image within a frame

    - by Brennan Roberts
    Given a div of arbitrary aspect ratio, what's the best way to place and style an image (also with an arbitrary aspect ratio) inside such that: It is both inscribed and centered Its dimensions and position are set using relative values so that the image will remain inscribed and centered automatically when the frame is uniformly scaled (javascript should only be required when the image is initially inserted, or if the frame's aspect ratio changes) Extra markup is minimized Here's the result we want: Here's a fiddle template, which is just: Markup Should pillarbox <div class="frame"> <img src="http://www.placekitten.com/200/300" /> </div> Should letterbox <div class="frame"> <img src="http://www.placekitten.com/300/200" /> </div> CSS .frame { width: 200px; height: 200px; border: 2px solid black; margin: 10px 0px 100px 0; }

    Read the article

  • Fragment not showing up and breaks other buttons on Layout

    - by Devin Crane
    I'm learning how to use Fragments, and trying to add a fragment tag_button.xml at runtime to a FrameLayout tagFragmentContainer deep within another layout, deepLayout.xml. I get no errors, but the fragment doesn't show up. When I make its container visible, I can see a small sliver of layout between the other elements already existing, but then it disappears after onCreateView(), and all the remaining buttons are broken, which is even more confusing to me. tag_button.xml is just a regular layout file with some text and a button. tagFragmentContainer, within a LinearLayout in the middle of a large layout file, deepLayout.xml: <LinearLayout android:id="@+id/tagButtonsLayout" android:layout_marginBottom="10dip" android:visibility="gone" style="@style/Form"> <FrameLayout android:id="@+id/tagFragmentContainer" android:layout_marginBottom="10dip" style="@style/Form"> </FrameLayout> </LinearLayout> In deepLayoutActivity, I make visible tagButtonsLayout and start TagButtonActivity: final LinearLayout anotherlm = (LinearLayout) findViewById(R.id.tagButtonsLayout); anotherlm.setVisibility(View.VISIBLE); Intent i = new Intent (this, TagButtonActivity.class); startActivity(i); TagButtonActivity is as follows: public class TagButtonActivity extends FragmentActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.action_expense); if (savedInstanceState != null) return; TagButtonFragment firstFragment = new TagButtonFragment(); getSupportFragmentManager().beginTransaction().add(R.id.tagFragmentContainer, firstFragment, "tagOne").commit(); } } TagButtonFragment: public class TagButtonFragment extends Fragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment return inflater.inflate(R.layout.tag_button, container, false); } } tag_button.xml: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" style="@style/Form"> <TextView android:id="@+id/tag_button_header" style="@style/FieldHeader" android:text="example text"/> <RelativeLayout android:id="@+id/tag_button_block" android:layout_width="match_parent" android:layout_marginLeft="2dip" android:layout_marginTop="3dip" android:layout_marginBottom="3dip" android:layout_marginRight="2dip" android:layout_height="43dip" android:clickable="true" android:background="@drawable/row_spinner_selector"> <ImageView android:id="@+id/question_arrow" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dip" android:layout_marginRight="10dip" android:layout_alignParentRight="true" android:layout_centerVertical="true" android:src="@drawable/arrow_right"/> <TextView android:id="@+id/tag_question_text" android:layout_toLeftOf="@id/question_arrow" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="10dip" android:layout_centerVertical="true" android:textColor="@android:color/black" android:singleLine="true" android:ellipsize="end" android:textSize="15sp" android:text="@string/not_selected"/> </RelativeLayout> </LinearLayout> I would certainly appreciate any help in figuring this out from someone who knows fragments better than me! Thanks!

    Read the article

  • missing event when using modules with requirejs

    - by ali haider
    I had javascript code in a single JS file that was working fine (using XHR/AJAX). When I split it up into separate modules in a requirejs application, I do not seem to get a handle on the event object & it shows up as undefined (testing in firefox 29.0.1). Calling module: ajax.onreadystatechange = new ajaxResponse().handleAjaxResponse(e); ajaxResponse define(["require", './url/urlCommon'], function(require, urlCommon) { 'use strict'; var ajaxResponse = function() { var ajax = null; // e = event || window.event; this.handleAjaxResponse = function() { if (typeof event === 'undefined') { var event = event || window.event; } console.log('e is now:' + typeof e); I also do not have a handle on the event in the handleAjaxResponse method (error: undefined). Any thoughts on what I need to do to troubleshoot/fix this will be greatly appreciated.

    Read the article

  • Need AngularJS grid resizing directive to resize "thumbnail" that contains no image

    - by thebravedave
    UPDATE Plunker to project: http://plnkr.co/edit/oKB96szQhqwpKQbOGUDw?p=preview I have an AngularJS project that uses AngularJS Bootstrap grids. I need all of the grid elements to have the same size so they stack properly. I created an angularJs directive that auto resizes the grid element when placed in said grid element. I have 2 directives that do this for me Directive 1: onload Directive 2: imageonload Directive 2 works. If the grid element uses an image, after the image loads then the directive triggers an event that sends the grid elements height to all other grid elements. If that height sent out via the event is greater than that of the grid element which is listening to the event then that listening grid element changes it's height to be the greater height. This way the largest height becomes the height for all the grid elements. Directive 1 does not work. This one is placed on the outer most grid elements html element, and is triggered when the element loads. The problem is that when the element loads and the onload directive is called AngularJS has not yet filled out the data in said grid element. The outcome is that the real height after AngularJS data binds is not broadcast as an event. My only solution I have thought of (but haven't tried) is to add an image url to an image that exists but doesn't have any data in it, and place that in the grid element (the one that didn't have any images before placing the blank one in). I could then call imageonload instead of onload and I pretty sure the angularjs data binding will have taken place by then. the problem is that that is pretty hacky. I would rather be able to have not an image in the grid element, and be able to call my custom onload directive and have the onload directive calculate the height AFTER angularJS data binds to all of the data binding variables in the grid element. Here is my imageonload directive .directive('imageonload', function($rootScope) { return { restrict: 'A', link: function(scope, element, attrs) { scope.heightArray = []; scope.largestHeight = 50; element.bind('load', function() { broadcastThumbnailHeight(); }); scope.$on('imageOnLoadEvent', function(caller, value){ var el = angular.element(element); var id = el.prop('id'); var pageName = el.prop('title'); if(pageName == value[0]){ if(scope.largestHeight < value[1]){ scope.largestHeight = value[1]; var nestedString = el.prop('alt'); if(nestedString == "") nestedString = "1"; var nested = parseInt(nestedString); nested = nested - 1; var inte = 0; var thumbnail = el["0"]; var finalThumbnailContainer = thumbnail.parentElement; while(inte != nested){ finalThumbnailContainer = finalThumbnailContainer.parentElement; inte++; } var innerEl = angular.element(finalThumbnailContainer); var height = value[1]; innerEl.height(height); } } }); scope.$on('findHeightAndBroadcast', function(){ broadcastThumbnailHeight(); }); scope.$on('resetThumbnailHeight', function(){ scope.largestHeight = 50; }); function broadcastThumbnailHeight(){ var el = angular.element(element); var id = el.prop('id'); var alt = el.prop('alt'); if(alt == "") alt = "1"; var nested = parseInt(alt); nested = nested - 1; var pageName = el.prop('title'); var inte = 1; var thumbnail = el["0"]; var finalThumbnail = thumbnail.parentElement; while(inte != nested){ finalThumbnail = finalThumbnail.parentElement; inte++; } var elZero = el["0"]; var clientHeight = finalThumbnail.clientHeight; var arr = []; arr[0] = pageName; arr[1] = clientHeight; $rootScope.$broadcast('imageOnLoadEvent', arr); } } }; }) And here is my onload directive .directive('onload', function($rootScope) { return { restrict: 'A', link: function(scope, element, attrs) { scope.largestHeight=100; getHeightAndBroadcast(); scope.$on('onLoadEvent', function(caller, value){ var el = angular.element(element); var id = el.prop('id'); var pageName = el.prop('title'); if(pageName == value[0]){ if(scope.largestHeight < value[1]){ scope.largestHeight = value[1]; var height = value[1]; el.height(height); } } }); function getHeightAndBroadcast(){ var el = angular.element(element); var h = el["0"].children; var thumbnailHeightElement = angular.element(h); var pageName = el.prop("title"); var clientHeight = thumbnailHeightElement["0"].clientHeight; var arr = []; arr[0] = pageName; arr[1] = clientHeight; if(clientHeight != undefined) $rootScope.$broadcast('onLoadEvent', arr); } } }; }) Here is an example of one of my grid elements that uses imageonload. Note the imageonload directive in the image html element. This works. There is also an onload directive on the outer most html of the grid element. That does not work. I have stepped through this carefully in Firebug and saw that the onload was calculating the height before AngularJS data binding was complete. <div class="thumbnail col-md-3" id="{{product.id}}" title="thumbnailAdminProductsGrid" onload> <div class="row"> <div class="containerz"> <div class="row-fluid"> <div class="col-md-2"></div> <div class="col-md-7"> <div class="textcenterinline"> <!--tag--><img class="img-responsive" id="{{product.id}}" title="imageAdminProductsGrid" alt=6 ng-src="{{product.baseImage}}" imageonload/><!--end tag--> </div> </div> </div> <div class="caption"> <div class="testing"> <div class="row-fluid"> <div class="col-md-12"> <h3 class=""> <!--tag--><a href="javascript:void(0);" ng-click="loadProductView('{{product.id}}')">{{product.name}}</a><!--end tag--> </h3> </div> </div> <div class="row-fluid"> <div class="col-md-12"> <p class="lead"><!--tag--> {{product.price}}</p><!--end tag--> </div> </div> <div class="row-fluid"> <div class="col-md-12"> <p><!--tag-->{{product.inStock}} units available<!--end tag--></p> </div> </div> <div class="row-fluid"> <div class="col-md-12"> <p class=""><!--tag-->{{product.generalDescription}}<!--end tag--></p> </div> </div> <!--tag--> <div data-ng-if="product.specialized=='true'"> <div class="row-fluid"> <div class="col-md-12" ng-repeat="varCat in product.varietyCategoriesAndOptions"> <b><h4>{{varCat.varietyCategoryName}}</h4></b> <select ng-model="varCat.varietyCategoryOption" ng-options="value.varietyCategoryOptionId as value.varietyCategoryOptionValue for (key,value) in varCat.varietyCategoryOptions"> </select> </div> </div> </div> <!--end tag--> <div class="row-fluid"> <div class="col-md-12"> <!--tag--><div ng-if="product.weight==0"><b>Free Shipping</b></div><!--end tag--> </div> </div> </div> </div> </div> </div> Here is an example of one of the html for one of my grid elements that only uses the "onload" directive and not "imageonload" <div class="thumbnail col-md-3" title="thumbnailCouponGrid" onload> <div class="innnerContainer"> <div class="text-center"> {{coupon.name}} <br /> <br /> <b>Description</b> <br /> {{coupon.description}} <br /> <br /> <button class="btn btn-large btn-primary" ng-click="goToCoupon()">View Coupon Details</button> </div> </div> The imageonload function might look a little confusing because I use the img html attribute "alt" to signal to the directive how many levels the imageonload is placed below the outermost html for the grid element. We have to have this so the directive knows which html element to set the new height on. also I use the "title" attribute to set which grid this grid resizing is for (that way you can use the directive multiple times on the same page for different grids and not have the events for the wrong grid triggered). Does anyone know how I can get the "onload" directive to get called AFTER angularJS binds to the grid element? Just for completeness here are 2 images (almost looks like just 1), the second is a grid that contains grid elements that have images and use the "imageonload" directive and the first is a grid that contains grid elements that do not use images and only uses the "onload" directive.

    Read the article

  • Answers to Conference Revenue Tweet Questions

    - by D'Arcy Lussier
    Originally posted on: http://geekswithblogs.net/dlussier/archive/2014/05/27/156612.aspxI tweeted this the other day… …and I had some people tweet back questioning/asking about the profit number. So here’s how I came to that figure. Total Revenue Let’s talk total revenue first. This conference has a huge list of companies/organizations paying some amount for sponsorship. Platinum ($1500) x 5 = $7500 Gold ($1000) x 3 = $3000 Silver ($500) x 9 = $4500 Bronze ($250) x 13 = $3250 There’s also a title sponsor level but there’s no mention of how much that is…more than $1500 though, so let’s just say $2500. Total Sponsorship Revenue: $20750.00 For registrations, this conference is claiming over 300 attendees. We’ll just calculate at 300 and the discounted “member rate” – $249. Total Registration Revenue: $74700.00 Booth space is also sold for a vendor area, but let’s just leave that out of the calculation. Total Event Revenue: $95450.00 Now that we know how much money we’re playing with, let’s knock out the costs for the event. Total Costs Hard Costs Audio/Visual Services $2000 Conference Rooms (4 Breakouts + Plenary) $2500 Insurance $700 Printing/Signage $1500 Travel/Hotel Rooms $2000 Keynotes $2000 So let’s talk about these hard costs first. First you may be asking about the Audio Visual. Yes those services can be that high, actually higher. But since there’s an A/V company touted as the official A/V provider, I gotta think there’s some discount for being branded as such. Conference rooms are actually an inflated amount of $500 per. Venues make money on the food they sell at events, not on room rentals. The more food, the cheaper the rooms tend to be offered at. Still, for the sake of argument, let’s set the rooms at $500 each knowing that they could be lower. For travel and hotel rooms…it appears that most of the speakers at this conference are local, meaning there’s no travel or hotel cost. But a few of them I wasn’t too sure…so let’s factor in enough to cover two outside speakers (airfare and hotel). There are two keynotes for this event and depending on the event those may be paid gigs. I’m not sure if they are or not, but considering the closing one is a comedian I’m going to add some funds here for that just in case. Total Hard Costs: $10700 Now that the hard costs are out of the way, let’s talk about the food costs. Food Costs The conference is providing a continental breakfast (YEEEESH!), some level of luncheon, and I have to assume coffee breaks in between. Let’s look at those costs. Continental Breakfast $12 per person Lunch Buffet $18 per person Coffee Breaks (2) $6 per person (or $3 a cup) Snacks (2) $10 per person (or $5 each) Note that the lunch buffet assumes a *good* lunch buffet – two entrees, starch, vegetable, salads, and bread. Not sure if there’ll be snacks during coffee breaks but let’s assume so. Total Food Cost Per Person: $46 Food Cost: $14950 Gratuity: $2691 Total Food Cost: $17641 Total food cost is based on the $46 per person cost x 325. 300 for attendance, 12 for speakers, extra 13 for volunteers/organizers. Gratuity is 18%. Grand Totals So let’s sum things up here. Total Costs Hard Costs: $10700.00 Food Costs: $17641.00 Total:          $28341.00 Taxes:         $3685.00 Grand Total  $32026.00 Total Revenue Sponsorship  $20750 Registration   $74700 Grand Total   $95450.00 Total Profit $63424.00 Now what if the registration numbers were lower and they only got 100 people to show up. In that scenario there’d still be a profit of just under $26000. Closing Comments A couple of things to note: - I haven’t factored in anything for prizes. Not sure if any will be given out - We didn’t add in the booth space revenue - We’re assuming speakers aren’t getting paid, but even if they were at the high end its $12000 ($1000 per session), which is probably an inflated number for local speakers. - Note that all registrations were set to the “member” discounted price. The non-member registration price is higher. There is also an option for those that just want to show up for the opening keynote. There you have it! Let me know if you have any questions. D

    Read the article

  • Kernel Compiling from Vanilla to several machines

    - by Linux Pwns Mac
    When compiling kernels for machines is there a safe or correct way to create a template for say servers? I work with a lot of RHEL servers and want to compile them with GRSEC. However, I do not wish to always rebuild off of the .config for each machine and go in and remove a bunch of unrelated modules like wireless, bluetooth, ect... which you typically do not need in servers. I want to create a template .config that can be used on any machine, but is there a safe way to do that when hardware changes? I know with Linux, at least from my experience, you can cross jump hardware way easier then Windows/OSX. I assume that as long as I leave MOST of all the main hardware modules/CPU in that this could create a .config that would work for all or just about any machine?

    Read the article

  • Printing on Windows 8 64-Bit through Windows Server 2008 (32 Bit) RemoteApp

    - by Chris
    We have a network where our server is running on Windows Server 2008 (32 Bit) and a client computer is running on Windows 8.1 (64 bit) with a local printer attached to the client. The printer is an HP P1006. The remote app works well but when trying to print we get an odd "error 545". We have tried both using the "connect client printer" function in remoteapp and also making the printer shared over the network and printing to it via the network from within the remoteapp. Nothing works. We can print a test page from the server to the client computer just fine, but it seems from remoteapp we cannot. We have also tried installing the 32 bit drivers on the 64 bit machine as both the primary and secondary drivers but cannot get them to install. Suggestions please? We've been going crazy over this issue.

    Read the article

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