Search Results

Search found 6502 results on 261 pages for 'dont reinvent the wheel'.

Page 196/261 | < Previous Page | 192 193 194 195 196 197 198 199 200 201 202 203  | Next Page >

  • How to get last 12 digits from a string in MySQL?

    - by Nick Gorbikoff
    Hello. How would I get last 12 digits of a string using mysql? Let's say I have a varchar field with a tracking number, that may be anywhere from 5 to 20 varchars long. But I only need to select last 12 digits or less if there are less. so in a field = 12345678123456789012 I would only need to get what's in brackets field = 12345678[123456789012] I saw a few examples using mid, etc, but they dont' produce the desired result or I can't find an example that makes sense :-( Thank you.

    Read the article

  • SSAS Reporting Services - Set specific language / translation

    - by Chris
    Hi all, in the data warehouse there's a default language for the measures, and I added a translation for German captions. In a Visual Studio Report Server project, when creating a query with my German OS, the cube and its measures are displayed in German language. When dragging measures to the mdx query windows, the default measure name is used. That's what I want and what I expect, since when writing MDX queries I would like to use the default measure names. But when executing the query, the columns created for each measure is translated to German again. This resuls in having German columns names within my dataset, which I dont want. I'd like to have the english column names. I already tried to change the connection string to: Data Source=server;Initial Catalog=DataWarehouse;LocaleIdentifier=1033 But that doesn't help, I still see German translations. Anyone knows how to set a specific translation?

    Read the article

  • C++ code generation for repeted task

    - by sateesh
    Hi, I have something like below which will get repeated many times based on the function that get called for e.g acceptfunction() { inserter["quantity"] = sdd.getfloat(quantity); inserter["prodtype"] = sdd.getstring(prodtype); : : so on } Like accept above there are 20 more functions(reject,cancel etc) which will do the similar thing.But the parameteres they insert can differ based on function called. How can I automate this kind of code.So that I dont need to write new function from scratch.Basically what I need is if i provide parametres like ("quantity",prodtype) through some text file or xml, it should generate the required function with the input parametres. Is this task can be handled through C++ tempalte Meta programming or someother code generation tool will help me to do this?

    Read the article

  • PHP how to send email basic

    - by user329394
    hi all, im using PHP tu send email from my localhost to other people. can tell me what should i need to do that? for eg should i need to install mailserver? If im not mistaken theres is a language that u dont need a mailsever to send email. is it right? inside the PHP.ini, there are [mail function] how to configure this? i checked on the net, but not really understand how it works. [mail function] ; For Win32 only. SMTP = localhost smtp_port = 25 sendmail_from [email protected] //not sure how to write this?

    Read the article

  • Scraping non-absolute URL

    - by cooldude
    I am trying to scrape www.weather.bm. I want all 10 radar images, but I can only get one (the image updates regularly) and it's not a absolute image url. I was hoping I could use the image as a image slideshow like the link but dont know how. Also, how can I remove images/Radarlegend.png? I just need the radar images. Here is my code: include('simple_html_dom.php'); $html = file_get_html('http://www.weather.bm/radarMobile.asp'); foreach($html->find('img') as $element) echo $element->src . '<br>' My output is: <div id="main"> images/Radar/CurrentRadarAnimation_100km_sri/100km_sri-radar-2011-01-04-1556.jpg<br>images/Radarlegend.png<br></div> </div>

    Read the article

  • How to prevent users from inputting letters or numbers ?

    - by ZaZu
    Hello, I have a simple problem; Here is the code : #include<stdio.h> main(){ int input; printf("Choose a numeric value"); scanf("%d",&input); } I want the user to only enter numbers ... So it has to be something like this : #include<stdio.h> main(){ int input; printf("Choose a numeric value"); do{ scanf("%d",&input); }while(input!= 'something'); } My problem is that I dont know what to replace in 'something' ... How can I prevent users from inputting alphabetic characters ? Thanks for your help ! }

    Read the article

  • bash script to find/grep particular string in xml files in particular folders

    - by user3702188
    i have a problem at work, where i need to simplify the process how i searrh for logs. I would like to ask for help from experts here. We have different services for every channel. The structure is following: - root/channel_1/service_1/2014-05-21/file_54544654541.xml - root/channel_1/server2_2/2014-05-20/file_74272172.xml - root/channel_1/service_3/2014-05-22/file_45456546.xml - root/channel_2/service_4/2014-05-23/file_78754456.xml - root/channel_2/service_5/2014-05-24/file_546546546.xml my main problem is to find particular string in these xml files. Lets say, i know the channel name but i dont know the service name under which my particular string should be present. Also i know the date. So in search i want to enter the channel name the date and string. The search would be going via all service folders and looking for string only in all xml files under particular date folder and particular channel. any ideas for quickest and easiest solution to achieve this? Either by bash or perl? Any help would be appreciated thanks

    Read the article

  • c# How to make linq master detail query for 0..n relationship?

    - by JK
    Given a classic DB structure of Orders has zero or more OrderLines and OrderLine has exactly one Product, how do I write a linq query to express this? The output would be OrderNumber - OrderLine - Product Name Order-1 null null // (this order has no lines) Order-2 1 Red widget I tried this query but is not getting the orders with no lines var model = (from po in Orders from line in po.OrderLines select new { OrderNumber = po.Id, OrderLine = line.LineNumber, ProductName = line.Product.ProductDescription, } ) I think that the 2nd from is limiting the query to only those that have OrderLines, but I dont know another way to express it. LINQ is very non-obvious if you ask me!

    Read the article

  • JPA @version - can it be used to calcualate version of a table entry

    - by OpenSource
    Hi, Please consider the following table (created using a corresponding entity) request ------- id requestor type version items 1 a t1 1 5 2 a t1 2 3 3 b t1 1 2 4 a t2 1 4 5 a t1 3 9 The above is what I want to achieve. The version field is a calculated field others are user provided. Basically the request's version needs to be calculated based on the combination of requestor and the type. The first occurance with a given combination will have a version 1 then version 2 and so on. I tried various things using @version on a different entity with just the three columns and joining the two entities using ManytoOne etc but I'm not able to get to the desired outcome. I dont want to confuse you with the things I tried. Since the objective is simple there should be an easier way I suppose? Can you please help? - any help greatly appreciated! thanks in advance

    Read the article

  • OnSize() Problem in VC++

    - by Anu
    Hi, In my VC++ MFC applcaiton,i have different views.And in each view,when i maximize it,i changed the size and position to new thing(Normally it fully get maximixed to screen size).But i dont want tht.So in OnSize() i coded like this. void CChildFrame::OnSize(UINT nType, int cx, int cy) { CMDIChildWnd::OnSize(nType, cx, cy); int XBorder = GetSystemMetrics(SM_CXMAXIMIZED); int YBorder = GetSystemMetrics(SM_CYMAXIMIZED); switch (nType) { case SIZE_MAXIMIZED: SetWindowPos(NULL,0,60,XBorder-45,YBorder-60,SWP_NOZORDER ); break; } } But what happened is?When i maximize the view,its get maximized to above mention size only.But in that blue bar,there si no minimize,maximize,close button. When i double click in the blue bar,its get to resumed to previous postion with all buttons. How can i get that?

    Read the article

  • what is the responsibility of ngnix or apache in rails application?

    - by user2177410
    How rails applications actually work? Let's say we have nginx + passenger + Ubuntu, so my questions are: What is nginx actually doing? How does it transfer requests to the rails app? what is passenger responsible for? And what is rack? How actually rails app can work just on webrick without apache? Please dont give me answers like "nginx processes the requests"; I need something more, or may be you know the source where I can read about this.

    Read the article

  • linq to sql update data

    - by pranay
    can i update my employee record as given in below function or i have to make query of employee collection first and than i update data public int updateEmployee(App3_EMPLOYEE employee) { DBContextDataContext db = new DBContextDataContext(); db.App3_EMPLOYEEs.Attach(employee); db.SubmitChanges(); return employee.PKEY; } or i have to do this public int updateEmployee(App3_EMPLOYEE employee) { DBContextDataContext db = new DBContextDataContext(); App3_EMPLOYEE emp = db.App3_EMPLOYEEs.Single(e => e.PKEY == employee.PKEY); db.App3_EMPLOYEEs.Attach(employee,emp); db.SubmitChanges(); return employee.PKEY; } But i dont want to use second option is there any efficient way to update data

    Read the article

  • IllegalAccessError: cross-loader access from pre-verifed class in MapActivity

    - by flipper83
    I have a big problem. When I lauch my MapActivity this launch the ilegal argument. I think that i check all 1) add map.jar from api 3 to eclipse 2) I obtain a api key 3) In androidmanifest I have putted the uses-library and te internet permision 4) I launch the google api emulator for api 3. 5) I dont know that i can try. Please, any idea? this can't be too dificult, I can't belive. Sure that it is a stupid thing :S

    Read the article

  • Help Me: Loading Qt dialogs from python Scripts

    - by krishnanunni
    Hello, im a novice into developing an application using backend as Python (2.5) and Qt(3) as front end GUI designer. I have 5 diffrent dialogs to implement the scripts. i just know to load the window (main window) from qt import * from dialogselectkernelfile import * from formcopyextract import * import sys if __name__ == "__main__": app = QApplication(sys.argv) f = DialogSelectKernelFile() f.show() app.setMainWidget(f) app.exec_loop() main dialog opens on running. i have a set of back,Next,Cancel buttons pusing on each should open the next or previous dialogs. i use the pyuic compiler to source translation.how can i do this from python. please reply i`m running out of time.i dont know how to load another dialog from a signal of push button in another dialog. Help me pls Thanks a Lot

    Read the article

  • problme with javascript map/object

    - by akshay
    I am using javascript map to store keys and values.Later on I check if specified key is present in map or not, but it sometimes gives correct result but sometimes it dont.I tried to print the map using console.log(mapname), it shows all keys, but i i try to check if some specified key is presnt sometimes it gives wrong answer. Am using following code: //following code is called n times in loop with different/same vales of x myMap : new Object(); var key = x ; //populated dynamically actually myMap[key] ="dummyval"; if(myIdMap[document.getElementById("abc").value.trim()]!=null) alert('present' ); else alert('not present'); What can be the possible problem?

    Read the article

  • create uiviewcontroller programmically

    - by pankaj
    hi, I am working in a app where i have data in uitableview. It is like a drill down application. User will click on a row and will go to next page showing more records in a uitableview. But problem in my case is that i dont know upto how many level user can drill. The number of levels are not fixed. So now i am thinking to create and add the viewcontrollers programically. Is it possible?? if yes how? thanks in advance.

    Read the article

  • Index out of range, but why?

    - by Stuart
    I have a gridview, and i have a SelectedIndexChanged event on it... protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { GridViewRow Row = GridView1.SelectedRow; //do some stuff } Then i get an error... Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index I dont understand why, the Gridview is being binded in pageload. but not in post back... if (!IsPostBack) { GridView1.DataSource = UserAccounts; GridView1.DataBind(); }

    Read the article

  • Declare global variables for a batch of execution statements - sql server 2005

    - by Shrewd Demon
    hi, i have an SQL statement wherein i am trying to update the table on the client's machine. the sql statement is as follows: BEGIN TRANSACTION DECLARE @CreatedBy INT SELECT @CreatedBy = [User_Id] FROM Users WHERE UserName = 'Administrator' --//////////////////////////////////////////////////////////////////// --//////////////////////////////////////////////////////////////////// PRINT @CreatedBy --(Works fine here and shows me the output) PRINT N'Rebuilding [dbo].[Some_Master]' ALTER TABLE [dbo].[Some_Master] ADD [CreatedBy] [BIGINT] NULL, [Reason] [VARCHAR](200) NULL GO PRINT @CreatedBy --(does not work here and throws me an error) PRINT N'Updating data in [Some_Master] table' UPDATE Some_Master SET CreatedBy = @CreatedBy COMMIT TRANSACTION but i am getting the following error: Must declare the scalar variable "@CreatedBy". Now i have observed if i write the Print statement above the alter command it works fine and shows me its value, but if i try to print the value after the Alter command it throws me the error i specified above. I dont know why ?? please help! Thank you

    Read the article

  • migrate/ update core data app without erasing user data!

    - by treasure
    hello, i have a very complicated problem that i would like to share with you and maybe someone can answer it for me. before i start i have to say that i am very new in this. So, i have a coredata iphone app (much like the recipes app) that uses a pre-populated sql database. The user can add/edit his own data but the default data cannot be deleted. the useres data are ALL saved in the same sql database. QUESTION: what do i have to do in order to: - update some (not all) of the default data that are stored in the sql database without "touching" the user's data? (the model will stay the same - no new entities etc-) (if the user uninstall the app and then reinstall the new version everything will be ok but i dont want to do this, obviously). can someone PLEASE help in coding level?

    Read the article

  • ArrayIndexOutOfBoundsException trying to access data

    - by Eggy
    I am getting an array index out of bounds exception in the following code: for (int i=1; i<11; i++) { int a[][] = new int[10][3]; double LeftTrim = 1.0; double RightTrim = 1.0; a [i][0]=(int) (LeftTrim*((i)*25)); a [i][1]=(int) (RightTrim*((i)*25)); a [i][2]= 5000; //leftWheel, rightWheel, Milliseconds myf.setWheelVelocities(a[i][0], a[i][1], a[i][2]); JOptionPane.showMessageDialog(null, + (a [i][0] + a [i][1])/2 + "wheel velocities" + " | " + a [i][2] + " Milliseconds" + " Click OK to continue..."); } Every-time I reach the 9th increment Eclipse gives me the error "Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 10" I have to test the velocity up to 250, but when I reach 225 and I click 'Ok' on 'Click ok to continue..." this error shows up! Am I going out of the array bounds or something? Thank you!

    Read the article

  • How do I loop through a SimpleXML object in PHP

    - by Aditya
    I have a simpleXml object and want to read the data from the object , I am new to PHP and dont quite know how to do this. The object details are as follows. I need to read [description] and [hours]. Thankyou. SimpleXMLElement Object ( [@attributes] = Array ( [type] = array ) [time-entry] = Array ( [0] = SimpleXMLElement Object ( [date] = 2010-01-26 [description] = TCDM1 data management: sort & upload NFP SubProducers list [hours] = 1.0 [id] = 21753865 [person-id] = 350501 [project-id] = 4287373 [todo-item-id] = SimpleXMLElement Object ( [@attributes] = Array ( [type] = integer [nil] = true ) ) ) [1] = SimpleXMLElement Object ( [date] = 2010-01-27 [description] = PDCH1: HTML [hours] = 0.25 [id] = 21782012 [person-id] = 1828493 [project-id] = 4249185 [todo-item-id] = SimpleXMLElement Object ( [@attributes] = Array ( [type] = integer [nil] = true ) ) ). Please help me. I tries a lot of stuff , but not getting the syntax right.

    Read the article

  • ASPNET MVC what do you call this, a partial view? Or something else?

    - by JK
    I'm trying to google for info on a situation, but I dont know what it is called, so its hard to find results :) I have a model with say 10 fields. But only some of those are shown on a particular view, lets say 3 of them: id, name, date. What do you call this kind of view that does not display the whole model? A partial view? The problem is that because 7 fields are not sent to the view, when the Update action is called on the controller, those fields are null, and the DB gets updated with those 7 fields set to null.

    Read the article

  • How to call javascript function when url variable is sent

    - by mattlarkin
    Hello, heres basically what I need to get done. I have a jsp page which allows me to add/modify/delete an item. The items are stored in a database which I have controller classes to access(dont worry bout that part) When an item gets selected and deleted the id of the item gets sent to the controller to be processed. The item will not always be deleted if their is a foreign key constraint so I send either a delete=true or delete=false through url back to the jsp page. I would like to have it so a javascript function gets called displaying an alert saying the item was deleted or the item was not deleted. can someone please tell me the best way to do this? thank you

    Read the article

  • Java how does Key Event Handling Mechanism(KeyListeners notified) work ?

    - by Carbonizer
    How does application/JVM know which classes if implemented key handling interfaces ? Does it use java Reflections or does it check all the classes for methods ? How can a application or executing JVM understanding to deliver the user event or call the specific methods on a class that implemented the keylistener interface. Does it look at all the classes if those methods are implemented or how does it know which classes implmented keylistener interface ? If you dont implement the keylistener Interface for a class but still implmentation all its methods. Do the class still process the user event occurred ?

    Read the article

  • jquery ajax calls with scope safety

    - by acidzombie24
    My gut tells me that if i am on a laggy server and the user fires two events fast enough on the success function c will be the value of the most recent event causing func1 to use the wrong value. <--- This is a guess, i haven't proved it. Its a feeling. How do i ensure that i use the right value when calling func1? I prefer not to send c to the server and i dont know if or how to serialize the data and deserialize it back. How do i make this code safe? $('.blah').click(function (event) { var c = $(this).closest('.comment'); ... $.ajax({ url: "/u", type: "POST", dataType: "json", data: { ... }, success: function (data) { func1(c. data.blah);//here

    Read the article

< Previous Page | 192 193 194 195 196 197 198 199 200 201 202 203  | Next Page >