Search Results

Search found 45031 results on 1802 pages for 'same name'.

Page 61/1802 | < Previous Page | 57 58 59 60 61 62 63 64 65 66 67 68  | Next Page >

  • Echoing users by group name in PHP

    - by BobSapp
    What I want to do is click a name of a group(every group what I create other than poweruser and admin groups) and that will echo all of the users in that group from the database. I have figured out the code so far but now my problem is how will I print it all out when clicking the name of the group? My code so far is: <h3>Groups</h3> <?php include('db.php'); if (isset($_GET["groupID"])) { $sql="SELECT `group`.*, `user`.* FROM `user` inner join `group` on group.groupID=user.groupID where group.groupID= " . mysql_real_escape_string($_GET["groupID"]) ; } else { $sql="SELECT * FROM `group` WHERE groupName <> 'admin' AND groupName <> 'poweruser'" ; } $result=mysql_query($sql,$connection); while($line=mysql_fetch_array($result)){ echo "<a href='index.php?page=groups&group=".$line['groupID']."'>".$line['groupName'].'</a><br />'; } mysql_free_result($result); mysql_close($connection); ?>

    Read the article

  • Locking database edit by key name

    - by Will Glass
    I need to prevent simultaneous edits to a database field. Users are executing a push operation on a structured data field, so I want to sequence the operations, not simply ignore one edit and take the second. Essentially I want to do synchronized(key name) { push value onto the database field } and set up the synchronized item so that only one operation on "key name" will occur at a time. (note: I'm simplifying, it's not always a simple push). A crude way to do this would be a global synchronization, but that bottlenecks the entire app. All I need to do is sequence two simultaneous writes with the same key, which is rare but annoying occurrence. This is a web-based java app, written with Spring (and using JPA/MySQL). The operation is triggered by a user web service call. (the root cause is when a user sends two simultaneous http requests with the same key). I've glanced through the Doug Lea/Josh Bloch/et al Concurrency in Action, but don't see an obvious solution. Still, this seems simple enough I feel there must be an elegant way to do this.

    Read the article

  • FluentNHibernate error -- "Invalid object name"

    - by goober
    I'm attempting to do the most simple of mappings with FluentNHibernate & Sql2005. Basically, I have a database table called "sv_Categories". I'd like to add a category, setting the ID automatically, and adding the userid and title supplied. Database table layout: CategoryID -- int -- not-null, primary key, auto-incrementing UserID -- uniqueidentifier -- not null Title -- varchar(50) -- not null Simple. My SessionFactory code (which works, as far as I can tell): _SessionFactory = Fluently.Configure().Database( MsSqlConfiguration.MsSql2005 .ConnectionString(c => c.FromConnectionStringWithKey("SVTest"))) .Mappings(x => x.FluentMappings.AddFromAssemblyOf<CategoryMap>()) .BuildSessionFactory(); My ClassMap code: public class CategoryMap : ClassMap<Category> { public CategoryMap() { Id(x => x.ID).Column("CategoryID").Unique(); Map(x => x.Title).Column("Title").Not.Nullable(); Map(x => x.UserID).Column("UserID").Not.Nullable(); } } My Class code: public class Category { public virtual int ID { get; private set; } public virtual string Title { get; set; } public virtual Guid UserID { get; set; } public Category() { // do nothing } } And the page where I save the object: public void Add(Category catToAdd) { using (ISession session = SessionProvider.GetSession()) { using (ITransaction Transaction = session.BeginTransaction()) { session.Save(catToAdd); Transaction.Commit(); } } } I receive the error Invalid object name 'Category'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Invalid object name 'Category'. I think it might be that I haven't told the CategoryMap class to use the "sv_Categories" table, but I'm not sure how to do that. Any help would be appreciated. Thanks!

    Read the article

  • Using resources with the same name in Xcode

    - by Roberto
    Is there a way to add multiple resources with the same name to an Xcode project and have 1 of them take priority over the others? Example: I added 2 files, both called icon.png, to an Xcode project. They are on different folders in the file system (Folder1/icon.png and Folder2/icon.png) and on different groups in Xcode. Is there a way to tell Xcode to have Folder2/icon.png take priority over Folder1/icon.png? And if only 1 icon.png exists, then use that one. Thanks. EDIT (2010-12-23): You can have multiple files with the same name in an Xcode project even if they are not in separate folder references, but they are in separate groups. Once compiled, the app bundle (which will be flat with no folders in it), will only have one copy of the file (icon.png). How do you pick which copy of the file to use? I was told that you can do this for BlackBerry. It works something like this: The compiler will go down the list of files in the project and start adding them to the app bundle. If it sees a duplicate, it will overwrite it (or not), so the files at the bottom (or at the top) will have higher precedence and will be the final bundle.

    Read the article

  • PHP Pass Dynamic Array name to function

    - by Brad
    How do I pass an array key to a function to pull up the right key's data? // The array <?php $var['TEST1'] = Array ( 'Description' => 'This is a Description', 'Version' => '1.11', 'fields' => Array( 'ID' => array( 'type' => 'int', 'length' =>'11', 'misc' =>'auto_increment' ), 'DATA' => array( 'type' => 'varchar', ' length' => '255' ) ); $var['TEST2'] = Array ( 'Description' =? 'This is the 2nd Description', 'Version' => '2.1', 'fields' => Array( 'ID' => array( 'type' => 'int', 'length' =>'11', 'misc' =>'auto_increment' ), 'DATA' => array( 'type' => 'varchar', ' length' => '255' ) ) // The function <?php $obj = 'TEST1'; print_r($schema[$obj]); // <-- Fives me output. But calling the function doesn't. echo buildStructure($obj); /** * @TODO to add auto_inc support */ function buildStructure($obj) { $output = ''; $primaryKey = $schema["{$obj}"]['primary key']; foreach ($schema["{$obj}"]['fields'] as $name => $tag) // #### ERROR #### Invalid argument supplied for foreach() { $type = $tag['type']; $length = $tag['length']; $default = $tag['default']; $description = $tag['description']; $length = (isset($length)) ? "({$length})" : ''; $default = ($default == NULL ) ? "NULL" : $default; $output .= "`{$name}` {$type}{$length} DEFAULT {$default} COMMENT `{$DESCRIPTION}`, "; } return $output; }

    Read the article

  • REST design: what verb and resource name to use for a filtering service

    - by kabaros
    I am developing a cleanup/filtering service that has a method that receives a list of objects serialized in xml, and apply some filtering rules to return a subset of those objects. In a REST-ful service, what verb shall I use for such a method? I thought that GET is a natural choice, but I have to put the serialized XML in the body of the request which works but feels incorrect. The other verbs don't seem to fit semantically. What is a good way to define that Service interface? Naming the resource /Cleanup or /Filter seems weird mainly because in the examples I see online, it is always a name rather than a verb being used for resource name. Am I right to feel that REST services are better suited for CRUD operations and you start bending the rules in situations like this service? If yes, am I then making a wrong architectural choice. I've pushed to develop this service in REST-ful style (as opposed to SOAP) for simplicity, but such awkward cases happen a lot and make me feel like I am missing something. Either choosing REST where it shouldn't be used or may be over-thinking some stuff that doesn't really matter? In that case, what really matters?

    Read the article

  • Does implementing a Java class under an open-source library's package name constitutes a modificatio

    - by Minyu
    Greetings, I understand that this is not the best forum for getting legal advices. But I am still wondering if anybody has some experience around this topic, or can point me to relevant resources that explain it. I have tried to search it online but could not find clear answers. Assuming I am using a Java open-source library from "somecompany", specifically its entities in the "org.somecompany.somepackage". During development, I found that I need to access some of the internals of that package that are not exposed through its public interface. So I thought maybe creating my own classes under the same "org.somecompany.somepackage" name would make that easier. My question is: does this constitutes a modification of the open-source library? The fully qualified name of my classes look like "org.somecompany.somepackage.myclass". It does seem an "extension" of the original library, even though I am not modifying the original library source or binary. I am also not adding my classes to the open-source jar files. Any advice or pointer to resources will be appreciated!

    Read the article

  • Is there a faster method to match an arbitrary String to month name in Java

    - by jonc
    Hello, I want to determine if a string is the name of a month and I want to do it relatively quickly. The function that is currently stuck in my brain is something like: boolean isaMonth( String str ) { String[] months = DateFormatSymbols.getInstance().getMonths(); String[] shortMonths = DateFormatSymbols.getInstance().getShortMonths(); int i; for( i = 0; i<months.length(); ++i;) { if( months[i].equals(str) ) return true; if( shortMonths[i].equals(str ) return true; } return false; } However, I will be processing lots of text, passed one string at a time to this function, and most of the time I will be getting the worst case of going through the entire loop and returning false. I saw another question that talked about a Regex to match a month name and a year which could be adapted for this situation. Would the Regex be faster? Is there any other solution that might be faster?

    Read the article

  • Preserve name of file using cURL to transfer files

    - by Toby
    I'm transferring files from an existing http request using cURL like so... $postargs = array( 'nonfilefield' =>'nonfilevalue', 'fileentry' => '@'.$_FILES['thefile']['tmp_name'][0] ); $ch = curl_init('http://localhost/curl/rec.php'); curl_setopt($ch,CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); curl_setopt($ch,CURLOPT_RETURNTRANSFER, true); curl_setopt($ch,CURLOPT_POST,TRUE); curl_setopt($ch,CURLOPT_POSTFIELDS,$postargs); curl_exec($ch); curl_close($ch); The only way I can get this to work is using the tmp_name, without this it won't send. However, I then lose the name value for when I want to name the file later. Is there some way to do this preserving the $_FILES array as it normally would be without curl? I'm also using an array of file fields in my script, so at the moment I have to convert my multidimensional array into a single dimension for this to work

    Read the article

  • Determining an object's variable name dynamically?

    - by ZenBlender
    Let's say I have some objects: ArrayList<SomeObject> list = new ArrayList<SomeObject>(); SomeObject A = new SomeObject(); SomeObject B = new SomeObject(); SomeObject C = new SomeObject(); SomeObject D = new SomeObject(); These constructors automatically add each object to the ArrayList so I can iterate over them but still maintain the variable names for direct access: public SomeObject(){ // init stuff here list.add(this); } But then, let's say I want to output some debug info, and iterate through list and print out the NAME of each object? How can I do that? Essentially, when "SomeObject A = new SomeObject();" is executed, I want to use reflection (if possible) to determine that this variable's name is "A" (a String) and either store that in the object when the constructor executes, or determine it dynamically through reflection when referencing this object with the variable named "A". Does that make sense? How can I do this? Thanks!

    Read the article

  • PHP OOP class Sensative To Counter field name !

    - by Mac Taylor
    hey guys recently i managed to write a class for my stories , and everything is fine , unless counter field that stores page's hits here is my class : class nk_posts { var $data = array(); public function _data() { global $db; $result = $db->sql_query(" SELECT bt_stories.*, bt_tags.*, bt_topics.*, group_concat(DISTINCT bt_tags.tag ) as mytags, group_concat(DISTINCT bt_topics.topicname ) as mytopics FROM bt_stories,bt_tags,bt_topics WHERE CONCAT( ' ', bt_stories.tags, ' ' ) LIKE CONCAT( '%', bt_tags.tid, '%' ) AND CONCAT( ' ', bt_stories.associated, ' ' ) LIKE CONCAT( '%', bt_topics.topicid, '%' ) AND time<=now() AND section='news' AND approved='1' GROUP BY bt_stories.sid ORDER BY bt_stories.sid DESC "); while ($this->data = $db->sql_fetchrow($result)) { $this->sid = $this->data['sid']; $this->title = $this->data['title']; $this->counter = $this->data['counter']; //------Rest of Fields ------ $this->_output(); } } public function _output() { themeindex( $this->sid, $this->title, $this->counter, //------Rest of Fields ------ ); } } problem this class can't show counter filed value , but if i change counter field name to other thing like hit , .. everything goes fine im sure its okay if i write it in normal php mysql way , but i need this to be in OOP way any comment why it's sensitive to counter field name ?!

    Read the article

  • How to convert a string to variable name

    - by p1xelarchitect
    I'm loading several external JSON files and want to check if they have been successfully cached before the the next screen is displayed. My strategy is to check the name of the array to see if it an object. My code works perfectly when I check only a single array and hard code the array name into my function. My question is: how can i make this dynamic? not dynamic: (this works) $("document").ready(){ checkJSON("nav_items"); } function checkJSON(){ if(typeof nav_items == "object"){ // success... } } dynamic: (this doesn't work) $("document").ready(){ checkJSON("nav_items"); checkJSON("foo_items"); checkJSON("bar_items"); } function checkJSON(item){ if(typeof item == "object"){ // success... } } here is the a larger context of my code: var loadAttempts = 0; var reloadTimer = false; $("document").ready(){ checkJSON("nav_items"); } function checkJSON(item){ loadAttempts++; //if nav_items exists if(typeof nav_items == "object"){ //if a timer is running, kill it if(reloadTimer != false){ clearInterval(reloadTimer); reloadTimer = false; } console.log("found!!"); console.log(nav_items[1]); loadAttempts = 0; //reset // load next screen.... } //if nav_items does not yet exist, try 5 times, then give up! else { //set a timer if(reloadTimer == false){ reloadTimer = setInterval(function(){checkJSON(nav_items)},300); console.log(item + " not found. Attempts: " + loadAttempts ); } else { if(loadAttempts <= 5){ console.log(item + " not found. Attempts: " + loadAttempts ); } else { clearInterval(reloadTimer); reloadTimer = false; console.log("Giving up on " + item + "!!"); } } } }

    Read the article

  • Java servlet's request parameter's name set to entire json object

    - by Geren White
    I'm sending a json object through ajax to a java servlet. The json object is key-value type with three keys that point to arrays and a key that points to a single string. I build it in javascript like this: var jsonObject = {"arrayOne": arrayOne, "arrayTwo": arrayTwo, "arrayThree": arrThree, "string": stringVar}; I then send it to a java servlet using ajax as follows: httpRequest.open('POST', url, true); httpRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); httpRequest.setRequestHeader("Connection", "close"); var jsonString = jsonObject.toJSONString(); httpRequest.send(jsonString); This will send the string to my servlet, but It isn't showing as I expect it to. The whole json string gets set to the name of one of my request's parameters. So in my servlet if I do request.getParameterNames(); It will return an enumeration with one of the table entries' key's to be the entire object contents. I may be mistaken, but my thought was that it should set each key to a different parameter name. So I should have 4 parameters, arrayOne, arrayTwo, arrayThree, and string. Am I doing something wrong or is my thinking off here? Any help is appreciated. Thanks

    Read the article

  • How would I / could I obtain an reasonably comprehensive list of domain names?

    - by Simon
    I know that domain names are constantly changing, and I know there are a lot of them, but there is clearly a region of the domain name space which is stable. How would I go about getting a list, even a very big one? Such a thing must logically exist, even if it is in a distributed form, because the web's DNS servers resolve names to IP addresses. So in theory if I could poll all the DNS servers in the world at a moment in time I would have the complete list of mapped names. Is there a practical way of doing that? As an aside, does anyone have any good estimates of how many domain names exist at the moment?

    Read the article

  • ASP.NET MVC and ApplicationPath

    - by user93422
    Question is about paths and domains: I have an out-of-the box ASP.NET MVC project (generated by "File-New Project"). On LogOn page it does: return Redirect("~/Account/LogOn");. I have a domain name: mycompany.com, and following file structure on the server: /Root /MyApp (this is where my app goes into) Default.aspx ... I have set up following domain pointer: mycompany.com -> \MyApp When I go to mycompany.com I get an error, something about can't find mycompany.com/MyApp/MyApp/Account/LogOn Question: Where does second /MyApp path element comes from? Note: If I don't use domain pointer and deploy the site to the root - everything works just fine. Note: My hosting provider is webhost4life.com.

    Read the article

  • What is the easiest way to get the primary groupName from AD in C#?

    - by madhatter84gn
    I am currently using PrincipalContext and UserPrincipal to return the users primary groupid. How can I take this id and find the actual group name? Also I have code that works correctly to assign the user's primary group, but once I assign them to the group I can not delete them from Domain Users which is the default primary group prior to my change. I have called Save() before trying to remove the domain users group. My requirements state I must add the user to AD then assign their primary group and then remove them as a member of Domain Users.

    Read the article

  • DNS settings for resolving Host name to IP not working?

    - by Hasas Ali Khan
    I want to access my IIS hosted application over LAN. First I installed a DNS server. The DNS configuration steps are: Go to DNS Manager - right click on System Name - click on configure a DNS Server. DNS Server wizard open -, click on next button - Select radio button "forward lookup zone" click on next button. In the second window. click on radio button "The server maintains the zone" and then click next. Give the zone name "example.com" Click on radio button, "Do Not allow dynamic updates". and then click next button. In the next window, click on radio button "No it should not forward query" and then click next button. Complete the configure a DNS server wizard and then click on finish button. After it is managing the DNS records: In DNS server wizard. open tree of forward lookup zone and right click on the new zone name "example.com" - properties and click on "Start of authority" and write values on text boxes serial number=1 primary server=systemname.domainname responsible person=hostmaster.domainname Click on server name, highlight domain name, click on edit button and enter IP address of the server where I host my application. Highlight new zone name and right click on it and click "New Host" option. In this window there are three text boxes: Name(user parent name if blank)=scoring Fully Qualified Domain Name=scoring.example.com IP Address= My IP Address and check on "Create associated pointer(PTR) record" and click on "Add Host" Host button and then click done button. I have host header for my application is "scoring" on port 80 and its working fine on server my application setting are I have change its, Advance setting --> Application Pool Identity --> Local System application can access on server with host name "scoring" but it can not access on machines on LAN. When I change LAN machine host file that is under, C:/windows/system32/driver/etc/host and edit it and enter host name with hosted machine IP like this: scoring 192.168.1.20 By making these changes I can run the application over LAN machines as I mentioned above DNS setting by which I can run App over LAN with out editing the client's host file. What mistake am I doing in this configuration?

    Read the article

  • How does AssemblyName.ReferenceMatchesDefinition work?

    - by Fabian Schmied
    Given the following code: var n1 = new AssemblyName ("TestDll, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=b77a5c561934e089"); var n2 = new AssemblyName ("TestDll, Version=2.0.0.2001, Culture=en-US, PublicKeyToken=ab7a5c561934e089"); Console.WriteLine (AssemblyName.ReferenceMatchesDefinition (n1, n2)); Console.WriteLine (AssemblyName.ReferenceMatchesDefinition (n2, n1)); Why do both of these checks print "True"? I would have thought that AssemblyName.ReferenceMatchesDefinition should consider differences in the version, culture, and public key token attributes of an assembly name, shouldn't they? If not, what does ReferenceMatchesDefinition do that a comparison of the simple names doesn't?

    Read the article

  • How to get physical partition name from iSCSI details on Windows?

    - by Barry Kelly
    I've got a piece of software that needs the name of a partition in \Device\Harddisk2\Partition1 style, as shown e.g. in WinObj. I want to get this partition name from details of the iSCSI connection that underlies the partition. The trouble is that disk order is not fixed - depending on what devices are connected and initialized in what order, it can move around. So suppose I have the portal name (DNS of the iSCSI target), target IQN, etc. I'd like to somehow discover which volumes in the system relate to it, in an automated fashion. I can write some PowerShell WMI queries that get somewhat close to the desired info: PS> get-wmiobject -class Win32_DiskPartition NumberOfBlocks : 204800 BootPartition : True Name : Disk #0, Partition #0 PrimaryPartition : True Size : 104857600 Index : 0 ... From the Name here, I think I can fabricate the corresponding name by adding 1 to the partition number: \Device\Harddisk0\Partition1 - Partition0 appears to be a fake partition mapping to the whole disk. But the above doesn't have enough information to map to the underlying physical device, unless I take a guess based on exact size matching. I can get some info on SCSI devices, but it's not helpful in joining things up (iSCSI target is Nexenta/Solaris COMSTAR): PS> get-wmiobject -class Win32_SCSIControllerDevice __GENUS : 2 __CLASS : Win32_SCSIControllerDevice ... Antecedent : \\COBRA\root\cimv2:Win32_SCSIController.DeviceID="ROOT\\ISCSIPRT\\0000" Dependent : \\COBRA\root\cimv2:Win32_PnPEntity.DeviceID="SCSI\\DISK&VEN_NEXENTA&PROD_COMSTAR... Similarly, I can run queries like these: PS> get-wmiobject -namespace ROOT\WMI -class MSiSCSIInitiator_TargetClass PS> get-wmiobject -namespace ROOT\WMI -class MSiSCSIInitiator_PersistentDevices These guys return information relating to my iSCSI target name and the GUID volume name respectively (a volume name like \\?\Volume{guid-goes-here}), but the GUID volume name is no good to me, and there doesn't appear to be a reliable correspondence between the target name and the volume that I can join on. I simply can't find an easy way of getting from an IQN (e.g. iqn.1992-01.com.example:storage:diskarrays-sn-a8675309) to physical partitions mapped from that target. The way I do it by hand? I start Disk Management, and look for a partition of the correct size, verify that its driver says NEXENTA COMSTAR, and look at the disk number. But even this is unreliable if I have multiple iSCSI volumes of the exact same size. Any suggestions?

    Read the article

  • How can I change the filename of a shared library after building a program that depends on it?

    - by ZorbaTHut
    I have a program that depends on a shared library it expects to find deep inside a directory structure. I'd like to move that shared library out and into a better place. On OS X, this can be done with install_name_tool. I'm unable to find an equivalent for Linux. For reference, readelf -d myprogram spits out the following paraphrased output: Dynamic section at offset 0x1e9ed4 contains 30 entries: Tag Type Name/Value 0x00000001 (NEEDED) Shared library: [this/is/terrible/library.so] 0x00000001 (NEEDED) Shared library: [libGL.so.1] 0x00000001 (NEEDED) Shared library: [libGLU.so.1] 0x00000001 (NEEDED) Shared library: [libstdc++.so.6] and I would like to errata "this/is/terrible/library.so" to be "shared/library.so". I know about RPATH and it isn't what I'm looking for, I don't need to change search paths globally.

    Read the article

  • "StartTag: invalid element name" in default.aspx

    - by Epaga
    (Warning - asp newbie) I have an aspx file with the tag <%@ Page Language=VB ... %> right at the beginning of the file. When calling this from my IIS server (http://localhost/myservice/default.aspx), this gives me the error This page contains the following errors: error on line 1 at column 2: StartTag: invalid element name Below is a rendering of the page up to the first error. What am I doing wrong?

    Read the article

  • Magento - Fatal error: Class name must be a valid object or a string

    - by Jason Millward
    I'm having a problem with a Magento installation that I hope someone can help me with. I suddenly started getting the following error message when I accessed the site: Fatal error: Class name must be a valid object or a string in /app/code/core/Mage/Core/Model/Resource.php on line 215 I've searched for someone with a similar issue but not had any luck so i'm stuck and really need to get this resolved Can anyone help?

    Read the article

  • Error code:-2147467259 Error code name:failed Java desktop application Cristal Report XI

    - by maverick-f14
    Hi guys, I'm trying to run Java_JRC_Desktop_View_Report_and_set_database_logon downloaded from this link: http://www.sdn.sap.com/irj/boc/index?rid=/library/uuid/d0d6f979-3e11-2c10-35a8-ac93994a30ed but at runtime my java desktop application throws this Exception: com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: org/apache/log4j/Logger---- Error code:-2147467259 Error code name:failed From what depends? thx all.

    Read the article

  • There is no SDK with the name or path 'iphoneos2.0'

    - by user322290
    Hi I have spent endless hours trying to solve this but with no luck, please help! I keep getting this error. There is no SDK with the name or path 'iphoneos2.0' I am running some templates at http://appsamuck.com/day1.html Thanks Gautam I'm running the latest sdk, in the pop up menu (simulator) there is an option iPhone Device 2.0 (missing) (Base SDK)

    Read the article

< Previous Page | 57 58 59 60 61 62 63 64 65 66 67 68  | Next Page >