Search Results

Search found 19688 results on 788 pages for 'con current'.

Page 38/788 | < Previous Page | 34 35 36 37 38 39 40 41 42 43 44 45  | Next Page >

  • How to add columns to sqlite3 python?

    - by user291071
    I know this is simple but I can't get it working! I have no probs with insert,update or select commands, Lets say I have a dictionary and I want to populate a table with the column names in the dictionary what is wrong with my one line where I add a column? ##create con = sqlite3.connect('linksauthor.db') c = con.cursor() c.execute('''create table linksauthor (links text)''') con.commit() c.close() ##populate author columns allauthors={'joe':1,'bla':2,'mo':3} con = sqlite3.connect('linksauthor.db') c = con.cursor() for author in allauthors: print author print type(author) c.execute("alter table linksauthor add column '%s' 'float'")%author ##what is wrong here? con.commit() c.close()

    Read the article

  • mysql_close(): supplied argument is not a valid MySQL-Link resource

    - by Illes Peter
    Here's what I'm trying to do: I've got a db.php file that does all the db manipulation. It has 2 static methods, connect and deconnect. In my other file i simply use db::connect() and db::deconnect(). The mysql_close($con) in the deconnect method just doesn't know who $con is. Since I don't want to instantiate my class static is the only way to go. Declaring 'private $con' in class db doesn't seem to have an effect. Any ideas? class db { public static function connect() { $dbData = parse_ini_file($_SERVER['DOCUMENT_ROOT'].'/config.ini'); $con = mysql_connect($dbData['host'],$dbData['user'],$dbData['pass']); $db = mysql_select_db($dbData['db']); if ((!$con) || (!$db)) return 0; else return 1; } public static function deconnect() { mysql_close($con); } }

    Read the article

  • Insert problem using ADO with classic ASP

    - by Kemal Akcali
    ' Setting variables Dim con, sql_insert, data_source data_source = "project_db" sql_insert = "insert into cart ( UserID,Count,ProductName,ProductDescription,ProductPrice) values ('"&user_id&"','"&count&"','"&product_name&"','"&product_description&"','"&product_price&"')" ' Creating the Connection Object and opening the database Set con = Server.CreateObject("ADODB.Connection") con.Open data_source ' Executing the sql insertion code con.Execute sql_insert ' Done. Now Close the connection con.Close Set con = Nothing AS you can see , it is a simple code . and it worked in my local host for 5 or 6 times. but now it didn't work. What's the problem ? I think , it's about my database or memory. i setup 2 different iis in 2 different computer and they behave same... please help.. Thanks

    Read the article

  • Proper code but can't insert to database

    - by Dchris
    I have a Visual Basic project using Access database.I run a query but i don't see any new data on my database table.I don't have any exception or error.Instead of this the success messagebox is shown. Here is my code: Dim ID As Integer = 2 Dim TableNumber As Integer = 2 Dim OrderDate As Date = Format(Now, "General Date") Dim TotalPrice As Double = 100.0 Dim ConnectionString As String = "myconnectionstring" Dim con As New OleDb.OleDbConnection(ConnectionString) Try Dim InsertCMD As OleDb.OleDbCommand InsertCMD = New OleDb.OleDbCommand("INSERT INTO Orders([ID],[TableNumber],[OrderDate],[TotalPrice]) VALUES(@ID,@TableNumber,@OrderDate,@TotalPrice);", con) InsertCMD.Parameters.AddWithValue("@ID", ID) InsertCMD.Parameters.AddWithValue("@TableNumber", TableNumber) InsertCMD.Parameters.AddWithValue("@OrderDate", OrderDate) InsertCMD.Parameters.AddWithValue("@TotalPrice", TotalPrice) con.Open() InsertCMD.ExecuteNonQuery() MessageBox.Show("Successfully Added New Order", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information) con.Close() Catch ex As Exception 'Something went wrong MessageBox.Show(ex.ToString) Finally 'Success or not, make sure it's closed If con.State <> ConnectionState.Closed Then con.Close() End Try What is the problem?

    Read the article

  • Why do I see "Operation was denied because the current credentials do not have the appropriate privileges" when trying to chsh?

    - by alecmce
    I'm setting up a new dev Macbook Pro, and trying to replace bash with zsh. I installed zsh and can run it to change shell in a session. When I use sudo chsh -s /bin/zsh username I get the error message: chsh: Operation was denied because the current credentials do not have the appropriate privileges. Operation was denied because the current credentials do not have the appropriate privileges. AFAIK I have admin privileges on the machine. What could be causing this?

    Read the article

  • Du tells me it can't find the current directory?

    - by C. Ross
    I'm on AIX, and in some directories I can't use the du command. I get the follow error message: du: 0653-175 Cannot find the current directory. Obviously the current directory exists, and I have permissions to it. I can list the directory and create files in it, both before and after I ran du. What could possibly be wrong here? The du command works just fine in my home directory. A quick google search turns up a bunch of forum posts of the same problem, but no clear answers.

    Read the article

  • bash starts replacing the characters on the current line insead of moving over to the next line

    - by Lazer
    I use bash shell $ bash --version GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu) Copyright (C) 2005 Free Software Foundation, Inc. $ Sometimes, when typing a command on the prompt that is pretty lengthy and does not fit in the current line, instead of displaying the extra characters on the next line, bash starts again on the current line.. replacing the characters that were there and making a mess. what should happen : |---------------------------------------------| | $ my big long command takes a lot of argumen| | s and does not fit in a single line | | | |---------------------------------------------| what happens instead : |---------------------------------------------| | s and does not fit in a single linef argumen| | | | | |---------------------------------------------| The issue is intemittent If I resize my shell window to really small width, normal behaviour is restored Does anyone have any idea what is happening here? $ echo $TERM xterm $ echo $PS1 \[\e[30m\][\t]\[\e[0m\]\[\e]0;\w\a\]\[\e[30m\][\W]$ $

    Read the article

  • How do I get the current date according to an NTP server without setting it locally?

    - by Zac B
    I want to get the current date and time according to a remote NTP server, using Linux. I don't want to change the local time as a result; I just want to get the remote date, adjusted for the local time zone, printed out. The date returned must comply with the following criteria: It needs to be reasonably accurate. It needs to be adjusted for the timezone on the local system making the request. It needs to be formatted in an easily-readable or interpretable way (standard date format, or seconds since epoch). What I've Tried: I can call ntpdate -q my.ntp.server and get the offset between the local time and the server's time, but that doesn't return the date according to the NTP server; it just returns the offset and the local date. Is there some easy way/command I can use to say: "Print out the date according to a given NTP server, adjusted for my current timezone"?

    Read the article

  • Can I set a <probing> privatePath in ~/subdir/web.config without access to the root application .con

    - by Bago
    In ASP.NET, is it possible to set a path from a web.config in a subdir that is not setup as a virtual directory? In other words, can I reference a private assembly in the ~/subdir/bin folder? Take a look at my setup below, and let me know if I'm doing something wrong, please. Let me explain why I'm doing this: my page is setup in ~/subdir. I don't have write access to the root. I only have FTP access to the server (i.e., I am not an IIS admin and I can't login to the machine) I am trying to use FCKeditor in my subdir application Here is my folder structure: / | -subdir | | - Bin | | | *FredCK.FCKeditorV2.dll | | *Default.aspx | | *web.config Here is the <runtime> section of ~/subdir/web.config: <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <probing privatePath="subdir;subdir/bin" /> </dependentAssembly> </assemblyBinding> </runtime> I've tried all sorts of things to get to work. However, upon checking the Fusion logs, my subdir never shows up in the probing paths.

    Read the article

  • Error loading the report template:org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid con

    - by Poonam
    hi, i'm newer in jasper reports.i've some problem when i call iReport from jsp....some error occurs at run time as like below :- Error loading the report template: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'head'. One of '{"http://jasperreports.sourceforge.net/jasperreports":field, "http://jasperreports.sourceforge.net/jasperreports":sortField, "http://jasperreports.sourceforge.net/jasperreports":variable, "http://jasperreports.sourceforge.net/jasperreports":filterExpression, "http://jasperreports.sourceforge.net/jasperreports":group, "http://jasperreports.sourceforge.net/jasperreports":background, "http://jasperreports.sourceforge.net/jasperreports":title, "http://jasperreports.sourceforge.net/jasperreports":pageHeader, "http://jasperreports.sourceforge.net/jasperreports":columnHeader, "http://jasperreports.sourceforge.net/jasperreports":detail, "http://jasperreports.sourceforge.net/jasperreports":columnFooter, "http://jasperreports.sourceforge.net/jasperreports":pageFooter, "http://jasperreports.sourceforge.net/jasperreports":lastPageFooter, "http://jasperreports.sourceforge.net/jasperreports":summary, "http://jasperreports.sourceforge.net/jasperreports":noData}' is expected. if anypne know plz help me. & can give me answer on my email id:- [email protected] thanks in advance....

    Read the article

  • Using RabbitMQ (Java client), is there a way to determine if network connection is closed during con

    - by MItch Branting
    I'm using RabbitMQ on RHEL 5.3 using the Java client. I have 2 nodes (machines). Node1 is consuming messages from a queue on Node2 using the Java helper class QueueingConsumer. QueueingConsumer consumer = new QueueingConsumer(channel); channel.basicConsume("MyQueueOnNode2", noAck, consumer); while (true) { QueueingConsumer.Delivery delivery = consumer.nextDelivery(); ... Process message - delivery.getBody() } If the interface is brought down on Node1 or Node2 (e.g. ifconfig eth1 down), the client (above) never knows the network isn't there anymore. Does RabbitMQ provide some type of configuration on the Java client that can be used to determine if the connection has gone away. Shutting down the RabbitMQ server on Node2 will trigger a ShutdownSignalException, which can be caught and the app can go into a reconnect loop. But bringing down the interface doesn't cause any type of exception to happen, so the code will be waiting forever on consumer.nextDelivery(). I've also tried using the timeout version of this call. e.g. QueueingConsumer consumer = new QueueingConsumer(channel); channel.basicConsume("MyQueueOnNode2", noAck, consumer); int timeout_ms = 30000; while (true) { QueueingConsumer.Delivery delivery = consumer.nextDelivery(timeout_ms); if (delivery == null) { if (channel.isOpen() == false) // Seems to always return true { throw new ShutdownSignalException(); } } else { ... Process message - delivery.getBody() } } but appears that this always returns true (even though the interface is down). I assume registering for the ShutdownListener on the connection will yield the same results, but haven't tried that yet. Is there a way to configure some sort of heartbeat, or do you just have to write custom lease logic (e.g. "I'm here now") in order to get this to work?

    Read the article

  • How to explain to someone that a data structure should not draw itself, explaining separation of con

    - by leeand00
    I have another programmer who I'm trying to explain why it is that a UI component should not also be a data-structure. For instance say that you get a data-structure that contains a record-set from the "database", and you wish to display that record-set in a UI component within your application. According to this programmer (who will remain nameless, he's young and I'm teaching him...), we should subclass the data-structure into a class that will draw the UI component within our application!!!!!! And thus according to this logic, the record-set should manage the drawing of the UI. **Head Desk*** I know that asking a record-set to draw itself is wrong, because, if you wish to render the same data-structure on more than one type of component on your UI, you are going to have a real mess on your hands; you'll need to extend yet another class for each and every UI component that you render from the base-class of your record-set; I am well aware of the "cleanliness" of the of the MVC pattern (and by that what I really mean is you don't confuse your data (the Model) with your UI (the view) or the actions that take place on the data (the Controller more or less...okay not really the API should really handle that...and the Controller should just make as few calls to it as it can, telling it which view to render)) But it's certainly alot cleaner than using data-structures to render UI components! Is there any other advice I could send his way other than the example above? I understand that when you first learn OOP you go through "a stage" where you where just want to extend everything. Followed by a stage when you think that Design Patterns are the solution every single problem...which isn't entirely correct either...thanks Jeff. Is there a way that I can gently nudge this kid in the right direction? Do you have any more examples that might help explain my point to him?

    Read the article

  • Is it possible to edit data in place using CListCtrl - if not, can anyone suggest an alternative con

    - by shan23
    I'm designing a MFC app in which I'd like to have a grid with 2 coloumns : both editable in which the user will input data and the app will get notified about it. The number of rows can be increased/decreased by the user as he wants - What would be the ideal MFC control to use for this kind of requirement ? This is my first time designing a MFC app , so dont mind if it sounds too noobish :)

    Read the article

  • Adding a custom control to a page, then adding multiple custom children into that one, null user con

    - by Rickjaah
    Hello all, While nerding my way through the day again. I came across a problem concerning adding children to an already add child control. I can add the controls, but when trying to use the controls in the added control, they all return null. This is the method: protected override CreateChildControls(EventArgs e) { UserControl uControl = LoadControl("~/controls/TwoColumn.ascx"); PlaceHolder holder = uControl.Controls.FindControl(phrContentMiddle) as PlaceHolder; holder.Controls.Add(LoadControl("~/controls/ImageShowControl"); } When i try to call any type of button/UserControl inside the ImageShowControl.... All return null. Is this something in the Page LifeCycle? If so, what is the way to go to realize this?

    Read the article

  • If I do "jquery sortable" on a contenteditable item(s), I then can't focus mouse anywhere inside con

    - by Matej
    Strangely this is broken only in Firefox and Opera (IE, Chrome and Safari works as it should). Any suggestion for a quick fix? <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.min.js" type="text/javascript"></script> <script> $(document).ready(function(){ $('#sortable').sortable(); }); </script> </head> <body> <span id="sortable"> <p contenteditable="true">One apple</p> <p>Two pears</p> <p>Three oranges</p> </span> </body> </html>

    Read the article

  • ¿Que riesgo hay en usar extract con las variables superglobales de php?

    - by Carlos Montalvo
    Hola usando estas funciones, que riesgo corro en tener problemas de seguridad, es necesesario usar extract() o hay alguna manera mejor de convertir las variables superglobales (array) en trozos de variables. if ( get_magic_quotes_gpc() ) { $_GET = stripslashes( $_GET ); $_POST =stripslashes( $_POST ); } function vars_globals($value = '') { if (is_array ( $value )) $r = &$value; else parse_str ( $value, $r ); return $r; } $r = vars_globals( $_GET ); extract($r, EXTR_SKIP);

    Read the article

  • How are developers using source control, I am trying to find the most efficient way to do source con

    - by RJ
    I work in a group of 4 .Net developers. We rarely work on the same project at the same time but it does happen from time to time.We use TFS for source control. My most recent example is a project I just placed into production last night that included 2 WCF services and a web application front end. I worked out of a branch called "prod" because the application is brand new and has never seen the light of day. Now that the project is live, I need to branch off the prod branch for features, bugs, etc... So what is the best way to do this? Do I simple create a new branch and sort of archive the old branch and never use it again? Do I branch off and then merge my branch changes back into the prod branch when I want to deploy to production? And what about the file and assembly version. They are currently at 1.0.0.0. When do they change and why? If I fix a small bug, which number changes if any? If I add a feature, which number changes if any? What I am looking for is what you have found to be the best way to efficiently manage source control. Most places I have worked always seem to bang heads with the source control system in on way or another and I would just like to find out what you have found that works the best.

    Read the article

  • how can I store the current status of the game in cocos2d ?

    - by srikanth rongali
    I am writing a shooting game in cocos2d. And each enemy enters the screen after the current one is dead. I have stores the enemies and their properties in plist. I need to save the current state of the game. If any phone call comes the game should be started from the current state. So, I usedNsUserDefaults in this way, - (void) applicationDidFinishLaunching:(UIApplication*)application { ... NSUserDefaults *myDefaultOptions = [[myDefaultOptions stringForKey:@"enemyNumber"]intValue] ; //tempCount4 is the current Enemy number. It was declared in another class. I am using extern and using the value here. tempCount4 = [[myDefaultOptions stringForKey:@"enemyNumber"]intValue] ; } - (void)applicationWillTerminate:(UIApplication *)application { [[CCDirector sharedDirector] end]; [myDefaultOptions setObject:tempCount4 forKey:@"enemyNumber"]; } The control is not entering in to the (void)applicationWillTerminate:(UIApplication *)application when I pressed the Home button. And when I touched the game icon on the screen the game is running from first screen and in log (terminal )it is not showing any values. And what should I store to resume my game from stored state. Can you explain where I was wrong ? Thank You.

    Read the article

  • Is it possible to specify the name of the Index property to use for lists in a fluent nhibernate con

    - by Teevus
    When mapping a HasMany or HasManyToMany in fluent nhibernate, you can specify the column name to use for the list as a parameter to the AsList() method as follows: HasMany(c => c.Customers) .AsList(c => c.Column("PositionIndex")); I would prefer to be able to set this using a Fluent NHibernate convention (either a pre-existing one, or a custom one), especially since the default name appears to be "Index" which is a reserved word in MSSQL. I've tried using a custom convention implementing IHasManyConvention, but the instance parameter does not seem to contain the information about whether its a list, a bag, or a set, and also does not contain the column details for the index column. public void Apply(IOneToManyCollectionInstance instance) { } Any ideas?

    Read the article

  • how to find which libraries to link to? or, how can I create *-config (such as sdl-config, llvm-con

    - by numeric
    Hey, I want to write a program that outputs a list of libraries that I should link to given source code (or object) files (for C or C++ programs). In *nix, there are useful tools such as sdl-config and llvm-config. But, I want my program to work on Windows, too. Usage: get-library-names -l /path/to/lib a.cpp b.cpp c.cpp d.obj Then, get-library-names would get a list of function names that are invoked from a.cpp, b.cpp, c.cpp, and d.obj. And, it'll search all library files in /path/to/lib directory and list libraries that are needed to link properly. Is there such tool already written? Is it not trivial to write a such tool? How do you find what libraries you should link to? Thanks.

    Read the article

  • More SharePoint 2010 Expression Builders

    - by Ricardo Peres
    Introduction Following my last post, I decided to publish the whole set of expression builders that I use with SharePoint. For all who don’t know about expression builders, they allow us to employ a declarative approach, so that we don’t have to write code for “gluing” things together, like getting a value from the query string, the page’s underlying SPListItem or the current SPContext and assigning it to a control’s property. These expression builders are for some quite common scenarios, I use them quite often, and I hope you find them useful as well. SPContextExpression This expression builder allows us to specify an expression to be processed on the SPContext.Current property object. For example: 1: <asp:Literal runat="server" Text=“<%$ SPContextExpression:Site.RootWeb.Lists[0].Author.LoginName %>”/> It is identical to having the following code: 1: String authorName = SPContext.Current.Site.RootWeb.Lists[0].Author.LoginName; SPFarmProperty Returns a property stored on the farm level: 1: <asp:Literal runat="server" Text="<%$ SPFarmProperty:SomeProperty %>"/> Identical to: 1: Object someProperty = SPFarm.Local.Properties["SomeProperty"]; SPField Returns the value of a selected page’s list item field: 1: <asp:Literal runat="server" Text="<%$ SPField:Title %>"/> Does the same as: 1: String title = SPContext.Current.ListItem["Title"] as String; SPIsInAudience Checks if the current user belongs to an audience: 1: <asp:CheckBox runat="server" Checked="<%$ SPIsInAudience:SomeAudience %>"/> Equivalent to: 1: AudienceManager audienceManager = new AudienceManager(SPServiceContext.Current); 2: Audience audience = audienceManager.Audiences["SomeAudience"]; 3: Boolean isMember = audience.IsMember(SPContext.Current.Web.User.LoginName); SPIsInGroup Checks if the current user belongs to a group: 1: <asp:CheckBox runat="server" Checked="<%$ SPIsInGroup:SomeGroup %>"/> The equivalent C# code is: 1: SPContext.Current.Web.CurrentUser.Groups.OfType<SPGroup>().Any(x => String.Equals(x.Name, “SomeGroup”, StringComparison.OrdinalIgnoreCase)); SPProperty Returns the value of a user profile property for the current user: 1: <asp:Literal runat="server" Text="<%$ SPProperty:LastName %>"/> Where the same code in C# would be: 1: UserProfileManager upm = new UserProfileManager(SPServiceContext.Current); 2: UserProfile u = upm.GetUserProfile(false); 3: Object property = u["LastName"].Value; SPQueryString Returns a value passed on the query string: 1: <asp:GridView runat="server" PageIndex="<%$ SPQueryString:PageIndex %>" /> Is equivalent to (no SharePoint code this time): 1: Int32 pageIndex = Convert.ChangeType(typeof(Int32), HttpContext.Current.Request.QueryString["PageIndex"]); SPWebProperty Returns the value of a property stored at the site level: 1: <asp:Literal runat="server" Text="<%$ SPWebProperty:__ImagesListId %>"/> You can get the same result as: 1: String imagesListId = SPContext.Current.Web.AllProperties["__ImagesListId"] as String; Code OK, let’s move to the code. First, a common abstract base class, mainly for inheriting the conversion method: 1: public abstract class SPBaseExpressionBuilder : ExpressionBuilder 2: { 3: #region Protected static methods 4: protected static Object Convert(Object value, PropertyInfo propertyInfo) 5: { 6: if (value != null) 7: { 8: if (propertyInfo.PropertyType.IsAssignableFrom(value.GetType()) == false) 9: { 10: if (propertyInfo.PropertyType.IsEnum == true) 11: { 12: value = Enum.Parse(propertyInfo.PropertyType, value.ToString(), true); 13: } 14: else if (propertyInfo.PropertyType == typeof(String)) 15: { 16: value = value.ToString(); 17: } 18: else if ((typeof(IConvertible).IsAssignableFrom(propertyInfo.PropertyType) == true) && (typeof(IConvertible).IsAssignableFrom(value.GetType()) == true)) 19: { 20: value = System.Convert.ChangeType(value, propertyInfo.PropertyType); 21: } 22: } 23: } 24:  25: return (value); 26: } 27: #endregion 28:  29: #region Public override methods 30: public override CodeExpression GetCodeExpression(BoundPropertyEntry entry, Object parsedData, ExpressionBuilderContext context) 31: { 32: if (String.IsNullOrEmpty(entry.Expression) == true) 33: { 34: return (new CodePrimitiveExpression(String.Empty)); 35: } 36: else 37: { 38: return (new CodeMethodInvokeExpression(new CodeMethodReferenceExpression(new CodeTypeReferenceExpression(this.GetType()), "GetValue"), new CodePrimitiveExpression(entry.Expression.Trim()), new CodePropertyReferenceExpression(new CodeArgumentReferenceExpression("entry"), "PropertyInfo"))); 39: } 40: } 41: #endregion 42:  43: #region Public override properties 44: public override Boolean SupportsEvaluate 45: { 46: get 47: { 48: return (true); 49: } 50: } 51: #endregion 52: } Next, the code for each expression builder: 1: [ExpressionPrefix("SPContext")] 2: public class SPContextExpressionBuilder : SPBaseExpressionBuilder 3: { 4: #region Public static methods 5: public static Object GetValue(String expression, PropertyInfo propertyInfo) 6: { 7: SPContext context = SPContext.Current; 8: Object expressionValue = DataBinder.Eval(context, expression.Trim().Replace('\'', '"')); 9:  10: expressionValue = Convert(expressionValue, propertyInfo); 11:  12: return (expressionValue); 13: } 14:  15: #endregion 16:  17: #region Public override methods 18: public override Object EvaluateExpression(Object target, BoundPropertyEntry entry, Object parsedData, ExpressionBuilderContext context) 19: { 20: return (GetValue(entry.Expression, entry.PropertyInfo)); 21: } 22: #endregion 23: }   1: [ExpressionPrefix("SPFarmProperty")] 2: public class SPFarmPropertyExpressionBuilder : SPBaseExpressionBuilder 3: { 4: #region Public static methods 5: public static Object GetValue(String propertyName, PropertyInfo propertyInfo) 6: { 7: Object propertyValue = SPFarm.Local.Properties[propertyName]; 8:  9: propertyValue = Convert(propertyValue, propertyInfo); 10:  11: return (propertyValue); 12: } 13:  14: #endregion 15:  16: #region Public override methods 17: public override Object EvaluateExpression(Object target, BoundPropertyEntry entry, Object parsedData, ExpressionBuilderContext context) 18: { 19: return (GetValue(entry.Expression, entry.PropertyInfo)); 20: } 21: #endregion 22: }   1: [ExpressionPrefix("SPField")] 2: public class SPFieldExpressionBuilder : SPBaseExpressionBuilder 3: { 4: #region Public static methods 5: public static Object GetValue(String fieldName, PropertyInfo propertyInfo) 6: { 7: Object fieldValue = SPContext.Current.ListItem[fieldName]; 8:  9: fieldValue = Convert(fieldValue, propertyInfo); 10:  11: return (fieldValue); 12: } 13:  14: #endregion 15:  16: #region Public override methods 17: public override Object EvaluateExpression(Object target, BoundPropertyEntry entry, Object parsedData, ExpressionBuilderContext context) 18: { 19: return (GetValue(entry.Expression, entry.PropertyInfo)); 20: } 21: #endregion 22: }   1: [ExpressionPrefix("SPIsInAudience")] 2: public class SPIsInAudienceExpressionBuilder : SPBaseExpressionBuilder 3: { 4: #region Public static methods 5: public static Object GetValue(String audienceName, PropertyInfo info) 6: { 7: Debugger.Break(); 8: audienceName = audienceName.Trim(); 9:  10: if ((audienceName.StartsWith("'") == true) && (audienceName.EndsWith("'") == true)) 11: { 12: audienceName = audienceName.Substring(1, audienceName.Length - 2); 13: } 14:  15: AudienceManager manager = new AudienceManager(); 16: Object value = manager.IsMemberOfAudience(SPControl.GetContextWeb(HttpContext.Current).CurrentUser.LoginName, audienceName); 17:  18: if (info.PropertyType == typeof(String)) 19: { 20: value = value.ToString(); 21: } 22:  23: return(value); 24: } 25:  26: #endregion 27:  28: #region Public override methods 29: public override Object EvaluateExpression(Object target, BoundPropertyEntry entry, Object parsedData, ExpressionBuilderContext context) 30: { 31: return (GetValue(entry.Expression, entry.PropertyInfo)); 32: } 33: #endregion 34: }   1: [ExpressionPrefix("SPIsInGroup")] 2: public class SPIsInGroupExpressionBuilder : SPBaseExpressionBuilder 3: { 4: #region Public static methods 5: public static Object GetValue(String groupName, PropertyInfo info) 6: { 7: groupName = groupName.Trim(); 8:  9: if ((groupName.StartsWith("'") == true) && (groupName.EndsWith("'") == true)) 10: { 11: groupName = groupName.Substring(1, groupName.Length - 2); 12: } 13:  14: Object value = SPControl.GetContextWeb(HttpContext.Current).CurrentUser.Groups.OfType<SPGroup>().Any(x => String.Equals(x.Name, groupName, StringComparison.OrdinalIgnoreCase)); 15:  16: if (info.PropertyType == typeof(String)) 17: { 18: value = value.ToString(); 19: } 20:  21: return(value); 22: } 23:  24: #endregion 25:  26: #region Public override methods 27: public override Object EvaluateExpression(Object target, BoundPropertyEntry entry, Object parsedData, ExpressionBuilderContext context) 28: { 29: return (GetValue(entry.Expression, entry.PropertyInfo)); 30: } 31: #endregion 32: }   1: [ExpressionPrefix("SPProperty")] 2: public class SPPropertyExpressionBuilder : SPBaseExpressionBuilder 3: { 4: #region Public static methods 5: public static Object GetValue(String propertyName, System.Reflection.PropertyInfo propertyInfo) 6: { 7: SPServiceContext serviceContext = SPServiceContext.GetContext(HttpContext.Current); 8: UserProfileManager upm = new UserProfileManager(serviceContext); 9: UserProfile up = upm.GetUserProfile(false); 10: Object propertyValue = (up[propertyName] != null) ? up[propertyName].Value : null; 11:  12: propertyValue = Convert(propertyValue, propertyInfo); 13:  14: return (propertyValue); 15: } 16:  17: #endregion 18:  19: #region Public override methods 20: public override Object EvaluateExpression(Object target, BoundPropertyEntry entry, Object parsedData, ExpressionBuilderContext context) 21: { 22: return (GetValue(entry.Expression, entry.PropertyInfo)); 23: } 24: #endregion 25: }   1: [ExpressionPrefix("SPQueryString")] 2: public class SPQueryStringExpressionBuilder : SPBaseExpressionBuilder 3: { 4: #region Public static methods 5: public static Object GetValue(String parameterName, PropertyInfo propertyInfo) 6: { 7: Object parameterValue = HttpContext.Current.Request.QueryString[parameterName]; 8:  9: parameterValue = Convert(parameterValue, propertyInfo); 10:  11: return (parameterValue); 12: } 13:  14: #endregion 15:  16: #region Public override methods 17: public override Object EvaluateExpression(Object target, BoundPropertyEntry entry, Object parsedData, ExpressionBuilderContext context) 18: { 19: return (GetValue(entry.Expression, entry.PropertyInfo)); 20: } 21: #endregion 22: }   1: [ExpressionPrefix("SPWebProperty")] 2: public class SPWebPropertyExpressionBuilder : SPBaseExpressionBuilder 3: { 4: #region Public static methods 5: public static Object GetValue(String propertyName, PropertyInfo propertyInfo) 6: { 7: Object propertyValue = SPContext.Current.Web.AllProperties[propertyName]; 8:  9: propertyValue = Convert(propertyValue, propertyInfo); 10:  11: return (propertyValue); 12: } 13:  14: #endregion 15:  16: #region Public override methods 17: public override Object EvaluateExpression(Object target, BoundPropertyEntry entry, Object parsedData, ExpressionBuilderContext context) 18: { 19: return (GetValue(entry.Expression, entry.PropertyInfo)); 20: } 21: #endregion 22: } Registration You probably know how to register them, but here it goes again: add this following snippet to your Web.config file, inside the configuration/system.web/compilation/expressionBuilders section: 1: <add expressionPrefix="SPContext" type="MyNamespace.SPContextExpressionBuilder, MyAssembly, Culture=neutral, Version=1.0.0.0, PublicKeyToken=xxx" /> 2: <add expressionPrefix="SPFarmProperty" type="MyNamespace.SPFarmPropertyExpressionBuilder, MyAssembly, Culture=neutral, Version=1.0.0.0, PublicKeyToken=xxx" /> 3: <add expressionPrefix="SPField" type="MyNamespace.SPFieldExpressionBuilder, MyAssembly, Culture=neutral, Version=1.0.0.0, PublicKeyToken=xxx" /> 4: <add expressionPrefix="SPIsInAudience" type="MyNamespace.SPIsInAudienceExpressionBuilder, MyAssembly, Culture=neutral, Version=1.0.0.0, PublicKeyToken=xxx" /> 5: <add expressionPrefix="SPIsInGroup" type="MyNamespace.SPIsInGroupExpressionBuilder, MyAssembly, Culture=neutral, Version=1.0.0.0, PublicKeyToken=xxx" /> 6: <add expressionPrefix="SPProperty" type="MyNamespace.SPPropertyExpressionBuilder, MyAssembly, Culture=neutral, Version=1.0.0.0, PublicKeyToken=xxx" /> 7: <add expressionPrefix="SPQueryString" type="MyNamespace.SPQueryStringExpressionBuilder, MyAssembly, Culture=neutral, Version=1.0.0.0, PublicKeyToken=xxx" /> 8: <add expressionPrefix="SPWebProperty" type="MyNamespace.SPWebPropertyExpressionBuilder, MyAssembly, Culture=neutral, Version=1.0.0.0, PublicKeyToken=xxx" /> I’ll leave it up to you to figure out the best way to deploy this to your server!

    Read the article

  • Oracle UCM 11g

    - by [email protected]
    Ya se ha lanzado la última versión de Oracle UCM11g. Grandes novedades, sobre todo en la arquitectura del producto, nos hacen ser muy optimistas sobre todo después de ver los resultados de rendimiento y escalabilidad obtenidos.El enlace a toda la información sobre el lanzamiento está aquí:Oracle Enterprise Content Management 11gLas novedades más importantes son:Mejor integración en tu entorno de trabajo: Nueva integración del escritorio: los contenidos se manejan usando herramientas estándares de oficina.Gestión de contenidos web en un clic: que permite a los desarrolladores y editores web acceder y actualizar contenido con un solo clic.Más funcionalidad a través de integraciones con otros productos de Oracle. Unificación del stack tecnológico de gestión de contenidosAhora Oracle ECM Suite 11g unifica todos los repositorios de contenido para facilitar su gestión en una única infraestructura.Infraestructura Oracle Fusion Middleware: Oracle ECM Suite 11g se ha trasladado completamente a la plataforma Oracle Fusion Middleware, con todas las aplicaciones soportadas por Oracle WebLogic Server y gestionado con el cuadro de mando Oracle Enterprise Manager. Rendimiento y escalabilidad ExtremosLos datos de los test de rendimiento son espectaculares corriendo en una máquina Exadata.Podéis ver un vídeo del rendimiento aquí: Bueno... 172 millones de documentos por día!!! y 124 páginas por segundo con 2 cpu's... quien quiere ser el primero en probarlo?

    Read the article

< Previous Page | 34 35 36 37 38 39 40 41 42 43 44 45  | Next Page >