Search Results

Search found 6630 results on 266 pages for 'cname record'.

Page 171/266 | < Previous Page | 167 168 169 170 171 172 173 174 175 176 177 178  | Next Page >

  • Use Any() and Count() in Dynamic Linq

    - by ArpanDesai
    I am trying to write dynamic Linq Library query to fetch record on condition, Customers who has order count is greater than 3 and ShipVia field equal 2. Below is my syntax what i have tried. object[] objArr = new object[10]; objArr[0] = 1; IQueryable<Customer> test = db.Customers.Where("Orders.Count(ShipVia=2)", objArr); and IQueryable<Customer> test = db.Customers.Where("Orders.Any(ShipVia=2).Count()", objArr); But both are not working. In second query Any returns true so it won't work with Count. Suggest me a way to implement this.

    Read the article

  • In SQL Server can I insert multiple nodes into XML from a table?

    - by tpower
    I want to generate some XML in a stored procedure based on data in a table. The following insert allows me to add many nodes but they have to be hard-coded or use variables (sql:variable): SET @MyXml.modify(' insert <myNode> {sql:variable("@MyVariable")} </myNode> into (/root[1]) ') So I could loop through each record in my table, put the values I need into variables and execute the above statement. But is there a way I can do this by just combining with a select statement and avoiding the loop? Edit I have used SELECT FOR XML to do similar stuff before but I always find it hard to read when working with a hierarchy of data from multiple tables. I was hoping there would be something using the modify where the XML generated is more explicit and more controllable.

    Read the article

  • IPhone SDK Default NSUserDefaults...

    - by Harry
    I have set up the user defaults to record a integer for a UISlider, the problem is that, if the user has only just installed the app then the integer is zero or NULL. Is there a way to detect if it = NULL with a integer? heres my code i have so far: -(void)awakeFromNib { NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults]; senset = [prefs integerForKey:@"senset"]; senset = sensitivity.value; } - (IBAction) setSens { senset = sensitivity.value; } - (IBAction) goBackopt { { NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults]; [prefs setInteger:senset forKey:@"senset"]; [prefs synchronize]; } } senset is the integer. i have tried this code, and it sets it to 25 on the first time, but then if i try and overwrite it, it wont work and keeps setting it to 25. :( if ( [prefs integerForKey:@"senset"] == NULL ) { senset = 25; } Please help :P Harry

    Read the article

  • Slug ID's with the same name?

    - by James Jeffery
    I want to create slug URL's from a users title in my system. If a user types "The best way's to get slim; period!", then I want the slug to be "the-best-ways-to-get-slim-period". Also, if someone has already created a page with that title I want the slug to be "the-best-ways-to-get-slim-period-1". My question is how can I check the database before a record is created? Ok, obviously I am going to have to perform a check in the database, and then a write. That's 2 queries. Is this the normal way to do it? Also, are there any conventional regular expressions for filtering non alpha/number characters and replacing spaces with hyphens? Any help is much appreciated. Thanks.

    Read the article

  • Call to a phone number through iPhone App

    - by Md. Faisal Rahman
    Hi iPhone developers, I want to add a feature in my iPhone app, the are: call to a phone number in my app play a recorded mp3 voice to that number after call end, relaunch the previous app I know I have to use following code snipt for dialing to a number XXXXXX: [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:XXXXXX"]]; My be play record not worked, as my app will terminate when call dial launch. is there any way to do this? And, after call ended, or call failed will my previous app relaunch? please answer ASAP.

    Read the article

  • problem with creating a new module using vtlib 2.1 for vtiger CRM 5.0.4

    - by gsk
    I have created a new module in vtigerCRM using the vtlib 2.1 api doc as provided in the following link. http://wiki.vtiger.com/index.php/Vtiger_CRM_5_Developer_Guide/VTLIB Though the module appears to have been created successfully I am getting the following error when I try to add a new record. ( ! ) WebServiceException: Permission to perform the operation is denied in C:\xampp\htdocs\dnbcrm\include\Webservices\Retrieve.php on line 30 Call Stack # Time Memory Function Location 1 0.0037 338824 {main}( ) ..\index.php:0 2 0.8090 21393040 include( 'C:\xampp\htdocs\dnbcrm\modules\TargetModule\Save.php' ) ..\index.php:693 3 0.8209 21498512 CRMEntity->save( ) ..\Save.php:21 4 0.9772 23107304 VTEventsManager->triggerEvent( ) ..\CRMEntity.php:859 5 0.9773 23107304 VTEventTrigger->trigger( ) ..\VTEventsManager.inc:118 6 1.0133 23415848 VTWorkflowEventHandler->handleEvent( ) ..\VTEventTrigger.inc:119 7 1.0218 23433280 VTEntityCache->forId( ) ..\VTEventHandler.inc:51 8 1.0218 23433600 VTWorkflowEntity->__construct( ) ..\VTEntityCache.inc:83 9 1.0218 23433992 vtws_retrieve( ) ..\VTEntityCache.inc:16

    Read the article

  • How to mark posts as edited?

    - by user156814
    I would like to have questions marked as "Edited", but I dont know what the best way to do this would be. Users post a question, people answer/comment on the question, and if necessary the user edits/updates the question (just like SO). I would like to note that the user edited the question, but I'm not sure of the best way to do this. I was going to add a last_edited column in the table (because thats all thats really important to me), but I'm not sure if I should just split the edit times (and whatever else) into another table and record everytime the question gets edited.

    Read the article

  • Can JAXB Incrementally Marshall An Object?

    - by Intellectual Tortoise
    I've got a fairly simple, but potentially large structure to serialize. Basically the structure of the XML will be: <simple_wrapper> <main_object_type> <sub_objects> </main_object_type> ... main_object_type repeats up to 5,000 times </simple_wrapper> The main_object_type can have a significant amount of data. On my first 3,500 record extract, I had to give the JVM way more memory than it should need. So, I'd like to write out to disk after each (or a bunch of) main_object_type. I know that setting Marshaller.JAXB_FRAGMENT would allow it fragments, but I loose the outer xml document tags and the <simple_wrapper>. Any suggestions?

    Read the article

  • Creating a specialised view filtering form in Rails

    - by Schroedinger
    G'day guys, I have a current set of data, and I generate multiple analyses of this data (each analysis into its own active record item called a pricing_interval) using a helper function at the moment. Currently to analyse the set of data, you need a start time(using datetime_select) an integer (using text_field) and a name (using text_field) I would like on submission of the form to be redirected to the index page of my pricing_interval, as the values will be re-generated. Manually generating a range proves that my helper methods work. How would I build a form that on submit would send parameters to a function in the form of (date,integer,name) so that it could immediately begin work whilst redirecting the user to server/pricing_intervals Anything at all would help, I've spent hours over the past few days trying to get the rails form syntax working properly to no avail, a really straightforward guide to what I would implement to get this working would be amazingly appreciated. I've looked through the form guides, as I'm not creating an object, but merely parsing params, there's got to be an easy way to do this, right?

    Read the article

  • Conditional Validation with Paperclip difficult

    - by Michael Schmitz
    Hi, I have an "item", which goes through a multi-page creation process. Images are uploaded at step five, and I keep track of the steps by using the attribute "complete". When validating whether an image is attached with paperclip, I get problems using the code below: validates_attachment_presence :pic1, :if => Proc.new { |u| u.complete == "step5"} It seems that I can't access the "complete" attribute, as the active-record object seems to be the paperclip image. Is there a way for me to check at which point in the process I am and validate conditionally? Thanks, Michael

    Read the article

  • Dynamics CRM 4.0 Campaign Response Workflow issue

    - by Brett
    Hi I am pretty novice when it comes to CRM so hopefully someone can help me. I am trying to create a workflow that triggers when the campaign response is set to closed and then updates a few fields within the related 'Customers' record. I would have imagined that this would have been straight forward. However, when creating my workflow it appears that the 'Customer' is not in the related entitities list and therefore I cannot set the fields I require updating. I imagine that the issue is to do with the 'Customer' attribute being similar to the 'To'/'From' attributes on an email/phone call activity, whereas I need the attribute to resemble the 'Regarding' attribute. I presume I could create an attribute to replace 'customer' and apply all the appropriate relationships, but I dont really want to do this. Is there a simple way to get around this and/or am I missing something? Cheers

    Read the article

  • Custom filename in a rolling Log4Net logfile?

    - by Brett Rigby
    Hello We have a ASP .Net application whereby we use Log4Net to log details within the app - nothing new there - and the rolling log filenames are in the usual format of: rolling-log.txt rolling-log.txt.1 rolling-log.txt.2 etc. A each user of the application adds to the logfile, the logfile can be difficult to read for a specific user's case and so, we'd like to modify the config file somehow to record the user's log details individually, each writing to a specific file, e.g. <applicationId>rolling-log.txt <applicationId>rolling-log.txt.1 <applicationId>rolling-log.txt.2 etc. where is each user's unique application Id, made up of a five digit number, e.g. 12345rolling-log.txt Any ideas on the best way to implement this, assuming that it's possible? Cheers Brett

    Read the article

  • Jquery ajax success function returns null?

    - by udaya
    I use the following the jquery statements to call my php controller function, it gets called but my result is not returned to my success function.... function getRecordspage() { $.ajax({ type: "POST", url:"http://localhost/codeigniter_cup_myth/index.php/adminController/mainAccount", data: "{}", contentType: "application/json; charset=utf-8", global:false, async: true, dataType: "json", success: function(result) { alert(result); } }); } My controller method, function mainAccount() { $_SESSION['menu'] = 'finance'; $data['account'] = $this->adminmodel->getaccountDetails(); if(empty($data['account'])) { $data['comment'] = 'No record found !'; } $json = json_encode($data); return $json; } I get the alert(1); in my success function but my alert(result); show null... Any suggestion...

    Read the article

  • Getting AveragePower and PeakPower for a Channel in AVAudioRecorder

    - by Biranchi
    Hi all, I am annoyed with this piece of code. I am trying to get the averagePowerForChannel and peakPowerForChannel while recording Audio, but every time i am getting it as 0.0 Below is my code for recording audio : NSMutableDictionary *recordSetting =[[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithFloat: 22050.0], AVSampleRateKey, [NSNumber numberWithInt: kAudioFormatLinearPCM], AVFormatIDKey, [NSNumber numberWithInt: 1], AVNumberOfChannelsKey, [NSNumber numberWithInt: AVAudioQualityMax], AVEncoderAudioQualityKey, [NSNumber numberWithInt:32],AVLinearPCMBitDepthKey, [NSNumber numberWithBool:NO],AVLinearPCMIsBigEndianKey, [NSNumber numberWithBool:NO],AVLinearPCMIsFloatKey, nil]; recorder1 = [[AVAudioRecorder alloc] initWithURL:[NSURL fileURLWithPath:audioFilePath] settings:recordSetting error:&err]; recorder1.meteringEnabled = YES; recorder1.delegate=self; [recorder1 prepareToRecord]; [recorder1 record]; levelTimer = [NSTimer scheduledTimerWithTimeInterval: 0.3f target: self selector: @selector(levelTimerCallback:) userInfo: nil repeats: YES]; - (void)levelTimerCallback:(NSTimer *)timer { [recorder1 updateMeters]; NSLog(@"Peak Power : %f , %f", [recorder1 peakPowerForChannel:0], [recorder1 peakPowerForChannel:1]); NSLog(@"Average Power : %f , %f", [recorder1 averagePowerForChannel:0], [recorder1 averagePowerForChannel:1]); } What is the error in the code ???

    Read the article

  • How to save many to many fields by using an auto complete text box

    - by iHeartDucks
    If I have two models like class Author(models.Model): name = models.CharField(max_length=100) title = models.CharField(max_length=3, choices=TITLE_CHOICES) birth_date = models.DateField(blank=True, null=True) def __unicode__(self): return self.name class Book(models.Model): name = models.CharField(max_length=100) authors = models.ManyToManyField(Author) I can render the book form using a model form like this class BookForm(ModelForm): class Meta: model = Book widgets = { 'authors' : TextInput() } The authors fields is now rendered as a text box and I want to use an auto complete (where I can enter multiple authors) text box to populate the field. I am having a hard time to understand how I can save the authors in view function? I am thinking of using a hidden field to record all the author id's but I am having a hard time figuring out how to save it on the postback.

    Read the article

  • rails - named scoped help

    - by sameera207
    Hi All, I want to write a named scoped to get a record from its id. Ex: I have a model called Event and its same as doing Event.find(id) (I dont want to use find inside my controller and I want my controller to use a named scoped (for future flexibility)) So I have written a named scoped named_scope :from_id, lambda { |id| {:conditions = ['id= ?', id] } } and I'm calling it from my controller like Event.from_id(id) But my problems is it returns Event object array not only one object Ex: if I want to get event name I have to write event = Event.from_id(id) event[0].name instead I want to write event = Event.from_id(id) event.name Am I doing something wrong here.. thanks in advance cheers sameera

    Read the article

  • mySQL date range problem

    - by StealthRT
    Hey all i am in need of a little help with figuring out how to get a range of days for my select query. Here is the code i am trying out: select id, idNumber, theDateStart, theDateEnd from clients WHERE idNumber = '010203' AND theDateStart >= '2010-04-09' AND theDateEnd <= '2010-04-09'; This is what the data in the table looks like: TheDateStart = 2010-04-09 TheDateEnd = 2010-04-11 When testing that code above, it does not populate anything. If i take out the TheEndDate, it populates but with some other tables data as well which it should not do (it should only get one record). I know the problem is within the two date's. I'm not sure how to go about getting a date range for theDateStart and theDateEnd since if someone tries it, say, on 2010-04-10, it still needs to know its within rage of the 2010-04-09 - 2010-04-11. But right now, it does not... Any help would be great! :o) David

    Read the article

  • Suggest me solution to track the change in test DB and replicate in Another DB

    - by Parth
    Suggest me solution to track the change in test DB and replicate in Another DB... My Client need a script or any solution, if he has two Database, One Test DB in which he tests his data on test portal and if he find it appropriate he can use those changes to be done in main DB to display on Live site.. Fior this he needs the solution to record or track all updation/deletion/insertion, so that he can do the same in main DB if found appropriate, ** NOTE: ** we hav only on server, no separate server, hence binary log replication doesnt seems to be working for my case...

    Read the article

  • J2ME Camera and Sound Recorder Access On A Windows Mobile

    - by Steven Knox
    I'm currently involved in a research project that requires me to access a Windows Mobile Camera and sound recorder with J2ME to, well take pictures and record sound... the phone has to be a windows mobile for some reason that has nothing to do with me and the software has to be written in Java, also not my decision. So I need to try and find a phone that supports this (if one exists) so I'd like to know if anyone has found one? Thank You For Your Help. (Note the phone supporting MMAPI (JSR 135) does not imply that you can use the camera and sound recorder, our current phone has this and has not access).

    Read the article

  • How to prevent HTTP 304 in Django test server

    - by Augusto Men
    I have a couple of projects in Django and alternate between one and another every now and then. All of them have a /media/ path, which is served by django.views.static.serve, and they all have a /media/css/base.css file. The problem is, whenever I run one project, the requests to base.css return an HTTP 304 (not modified), probably because the timestamp hasn't changed. But when I run the other project, the same 304 is returned, making the browser use the file cached by the previous project (and therefore, using the wrong stylesheet). Just for the record, here are the middleware classes: MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.middleware.transaction.TransactionMiddleware', ) I always use the default address http://localhost:8000. Is there another solution (other than using different ports - 8001, 8002, etc.)?

    Read the article

  • How to retain the values of the filters and its result using asp.net c#?

    - by user144842
    Question:- Page is a typical search page with few filters on it. When search for records based on filters, it shows result in Gridview. From grid view records, user can click on any record to see the details which takes the focus on new page. Its working fine so far. Now when user comes back from details page to search page. I am loosing selected filters values and no result in grid view. How can i display selected filters and its results in gridview when user is coming back on search page? Any example etc.? FYI, I am using sessions to pass parameters to the ObjectDatasource.

    Read the article

  • A function's static and dynamic parent

    - by legends2k
    I'm reading Thinking in C++ (vol. 2): Whenever a function is called, information about that function is pushed onto the runtime stack in an activation record instance (ARI), also called a stack frame. A typical stack frame contains (1) the address of the calling function (so execution can return to it), (2) a pointer to the ARI of the function’s static parent (the scope that lexically contains the called function, so variables global to the function can be accessed), and (3) a pointer to the function that called it (its dynamic parent). The path that logically results from repetitively following the dynamic parent links is the dynamic chain, or call chain I'm unable to comprehend what the author means as function's static and dynamic parent. Also am not able to differentiate between item 1, 2 or 3. They all seem to be the same. Can someone please explain this passage to me?

    Read the article

  • Does ActiveRecord make Ruby on Rails code hard to test?

    - by Erik Öjebo
    I've spent most of my time in statically typed languages (primarily C#). I have some bad experiences with the Active Record pattern and unit testing, because of the static methods and the mix of entities and data access code. Since the Ruby community probably is the most test driven of the communities out there, and the Rails ActiveRecord seems popular, there must be some way of combining TDD and ActiveRecord based code in Ruby on Rails. I would guess that the problem goes away in dynamic languages, somehow, but I don't see how. So, what's the trick?

    Read the article

  • Kink detection in drawn polylines

    - by David Rutten
    Users can sketch in my app using a very simple tool (move mouse while holding LMB). This results in a series of mousemove events and I record the cursor location at each event. The resulting polyline curve tends to be rather dense, with recorded points almost every other pixel. I'd like to smooth this pixelated polyline, but I don't want to smooth intended kinks. So how do I figure out where the kinks are? The image shows the recorded trail (red pixels) and the 'implied' shape as a human would understand it. People tend to slow down near corners, so there is usually even more noise here than on the straight bits.

    Read the article

  • MS SQL Return 1 Row Per Boat

    - by Tyler
    Basically, what I want to do is join 4 tables together and return 1 row for each boat. Table Layouts [Boats] id, date, section, raft [Photos] id, boatid, pthurl, purl [River_Company] id, sort, company, company_short [River_Section] id, section Its very simple as far as structure, however, I've having the time of my life trying to get it to return only 1 row. No boat will ever be on the same day, the only thing that's messing this up is the photo table. If you know a better way for it to return the record table for all the boats boats and only 1 photo from the photo table, please, please post it!!

    Read the article

< Previous Page | 167 168 169 170 171 172 173 174 175 176 177 178  | Next Page >