[Solved] subtract from hour not in time format in php

Use explode() to separate the hour / minute pieces, then do the math yourself: list( $hour, $min) = explode( ‘:’, “192:40”); list( $hour_sub, $min_sub) = explode( ‘:’, “02:30”); $result = ($hour – $hour_sub) . ‘:’ . ($min – $min_sub); echo $result; This will print: 190:10 If the time were to wrap around, ($min – $min_sub) … Read more

[Solved] parse and sort links [closed]

You can do it just by extracting the domain and using it as index for an array with the encrypted values, like so: $url=$_POST[‘url’]; $url=nl2br($url); $url=explode(“<br />”,$url); $urls = array(); foreach ($url as $value ){ $arr = explode(‘www.’,$value); $encrypt = md5($value); $urls[$arr[1]][]= $encrypt; //this line now fixed, had an error } foreach($urls as $key => … Read more

[Solved] How to Add last column in mysql table

Given the code you’ve posted, here’s how I’d handle this. First, I’d create an associative lookup array whose keys are the column names and whose values are the corresponding point values; it would look something like this: $pointVals = array(’email1′ => 2, ’email2′ => 5, ’email3′ => 2, … ); You can generate this array … Read more

[Solved] Options inside an input element [closed]

Use a <select> with given <options>: The select element represents a control for selecting among a list of options. (1) Example <select> <option>My first option</option> <option>My second option</option> <option>My third option</option> </select> See also: MDN: select MDN: option solved Options inside an input element [closed]

[Solved] Custom popup dialog with input field [closed]

try to use this custom popup dialog code main.xml <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:orientation=”vertical” > <Button android:id=”@+id/buttonPrompt” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:text=”Show Prompt Dialog” /> <EditText android:id=”@+id/editTextResult” android:layout_width=”match_parent” android:layout_height=”wrap_content” > </EditText> </LinearLayout> Custom.xml <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:id=”@+id/layout_root” android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:orientation=”vertical” android:padding=”10dp” > <TextView android:id=”@+id/textView1″ android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:text=”Type Your Message : ” android:textAppearance=”?android:attr/textAppearanceLarge” … Read more

[Solved] Data Structure of Class [closed]

The compiler assigns offsets to all members, and includes these in all load/store operations on members: struct foo { uint32_t bar; uint32_t baz; uint32_t get_baz() { return baz; } }; uint32_t get_baz_from_foo(foo *f) { return f->baz; } becomes (ARM assembler code used for simplicity): foo__get_baz: ; calling convention: this pointer in r3 ; load 32 … Read more

[Solved] Draw Line on Google Map using C# [closed]

Here’s how to do it using the Javascript API v3: https://developers.google.com/maps/documentation/javascript/overlays#Polylines But it sounds like you may be using some sort of control that does it for you in C#. I’m going to guess because you haven’t provided more information about what you are using to create the map, but let’s assume you’re using: http://googlemap.codeplex.com/ … Read more

[Solved] how to remove Ì from data in C [closed]

It’s easy enough if you are using std::string to hold your value. #include <string> #include <algorithm> std::string input = …; input.erase(std::remove(input.begin(), input.end(), ‘Ì’), input.end()); It’s more complex if you insist on using C strings or arrays. I see from the comments above that you are using C strings. I suggest you switch to using C++ … Read more

[Solved] Comparing multiple data frames

Here are a couple of ideas. This is what I think your data look like? before <- data.frame(val=c(11330,2721,52438,6124), lab=c(“STAT1″,”STAT2″,”STAT3″,”SUZY”)) after <- data.frame(val=c(17401,3462,0,72), lab=c(“STAT1″,”STAT2″,”STAT3″,”SUZY”)) Combine them into a single data frame with a period variable: combined <- rbind(data.frame(before,period=”before”), data.frame(after,period=”after”)) Reformat to a matrix and plot with (base R) dotchart: library(reshape2) m <- acast(combined,lab~period,value.var=”val”) dotchart(m) Plot with … Read more

[Solved] I am Using Jbuttons on Jpanel and addding this jpanel on Jlist. I am using addMouseListener on list. Not able to get click on Button on Jpanel

item.getComponentAt(p); What is the point of that statement? How can you tell if the code worked or not since you never assign the result of the method to a variable? Turns out that because the panel is not really a component displayed on the frame you can’t just do as I originally suggested. If you … Read more