dynamic

Unpivot dynamic columns to rows - missing data from last columns

心已入冬 提交于 2019-12-11 02:39:41
问题 I have many tables like below, and column names are different each table. id city aaaa bbbb cccc dddd eeee ffff gggg hhhh iiii jjjj kkkk llll mmmm -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- 1 LAX 0.0 0.0 1.0 2.5 0.0 3.0 0.0 0.0 1.0 0.0 1.6 0.0 1.1 2 SFO 1.7 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 2.4 3 NYC 0.0 1.0 0.0 0.0 4.0 0.0 0.0 0.0 0.0 2.0 0.0 0.0 1.3 And I would like to get result like below for above example table: id city item qty -- ---- ---- ---- 1

dynamic server time

吃可爱长大的小学妹 提交于 2019-12-11 02:37:26
问题 As I understand there is no way I can get dynamic server time in IE with settimeout() in script.. I found this example: function timeExam(){ $.ajax({ url : "inc/clock.php", success : function (data) { $("#clock_time").html(data); } }); var func = function() { timeExam(); } setTimeout(func, 1000); } <body onload="timeExam();"> bla bla bla </body> Maybe it is possible to make it work? If not, could you please suggest me a dynamic clock with server time that works in all browsers?! I tried a

How can I produce a table of transition types in R?

喜夏-厌秋 提交于 2019-12-11 02:36:29
问题 I have some data which has a number of different id's in it and a list of their states at different times (t1, t2, t3 etc) and I'd like to generate a table that gives information about the different types of state change that happen, so something that would look like this for the sample data (copied below). x y z x 0 2 0 y 1 2 1 z 1 0 2 Which would show, for example, that x changed to y twice and y changed to x once. Does anyone know how I might be able to do this in R? SAMPLE DATA: id <- c(

Use python to dynamically create bash aliases

佐手、 提交于 2019-12-11 02:34:17
问题 I'm attempting to use python to dynamically create bash aliases (like, for example, aliases to log in to a set of servers). I'd love to be able to do something like this: from subprocess import call SERVERS = [ ("example", "user@example.com"), #more servers in list ] for server in SERVERS: call('alias %s="ssh %s"' % (server[0], server[1]), shell=True) The problem is that subprocess launches the jobs in a separate shell session, so the program runs fine, but does nothing to the shell session I

Dynamically Create C# Class or Object

柔情痞子 提交于 2019-12-11 02:29:13
问题 I have this structure. public class FirstClass { public List<Foo> FooList{ get; set; } } public class Foo{ //Ex: //public string Name{ get; set; } } public List<Foo> GetFoo(){ //I'm use Firstclass like this here typeof(FirstClass); //I want create here dynamic property for Foo class. } And my problem is, i want create property for "Foo" class from "GetFoo()" function. Same time, this function return "List" "Foo" type. I'm research "Dynamically Add C# Properties at Runtime", "How to

Dynamic Form Builder with CodeIgniter [closed]

不羁岁月 提交于 2019-12-11 02:27:58
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 4 years ago . I am planning to build a dynamic form for different form layout with http://bootsnipp.com/forms?version=3 I wanna do this with CodeIgniter PHP framework. Frontend section of builder like this link. Backend section some problem I wanna save in database a created form layout built with this builder.

add items to listview dynamically android

六眼飞鱼酱① 提交于 2019-12-11 02:13:23
问题 How to take data that was typed in EditText and by clicking "submit" in that window should add it to previous activity listview items? What I need to do is: Creating EditText and submit button Creating listview in same Activity By clicking submit button it should display it in listview. 回答1: You could create a new class with a public static variable that holds the data which was submitted when you pressed the button. Then override the onResume() event of your previous activity, which will be

Rust dynamic cast trait object between different taits

老子叫甜甜 提交于 2019-12-11 02:09:14
问题 I was wondering if it is possible to cast a trait object to another trait object. I tried the following code: trait TraitA { fn say_hello(&self) { self.say_hello_from_a(); } fn say_hello_from_a(&self); } trait TraitB { fn say_hello(&self) { self.say_hello_from_b(); } fn say_hello_from_b(&self); } struct MyType {} impl TraitA for MyType { fn say_hello_from_a(&self) { println!("Hello from A"); } } impl TraitB for MyType { fn say_hello_from_b(&self) { println!("Hello from B"); } } fn main() {

Create Dynamic Proxies objects

混江龙づ霸主 提交于 2019-12-11 02:05:48
问题 Is there a way to create WCF proxy objects on the fly without using codedom? By on the fly I mean during runtime. So lets say I have a smart client application that is accessing a WCF service. The Data Contract for the WCF service is changed while the client is running. I want to dynamically create a new proxy object that reflects the changed data contract. 回答1: You should read this article: WCF the Manual Way… the Right Way And look into using the ChannelFactory class. You are going to have

Polynomy function with changing number of parameters

不羁的心 提交于 2019-12-11 01:59:26
问题 is it possible (in Python) to define a polynomial type of function that has changing amount of parameters? Number of parameters should change according to number of data series that I have in my input file. Currently I have something like this: def y(x, a0, x2, x3, x4): y = a0 + a1*x + a2*x**2 + a3*x**3 return y I could of course set parameters of higher order to zero by extra parameter but would there be some better way. 回答1: You can loop over the arguments and evaluate the polynomial using