Search Results

Search found 11449 results on 458 pages for 'dynamic languages'.

Page 23/458 | < Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >

  • Dynamic table design (common lookup table), need a nice query to get the values

    - by Swoosh
    sql2005 This is my simplified example: (in reality there are 40+ tables in here, I only showed 2) I got a table called tb_modules, with 3 columns (id, description, tablename as varchar): 1, UserType, tb_usertype 2, Religion, tb_religion (Last column is actually the name of a different table) I got an other table that looks like this: tb_value (columns:id, tb_modules_ID, usertype_OR_religion_ID) values: 1111, 1, 45 1112, 1, 55 1113, 2, 123 1114, 2, 234 so, I mean 45, 55, 123, 234 are usertype OR religion ID's (45, 55 usertype, 123, 234 religion ID`s) Don't judge, I didn't design the database Question How can I make a select, showing * from tb_value, plus one column That one column would be TITLE from the tb_usertype or RELIGIONNAME from the tb_religion table I would like to make a general thing. Was thinking initially about maybe a SQL function that returns a string, but I think I would need dynamic SQL, which is not ok in a function. Anyone a better idea ?

    Read the article

  • How to handle concurrency control in dynamic data?

    - by Andrew
    I've been quite impressed with dynamic data and how easy and quick it is to get a simple site up and running. I'm planning on using it for a simple internal HR admin site for registering people's skills/degrees/etc. I've been watching the intro videos at www.asp.net/dynamicdata and one thing they never mention is how to handle concurrency control. It seems that DD does not handle it right out of the box (unless there is some setting I haven't seen) as I manually generated a change conflict exception and the app failed without any user friendly message. Anybody know if DD handles it out of the box? Or do you have to somehow build it into the site?

    Read the article

  • dynamic programming: speeding up this function

    - by aristotaly
    i have this program //h is our N static int g=0; int fun(int h){ if(h<=0){ g++; return g; } return g+fun(h-1)+fun(h-4); } is it possible to speed it up using dynamic programming i fugured out this function runs in O(2^n) it means that i suppose to reduce this time but the trouble is that i don get the idea of dinamic programming even a leading hint or a useful link to a resource will do it is a work assingment i do not ask for the solution :) just asking for the right direction

    Read the article

  • Generating Dynamic web pages without server side scripting

    - by Microkernel
    Hi guys, I am trying to control a media device which has lot of multimedia content that it can play using another device(remote control device) like an ipad connected to the LAN. (UPnP) I want the media device to be able to send the content listing to the remote device so that it will be rendered as a webpage on the remote controller. And actions on the webpages needs to be sent to the the device as commands to execute (like play, pause, next etc). The media device is an embedded device, hence can't have any server side scripting, all has to be done on the client side. I want the page rendered to be HTML5. So, is it possible to generate dynamic HTML5 pages using just client side scripting? Thanks a lot. I am an embedded systems developer hence clueless about the web designing stuff.

    Read the article

  • JQuery Validate Dynamic Table

    - by Richard
    I'm using the JQuery validation plug to validate my entire form. I also have a dynamic table on my registration page where the user can register more people. I can validate the rest of the form fine but my goal is to validate the table inputs just the same. Here is my jfiddle code: tables I don't know why the add line won't work there but it definitely works on my page. Anyway, that code ends up validate ONLY the first row of my table, but I want it to validate every single row. Can anyone see any problems with the code?

    Read the article

  • Dynamic dispatch and inheritance in python

    - by Bill Zimmerman
    Hi, I'm trying to modify Guido's multimethod (dynamic dispatch code): http://www.artima.com/weblogs/viewpost.jsp?thread=101605 to handle inheritance and possibly out of order arguments. e.g. (inheritance problem) class A(object): pass class B(A): pass @multimethod(A,A) def foo(arg1,arg2): print 'works' foo(A(),A()) #works foo(A(),B()) #fails Is there a better way than iteratively checking for the super() of each item until one is found? e.g. (argument ordering problem) I was thinking of this from a collision detection standpoint. e.g. foo(Car(),Truck()) and foo(Truck(), Car()) and should both trigger foo(Car,Truck) # Note: @multimethod(Truck,Car) will throw an exception if @multimethod(Car,Truck) was registered first? I'm looking specifically for an 'elegant' solution. I know that I could just brute force my way through all the possibilities, but I'm trying to avoid that. I just wanted to get some input/ideas before sitting down and pounding out a solution. Thanks

    Read the article

  • How to use a dynamic smarty variable in foreach loop

    - by P Kumar
    Hi, Can anyone tell me how to use dynamic variables in smarty foreach loop. I am trying to create a module in prestashop and m very close to get it done. here's my code: //file name index.php foreach($subCategories as $s) { $foo = intval($s['id_category']); $k = new Category($foo); $var1 = "subSubCategories.$foo"; $var1 = $k-getSubCategories(1); $smarty-assign(array('foo'.$foo = $var1)); } //file name:index.tpl {assign var=foo value=$foo$cat} //where $cat is a variable that counts the number of categories {if isset($foo) AND $foo} {foreach from=$foo item=subCategories name=homesubCategories} <p>{$subCategories.name}</p> {/foreach} {else} <p>{l s='test failed'}</p> {/if} I've exhausted all of my resources and knowledge and feeling quite helpless at this moment. so plz help me out.

    Read the article

  • dynamic model is not loading fields

    - by Toby Justus
    I am using a dynamic model found on the forum of sencha. function modelFactory(name, fields) { alert(fields); return Ext.define(name, { extend: 'Ext.data.Model', fields: fields }); } I placed the alert(fields) to check what happens with the field because it was not working. I get this: [object Object],[object Object],[object Object] How can i change this into a correct way to use it in the fields? Is there a way to check if the model has been created? With Firebug or something? EDIT: i get this in firebug: [Object { name="ccuDesignation", type=null}, Object { name="wanNumber", type=null}, Object { name="carrierName", type=null}, Object { name="dataPackageName", type=null}, Object { name="simIccid", type=null}, Object { name="expiryTime", type=null}, Object { name="bytesRx", type=null}, Object { name="bytesTx", type=null}]

    Read the article

  • create dynamic link buttons in ListView

    - by Sunny
    Hi, I am creating a search using listview. when user enter a word in search, I am generating a listview with the results. Now, there will be tags in each listview row. When, user clicks the tag, again a search happens using the value in the tag. There may be any number of tags for each listview row. I have to generate linkbuttons for these tags. Could anyone please guide me on how to create dynamic linkbuttons and access those values for further search. You can have a look at delicious.com. I need a similar functionality. Thanks in advance.

    Read the article

  • Dynamic Variable Names

    - by Ross
    I have a function that is called 3 times, I want times to assign it a name. How can I assign dynamic variable names to movieclips or do reference them by name or instancename? var loadedMovie:MovieClip = new MovieClip(); loadedMovie.name = "mymovie"; loadedMovie = loadEvent.currentTarget.content; loadedMovie.x = 0; loadedMovie.y = 0; addChild(loadedMovie); mymovie.x = 20;

    Read the article

  • C# Dynamic From Components (Performance problem)

    - by Svisstack
    Hello, I have a problem with performance of my code under Windows Forms. Have a form, her layout is depending on constructor data, because he layout must be OnLoad or in Constructor generated. I generation is simple, base FlowLayoutPanel have other FlowLayoutPanels, for each have a Label and TextBox with DataBinding. Problem is this is VERY SLOW, up to 20 seconds, i drawing less than 100 controls, from Performace Session i know a problem is on 70% procesing functions: System.Windows.Forms.Control.ControlCollection.Add(class System.Windows.Forms.Control) System.Windows.Forms.ControlBindingsCollection.Add(class System.Windows.Forms.Binding) How i can do with this? Anyone help me in this problem? How solve the dynamic form layout problem?

    Read the article

  • Dynamic Programming resources in C?

    - by EsotericMe
    Hi everyone, I'll be writing the online Google test tomorrow as a fresher. Apparently, they definitely ask one problem on Dynamic Programming? Does anyone know of a good resource for collection of DP problems in C along with solutions? I know what DP is & have used it on an occasion or twice. However I feel to crack a DP problem in test, prior practice of typical problems will make it easier to approach. Any good resources or problem sets with solutions in C will be highly appreciated. Thanks.

    Read the article

  • C# Dynamic Keyword exception handling

    - by user972255
    The below code throws an exception when executing this line (i.e. something.Add(name)). I want to catch the actual exception when executing this. I mean I don't want to use catch(Exception ex) instead of that I want to know what is the correct exception thrown here. try { dynamic name= "test"; var something = new List<decimal>(); something.Add(name); } catch(Exception ex) { throw ex; } Thanks in advance.

    Read the article

  • Dynamic where clause in LINQ - with column names available at runtime

    - by sandesh247
    Disclaimer: I've solved the problem using Expressions from System.Linq.Expressions, but I'm still looking for a better/easier way. Consider the following situation : var query = from c in db.Customers where (c.ContactFirstName.Contains("BlackListed") || c.ContactLastName.Contains("BlackListed") || c.Address.Contains("BlackListed")) select c; The columns/attributes that need to be checked against the blacklisted term are only available to me at runtime. How do I generate this dynamic where clause? An additional complication is that the Queryable collection (db.Customers above) is typed to a Queryable of the base class of 'Customer' (say 'Person'), and therefore writing c.Address as above is not an option.

    Read the article

  • Dynamic access to tables from another database inside an user function

    - by Alberto Martinez
    I have an user defined table function in SQL Server that aggregate data from several tables including a couple of tables of another database. That is done hardcoding the name of the database in the queries, but we want to make the database name configurable (because our databases usually share the server with the databases of other applications). I tried to construct a dynamic query string inside the function using the database name that is stored in a configuration table, but: When I tried exec(@sqlStatement) SQL Server said that execute string is not allowed inside a function. Then I tried exec sp_executesql @sqlStatement and the function was created, but when you execute it SQL Server says that inside a function you can only run extended functions and procedures. So the question is: is possible create a function or stored procedure that access a table in another database without having to recreate the function when the database name is different? TIA.

    Read the article

  • DataContext Doesn't Exist in Dynamic Data Project?

    - by davemackey
    This is really annoying...and I know it is something extremely simple... 1. I create a new Dynamic Data project. 2. I add a LINQ-to-SQL class and drag and drop some tables onto the class. 3. I open the global.asax.vb and uncomment the line: DefaultModel.RegisterContext(GetType(YourDataContext), New ContextConfiguration() With {.ScaffoldAllTables = True}) I remove YourDataContext and replace it with the DataContext from my LINQ-to-SQL class: DefaultModel.RegisterContext(GetType(NorthwindDataContext), New ContextConfiguration() With {.ScaffoldAllTables = True}) I then try to debug/build/etc. and receive the following error: Type 'NorthwindDataContext' is not defined Why is it not defined? It seems like its not recognizing I created the DBML file.

    Read the article

  • Return multiple results using dynamic sql (postgresql 8.2)

    - by precose
    I want to loop through schemas and get a result set that looks like this: Count 5 834 345 34 984 However, I can't get it to return anything using dynamic sql...I've tried everything but 8.2 is being a real pain. Here is my function: CREATE OR REPLACE FUNCTION dwh.adam_test4() RETURNS void LANGUAGE plpgsql AS $function$ DECLARE myschema text; rec RECORD; BEGIN FOR myschema IN select distinct c.table_schema, d.p_id from information_schema.tables t inner join information_schema.columns c on (t.table_schema = t.table_schema and t.table_name = c.table_name) join dwh.sgmt_clients d on c.table_schema = lower(d.userid) where c.table_name = 'fact_members' and c.column_name = 'debit_card' and t.table_schema NOT LIKE 'pg_%' and t.table_schema NOT IN ('information_schema', 'ad_delivery', 'dwh', 'users', 'wand', 'ttd') order by table_schema LOOP EXECUTE 'select count(ucic) from '|| myschema || '.' ||'fact_members where debit_card = ''yes''' into rec; RETURN rec; END LOOP; END $function$

    Read the article

  • Spreading dynamic with community structure

    - by YogurtFruit
    I have a data set which I hope to simulate the spreading dynamic with community structure. The steps I follow is import the data to a complex network with Networkx partition the network into some modules which are known as communities simulate the SIS model and draw plots with and without communities. Something confused me between step 2 and step 3. After partitioning, I get some communities which contains nodes number. The community numbers and nodes numbers are the only input to step 3, and how I simulate SIS with and without communities?

    Read the article

  • Why do some languages not use semicolons and braces?

    - by Incognito
    It is interesting that some languages do not use semicolons and braces, even though their predecessors had them. Personally, it makes me nervous to write code in Python because of this. Semicolons are also missing from Google's GO language, although the lexer uses a rule to insert semicolons automatically as it scans. Why do some languages not use semicolons and braces?

    Read the article

  • Would javascript and similar scripting languages benefit from being strongly typed?

    - by cwap
    Just had my mind going today. I spent some time in IE debug mode, browsing the web as usual, and oh boy do I see many errors :) Most of these errors are because some value are of a different type than expected (at least as far as I interpret the error messages). What are the reasons JavaScript and similar scripting languages aren't strongly typed? Is it just to make the languages "easier" to understand and more accessable, or is the lack of a "compile-time" the real problem?

    Read the article

  • Reflect.Emit Dynamic Type Memory Blowup

    - by Firestrand
    Using C# 3.5 I am trying to generate dynamic types at runtime using reflection emit. I used the Dynamic Query Library sample from Microsoft to create a class generator. Everything works, my problem is that 100 generated types inflate the memory usage by approximately 25MB. This is a completely unacceptable memory profile as eventually I want to support having several hundred thousand types generated in memory. Memory profiling shows that the memory is apparently being held by various System.Reflection.Emit types and methods though I can't figure out why. I haven't found others talking about this problem so I am hoping someone in this community either knows what I am doing wrong or if this is expected behavior. Contrived Example below: using System; using System.Collections.Generic; using System.Text; using System.Reflection; using System.Reflection.Emit; namespace SmallRelfectExample { class Program { static void Main(string[] args) { int typeCount = 100; int propCount = 100; Random rand = new Random(); Type dynType = null; for (int i = 0; i < typeCount; i++) { List<DynamicProperty> dpl = new List<DynamicProperty>(propCount); for (int j = 0; j < propCount; j++) { dpl.Add(new DynamicProperty("Key" + rand.Next().ToString(), typeof(String))); } SlimClassFactory scf = new SlimClassFactory(); dynType = scf.CreateDynamicClass(dpl.ToArray(), i); //Optionally do something with the type here } Console.WriteLine("SmallRelfectExample: {0} Types generated.", typeCount); Console.ReadLine(); } } public class SlimClassFactory { private readonly ModuleBuilder module; public SlimClassFactory() { AssemblyName name = new AssemblyName("DynamicClasses"); AssemblyBuilder assembly = AppDomain.CurrentDomain.DefineDynamicAssembly(name, AssemblyBuilderAccess.Run); module = assembly.DefineDynamicModule("Module"); } public Type CreateDynamicClass(DynamicProperty[] properties, int Id) { string typeName = "DynamicClass" + Id.ToString(); TypeBuilder tb = module.DefineType(typeName, TypeAttributes.Class | TypeAttributes.Public, typeof(DynamicClass)); FieldInfo[] fields = GenerateProperties(tb, properties); GenerateEquals(tb, fields); GenerateGetHashCode(tb, fields); Type result = tb.CreateType(); return result; } static FieldInfo[] GenerateProperties(TypeBuilder tb, DynamicProperty[] properties) { FieldInfo[] fields = new FieldBuilder[properties.Length]; for (int i = 0; i < properties.Length; i++) { DynamicProperty dp = properties[i]; FieldBuilder fb = tb.DefineField("_" + dp.Name, dp.Type, FieldAttributes.Private); PropertyBuilder pb = tb.DefineProperty(dp.Name, PropertyAttributes.HasDefault, dp.Type, null); MethodBuilder mbGet = tb.DefineMethod("get_" + dp.Name, MethodAttributes.Public | MethodAttributes.SpecialName | MethodAttributes.HideBySig, dp.Type, Type.EmptyTypes); ILGenerator genGet = mbGet.GetILGenerator(); genGet.Emit(OpCodes.Ldarg_0); genGet.Emit(OpCodes.Ldfld, fb); genGet.Emit(OpCodes.Ret); MethodBuilder mbSet = tb.DefineMethod("set_" + dp.Name, MethodAttributes.Public | MethodAttributes.SpecialName | MethodAttributes.HideBySig, null, new Type[] { dp.Type }); ILGenerator genSet = mbSet.GetILGenerator(); genSet.Emit(OpCodes.Ldarg_0); genSet.Emit(OpCodes.Ldarg_1); genSet.Emit(OpCodes.Stfld, fb); genSet.Emit(OpCodes.Ret); pb.SetGetMethod(mbGet); pb.SetSetMethod(mbSet); fields[i] = fb; } return fields; } static void GenerateEquals(TypeBuilder tb, FieldInfo[] fields) { MethodBuilder mb = tb.DefineMethod("Equals", MethodAttributes.Public | MethodAttributes.ReuseSlot | MethodAttributes.Virtual | MethodAttributes.HideBySig, typeof(bool), new Type[] { typeof(object) }); ILGenerator gen = mb.GetILGenerator(); LocalBuilder other = gen.DeclareLocal(tb); Label next = gen.DefineLabel(); gen.Emit(OpCodes.Ldarg_1); gen.Emit(OpCodes.Isinst, tb); gen.Emit(OpCodes.Stloc, other); gen.Emit(OpCodes.Ldloc, other); gen.Emit(OpCodes.Brtrue_S, next); gen.Emit(OpCodes.Ldc_I4_0); gen.Emit(OpCodes.Ret); gen.MarkLabel(next); foreach (FieldInfo field in fields) { Type ft = field.FieldType; Type ct = typeof(EqualityComparer<>).MakeGenericType(ft); next = gen.DefineLabel(); gen.EmitCall(OpCodes.Call, ct.GetMethod("get_Default"), null); gen.Emit(OpCodes.Ldarg_0); gen.Emit(OpCodes.Ldfld, field); gen.Emit(OpCodes.Ldloc, other); gen.Emit(OpCodes.Ldfld, field); gen.EmitCall(OpCodes.Callvirt, ct.GetMethod("Equals", new Type[] { ft, ft }), null); gen.Emit(OpCodes.Brtrue_S, next); gen.Emit(OpCodes.Ldc_I4_0); gen.Emit(OpCodes.Ret); gen.MarkLabel(next); } gen.Emit(OpCodes.Ldc_I4_1); gen.Emit(OpCodes.Ret); } static void GenerateGetHashCode(TypeBuilder tb, FieldInfo[] fields) { MethodBuilder mb = tb.DefineMethod("GetHashCode", MethodAttributes.Public | MethodAttributes.ReuseSlot | MethodAttributes.Virtual | MethodAttributes.HideBySig, typeof(int), Type.EmptyTypes); ILGenerator gen = mb.GetILGenerator(); gen.Emit(OpCodes.Ldc_I4_0); foreach (FieldInfo field in fields) { Type ft = field.FieldType; Type ct = typeof(EqualityComparer<>).MakeGenericType(ft); gen.EmitCall(OpCodes.Call, ct.GetMethod("get_Default"), null); gen.Emit(OpCodes.Ldarg_0); gen.Emit(OpCodes.Ldfld, field); gen.EmitCall(OpCodes.Callvirt, ct.GetMethod("GetHashCode", new Type[] { ft }), null); gen.Emit(OpCodes.Xor); } gen.Emit(OpCodes.Ret); } } public abstract class DynamicClass { public override string ToString() { PropertyInfo[] props = GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public); StringBuilder sb = new StringBuilder(); sb.Append("{"); for (int i = 0; i < props.Length; i++) { if (i > 0) sb.Append(", "); sb.Append(props[i].Name); sb.Append("="); sb.Append(props[i].GetValue(this, null)); } sb.Append("}"); return sb.ToString(); } } public class DynamicProperty { private readonly string name; private readonly Type type; public DynamicProperty(string name, Type type) { if (name == null) throw new ArgumentNullException("name"); if (type == null) throw new ArgumentNullException("type"); this.name = name; this.type = type; } public string Name { get { return name; } } public Type Type { get { return type; } } } }

    Read the article

  • Remove languages in translations?

    - by Pit
    Hi, I use spell-checker for 4 languages, en, de, fr, and lb. If I enable Spellchecking and writing aids for en, de or fr in System -> Administration -> Language Support there will be multiple versions of each language available, e.g. en , en_CA, en_GB, ... Is there a possibility to select only one of those language versions while enabling the language, or removing the others afterwards. It would be enough to remove them from the selection menu. I would like to use the version which is equal to the country the language originally comes from: e.g. de_DE, fr_FR, en_GB. For lb there is currently only lb_LU so there is no problem (yet). Instead of 4 languages I currently have around 20, which is kind of annoying when switching the language ( which I do quite often). There might be a similar problem for the menu translations, where if I understand correctly you can choose the order in which translations are applied if they exist. Any suggestions?

    Read the article

  • Uses of persistent data structures in non-functional languages

    - by Ray Toal
    Languages that are purely functional or near-purely functional benefit from persistent data structures because they are immutable and fit well with the stateless style of functional programming. But from time to time we see libraries of persistent data structures for (state-based, OOP) languages like Java. A claim often heard in favor of persistent data structures is that because they are immutable, they are thread-safe. However, the reason that persistent data structures are thread-safe is that if one thread were to "add" an element to a persistent collection, the operation returns a new collection like the original but with the element added. Other threads therefore see the original collection. The two collections share a lot of internal state, of course -- that's why these persistent structures are efficient. But since different threads see different states of data, it would seem that persistent data structures are not in themselves sufficient to handle scenarios where one thread makes a change that is visible to other threads. For this, it seems we must use devices such as atoms, references, software transactional memory, or even classic locks and synchronization mechanisms. Why then, is the immutability of PDSs touted as something beneficial for "thread safety"? Are there any real examples where PDSs help in synchronization, or solving concurrency problems? Or are PDSs simply a way to provide a stateless interface to an object in support of a functional programming style?

    Read the article

  • Telerik ASP.NET AJAX - Ajax Update Label with dynamic created Docks

    - by csharpnoob
    Hi, i try to Update a simple Label on Close Event of dynamic created RadDock. Works fine so far, Label gets the correct values but doesnt updates it. RadDock dock = new RadDock(); dock.DockMode = DockMode.Docked; dock.UniqueName = Guid.NewGuid().ToString(); dock.ID = string.Format("RadDock{0}", dock.UniqueName); dock.Title = slide.slideName; dock.Text = string.Format("Added at {0}", DateTime.Now); dock.Width = Unit.Pixel(300); dock.AutoPostBack = true; dock.CommandsAutoPostBack = true; dock.Command += new DockCommandEventHandler(dock_Command); ... void dock_Command(object sender, DockCommandEventArgs e) { Status.Text = "Removed " + ((RadDock)sender).Title + " " + ((RadDock)sender).Text; } I tried to do this: RadAjaxManager1.AjaxSettings.AddAjaxSetting(dock, Status, null); while creating the docks, but on runtime i get a NullReference Excepetion. On a Button registered with the RadAjaxManager it works to show the value assigned by dock_command. protected void Button1_Click(object sender, EventArgs e) { Status.Text = Status.Text; } UPDATE: The RadAjaxManager was created with integrated Wizzard of VS2008. Can't select the Docks, because the are generated while runtime. On Backend its included in AutoCompletion, so the NullReference has nothing to do with the AjaxManager itself. Like i said, works fine with the Button. <telerik:RadAjaxManager ID="RadAjaxManager1"> <telerik:AjaxSetting AjaxControlID="Button1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="Label1"></telerik:AjaxUpdatedControl> </UpdatedControls> </telerik:AjaxSetting>

    Read the article

< Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >