Search Results

Search found 16885 results on 676 pages for 'custom headers'.

Page 150/676 | < Previous Page | 146 147 148 149 150 151 152 153 154 155 156 157  | Next Page >

  • ASP.NET Custom Control - Default Template?

    - by Bob Fincheimer
    I know this is really picky, but can I have one template inside a user control: <uc:MyUserControl runat="server" ID="test"> <div><b>Test</b></div> <asp:PlaceHolder runat="server" id="pH" /> </uc:MyUserControl> Instead of what I have now which requires me to: <uc:MyUserControl runat="server" ID="test"> <Content> <div><b>Test</b></div> <asp:PlaceHolder runat="server" id="pH" /> </Content> </uc:MyUserControl> Basically I want my control to have only one ITemplate inside of it.

    Read the article

  • PHP custom function code optimization

    - by Alex
    Now comes the hard part. How do you optimize this function: function coin_matrix($test, $revs) { $coin = array(); for ($i = 0; $i < count($test); $i++) { foreach ($revs as $j => $rev) { foreach ($revs as $k => $rev) { if ($j != $k && $test[$i][$j] != null && $test[$i][$k] != null) { if(!isset($coin[$test[$i][$j]])) { $coin[$test[$i][$j]] = array(); } if(!isset($coin[$test[$i][$j]][$test[$i][$k]])) { $coin[$test[$i][$j]][$test[$i][$k]] = 0; } $coin[$test[$i][$j]][$test[$i][$k]] += 1 / ($some_var - 1); } } } } return $coin; } I'm not that good at this and if the arrays are large, it runs forever. The function is supposed to find all pairs of values from a two-dim array and sum them like this: $coin[$i][$j] += sum_of_pairs_in_array_row / [count(elements_of_row) - 1] Thanks a lot!

    Read the article

  • Reverse engineering a custom data file

    - by kerchingo
    At my place of work we have a legacy document management system that for various reasons is now unsupported by the developers. I have been asked to look into extracting the documents contained in this system to eventually be imported into a new 3rd party system. From tracing and process monitoring I have determined that the document images (mainly tiff files) are stored in a number of 1.5GB files. These files seem to be read from a specific offset and then written to a tmp file that is then served via a web app to the client, and then deleted. I guess I am looking for suggestions as to how I can inspect these large files that contain the tiff images, and eventually extract and write them to individual files.

    Read the article

  • Getting access to a custom Master page from a user control

    - by Bernard
    Hi We have created a Master page that inherits off the asp.net Master class. We have also got ui controls that inherit off the standard asp.net ui control class. Our Master page has a public member variable. We need to be able to access that member variable from the ui controls that we use. However we can't seem to get at it? Is it our architecture that is wrong? Or the idea itself - user control getting acces to Master page variables?

    Read the article

  • Javascript/jQuery: Varying parameters on a custom function

    - by dclowd9901
    I'm writing a plugin that will allow parameters to 'set it up.' But I predict the user won't always want to set up every aspect of the function. function This_Function(a,b,c,d); For instance, maybe they'll only want to set up a and c, but not b and d (they'll just prefer to leave those as defaults). How do I write the function (or the parameters for that matter) so that the user can customize which functions they would prefer to pass? I have a feeling it involves parsing input, but I've seen many other functions with this capability. Thanks in advance for the help.

    Read the article

  • Custom Drupal Module not creating any tables

    - by Anthony
    Anything specific I need in the module file? Install File function module_install() { //lets create the school database $create_table_sql = "CREATE TABLE IF NOT EXISTS `table1` ( id int(11) NOT NULL, principal_name varchar(300) NOT NULL, school_name varchar(300) NOT NULL, address1 varchar(300) NOT NULL, address2 varchar(300) NOT NULL, city varchar(300) NOT NULL, computer_serial_no varchar(300) NOT NULL, state varchar(200) NOT NULL, uid int(200) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1"; db_query($create_table_sql); //lets create the student database $create_table_sql = "CREATE TABLE IF NOT EXISTS table2 ( id int(11) NOT NULL, principal_name varchar(300) NOT NULL, school_name varchar(300) NOT NULL, address1 varchar(300) NOT NULL, address2 varchar(300) NOT NULL, city varchar(300) NOT NULL, computer_serial_no varchar(300) NOT NULL, state varchar(200) NOT NULL, uid int(200) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1"; db_query($create_table_sql); } /** * _UNINSTALL hook * * This function is run to uninstall the module. * */ function module_uninstall() { // Delete the DB db_query("drop table table1"); db_query("drop table table2"); } Info File Just in Case ; $Id$ name = My Module description = This module deals with blah blah package = Somepackage core = 6.x version = "6.x-1.0" core = "6.x"

    Read the article

  • Custom bean instantiation logic in Spring MVC

    - by Michal Bachman
    I have a Spring MVC application trying to use a rich domain model, with the following mapping in the Controller class: @RequestMapping(value = "/entity", method = RequestMethod.POST) public String create(@Valid Entity entity, BindingResult result, ModelMap modelMap) { if (entity== null) throw new IllegalArgumentException("An entity is required"); if (result.hasErrors()) { modelMap.addAttribute("entity", entity); return "entity/create"; } entity.persist(); return "redirect:/entity/" + entity.getId(); } Before this method gets executed, Spring uses BeanUtils to instantiate a new Entity and populate its fields. It uses this: ... ReflectionUtils.makeAccessible(ctor); return ctor.newInstance(args); Here's the problem: My entities are Spring managed beans. The reason for this is to inject DAOs on them. Instead of calling new, I use EntityFactory.createEntity(). When they're retrieved from the database, I have an interceptor that overrides the public Object instantiate(String entityName, EntityMode entityMode, Serializable id) method and hooks the factories into that. So the last piece of the puzzle missing here is how to force Spring to use the factory rather than its own BeanUtils reflective approach? Any suggestions for a clean solution? Thanks very much in advance.

    Read the article

  • Image processing custom filter 7 by 7

    - by ladiesMan217
    Lets say I have a 7 by 7 neighborhood around a pixel that looks like this 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 and I wanna filter the above by replacing the pixel p by the average of those pixels whose value lie in the range -10<=p_value <=10. I am new to image processing and I think in this case p_value is 25 and around 25 that are many pixel values in that range but don't exactly know to construct a convolution filter out of it.

    Read the article

  • nhibernate activerecord lazy collection with custom query

    - by George Polevoy
    What i'm trying to accomplish, is having a temporal soft delete table. table Project(ID int) table ProjectActual(ProjectID int, IsActual bit, ActualAt datetime) Now is it possible to map a collection of actual projects, where project is actual when there is no record in ProjectActual.ProjectID = ID, or the last record sorted by ActualAt descending has IsActual set to 1 (true)?

    Read the article

  • How to create custom filenames in C?

    - by eSKay
    Please see this piece of code: #include<stdio.h> #include<string.h> #include<stdlib.h> int main() { int i = 0; FILE *fp; for(i = 0; i < 100; i++) { fp = fopen("/*what should go here??*/","w"); //I need to create files with names: file0.txt, file1.txt, file2.txt etc //i.e. file{i}.txt } }

    Read the article

  • Custom authentication module inheriting IHttpModule issue.

    - by Chandan Khatwani
    LoginPage.aspx:- protected void Button1_Click(object sender, EventArgs e) { Context.Items["Username"] = txtUserId.Text; Context.Items["Password"] = txtPassword.Text; // FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, Context.Items["Username"].ToString(), DateTime.Now, DateTime.Now.AddMinutes(10), true, "users", FormsAuthentication.FormsCookiePath); // Encrypt the cookie using the machine key for secure transport string hash = FormsAuthentication.Encrypt(ticket); HttpCookie cookie = new HttpCookie( FormsAuthentication.FormsCookieName, // Name of auth cookie hash); // Hashed ticket // Set the cookie's expiration time to the tickets expiration time if (ticket.IsPersistent) cookie.Expires = ticket.Expiration; Response.Cookies.Add(cookie); Response.Redirect("Default.aspx"); } Global.asax file:- void Application_AuthenticateRequest(object sender, EventArgs e) { if (HttpContext.Current.User != null) { if (HttpContext.Current.User.Identity.IsAuthenticated) { if (HttpContext.Current.User.Identity is FormsIdentity) { FormsIdentity id = (FormsIdentity)HttpContext.Current.User.Identity; FormsAuthenticationTicket ticket = id.Ticket; // Get the stored user-data, in this case, our roles string userData = ticket.UserData; string[] roles = userData.Split(','); HttpContext.Current.User = new System.Security.Principal.GenericPrincipal(id, roles); Response.Write(HttpContext.Current.User.Identity.Name); Response.Redirect("Default.aspx"); } } } } I get the following error after signing in This webpage has a redirect loop. The webpage at http://localhost:1067/Default.aspx has resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer.

    Read the article

  • How to use custom font with Webview

    - by user164542
    Now i want to display some unicode characters and i have used tag: something herer . But it seems that webview can not find the Arial font because i can only see UFO - Characters . Do i have to copy arial.ttf to somewhere or how can i use this true- type-font with webview? Thanks.

    Read the article

  • Combining the value of GetLastError and a custom error message

    - by Jessica
    I have a function that returns a different DWORD value for each case there is an error. So I have the following defines: #define ERR_NO_DB_CONNECTION 0x90000 #define ERR_DB_NOT_OPEN 0x90001 #define ERR_DB_LOCKED 0x90002 #define ERR_DB_CONN_LOST 0x90003 Now, I return those values when an error occurs. I need to also return the value of GetLastError in the same return. No, I can't read it later. I tried combining it different ways, eg: return ERR_DB_NOT_OPEN + GetLastError(); and then extract the error by subtracting the value of ERR_DB_NOT_OPEN but since I need to use this in functions where there can be several return values it can get quite complex to do that. Is there any way to achieve this? I mean, combine the value + GetLastError and extract them later? Code is appreciated. Thanks Jess.

    Read the article

  • Android: how do i custom arrange menu items?

    - by mtmurdock
    I would like to arrange the menu items in my app so that one item appears in its own line, and the other 3 items appear below it. I know that this is possible because i have seen apps do it. I tried writing a menu xml with linear layouts to arrange the items, but this doesnt work. I have also tried putting them in different groups, but I had no luck with that either. I know that this is possible: i have seen it done. Anyone have any ideas?

    Read the article

  • Simple cdd (custom debian distribution) problem

    - by Daniel G. R.
    Hi everyone, Im trying to make my own debian distribution but I have a problem. simple-cdd works fine but when I try to install my generated .iso, everything goes right since a message apears: " No installable kernel was found in the defined APT sources You may try to continue without a kernel. and manually install your kernel later. This is only recommended for experts, otheriwse you will likely end with a machine that dosent boot. COntinue Without installing a kernel? " And if y say yes, it continues... When is time to install grub it says: " Installation step failed An installation step failed. You can try to run the failing item again from the menu, or skip it and choose something else. The failing step is: Install the GRUB boot loader on a hard disk " HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    Read the article

  • creating a custom odbc driver for application

    - by neddy
    Ok, i have a simple database engine (its a proprietary product written in vb6) for one of my applications... i'd like to create an ODBC driver for it so i can use some of my other applications (which require a database) with my database engine rather than microsoft sql (which they are currently using).... Does anyone have any heads up on how to develop an ODBC driver (preferably in vb6) ... i'v spent the last few hours googling it and havnt had much luck... about the best thing i have found so far is: http://www.datadirect.com/products/openaccess/index.ssp but i dont exactly want to go buying an SDK to write an ODBC driver... Cheers in advance,

    Read the article

  • custom ListView --Null pointer exception

    - by raghs
    this code throws a Null pointer exception. It was thrown by getChildAt(i). The getCount() returns the number of items in listView. But getChildAt(i) returns only if item is present in current list view. For example in a scrollable list view assume that there are 20 items. The getCount() returns 20. But getChildAt(20) returns null. Because it doesnot fit in listview. How to solve this problem?? int i,j=object.getCount(); View v=getListView(); CheckBox chk=null; for(i=0;i<j;i++) { chk=((CheckBox)((ViewGroup) v).getChildAt(i).findViewById(R.id.checkBox1)); if(chk.isChecked()) { //download the contents to specific folder in sd card } }

    Read the article

  • Eclipse + CVS use custom commit

    - by WizKiranPuttur
    Hi All, My admin has set up the "cvs commit" in a very non traditional way, instead of typing "cvs commit" I use the admin provided "scriptname modified file" to checkin the file to CVS. I am using Eclipse to my day to day work and till now I am using the Eclipse CVS Plugin to checkout the repo,update,compare,etc and use the command line to checkin. I am getting annoyed by having to go to command line to do the commit, is there any way I can make Eclipse accept when I say commit it invokes the admin script instead of "cvs commit" ? I spoke to Admin and moving the under the cvs pre-commit hooks is not an option. What can I do ? I know fair amount of "Java" I am willing to do some changes to CVS plugin if I know how and where. Thanks

    Read the article

  • Simple, Custom Parsing with c++

    - by bradkovach
    Hi! I have been reading SO for some time now, but I truly cannot find any help for my problem. I have a c++ assignment to create an IAS simulator. Here is some sample code... 0 1 a 1 2 b 2 c 3 1 10 begin 11 . load a, subtract b and offset by -1 for jump+ 11 load M(0) 12 sub M(1) 13 sub M(3) 14 halt Using c++, I need to be able to read these lines and store them in a "memory register" class that I already have constructed... For example, the first line would need to store "1 a" in register zero. How can I parse out the number at the line beginning and then store the rest as a string? I have setup storage using a class that is called using mem.set(int, string);. int is the memory location at the beginning of the line and string is the stored instruction.

    Read the article

  • Custom progress bar label text via binding

    - by Alexander K
    I was playing with progress bar customization in Silverlight application. What I want to reach is to have progress bar label to show current its state in the following format: "Value / Maximum". So, user will see what is the current value, and what is the maximum possible value. Here is a style for progress bar I use: <Style x:Key="ProgressBarStyle" TargetType="ProgressBar"> <Setter Property="Width" Value="97.21" /> <Setter Property="Height" Value="19" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="ProgressBar"> <Canvas x:Name="LevelField" Width="99" Height="21"> ... <TextBlock ... DataContext="{TemplateBinding Value}" Text="{Binding Converter={StaticResource DecNumberToStringConverter}}"/> </Canvas> </ControlTemplate> </Setter.Value> </Setter> </Style> The way I want to implement this, is to have a value converter, that will convert current value and maximum possible into the proper string. It does work properly, if it is written like above. However, I also need to provide ConverterParameter for Convertor, but not sure how to make it. When I write like this: , ConvertParameter={Binding Maximum}, it shows error on start, that Text attribute is not found in TextBlock. I was also trying to set DataContext as {RelativeSource Self}, but then it didn't displays error that DataContext attribute is not found. How to make the described progress bar label properly?

    Read the article

  • Custom Control with Localization Support in WP7

    - by Ponmalar
    I have created the DateTimePicker control. Now i want to add localization Support with this. I have followed the below steps. Created CustomControls.de-DE.resx inside the ResourceFolder. added some commonly used strings in that resx file changed the access modifier to Public added <SupportedCulture>de-DE;</SupportedCulture> in the csproj file. set System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("de-DE"); in sample.cs file before IntializeComponent(). my DateTimevalue was " 2 Day(s): 3 Hr (s): 5 Min(s) : 32 Sec (s) Getting only default language that is english. What i did wrong? Please help me anyone. Is anything i missed?

    Read the article

  • Elegant solution to retrieve custom date and time?

    - by kefs
    I am currently using a date and time picker to retrieve a user-submitted date and time, and then I set a control's text to the date and time selected. I am using the following code: new DatePickerDialog(newlog3.this, d, calDT.get(Calendar.YEAR), calDT.get(Calendar.MONTH), calDT.get(Calendar.DAY_OF_MONTH)).show(); new TimePickerDialog(newlog3.this, t, calDT.get(Calendar.HOUR_OF_DAY), calDT.get(Calendar.MINUTE), true).show(); optCustom.setText(fmtDT.format(calDT.getTime())); Now, while the above code block does bring up the date and time widgets and sets the text, the code block is being executed in full before the user can select the date.. ie: It brings up the date box first, then the time box over that, and then updates the text, all without any user interaction. I would like the date widget to wait to execute the time selector until the date selection is done, and i would like the settext to execute only after the time widget is done. How is this possible? Or is there is a more elegant solution that is escaping me? Edit: This is the code for DatePickerDialog/TimePickerDialog which is located within the class: DatePickerDialog.OnDateSetListener d=new DatePickerDialog.OnDateSetListener() { public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) { calDT.set(Calendar.YEAR, year); calDT.set(Calendar.MONTH, monthOfYear); calDT.set(Calendar.DAY_OF_MONTH, dayOfMonth); //updateLabel(); } }; TimePickerDialog.OnTimeSetListener t=new TimePickerDialog.OnTimeSetListener() { public void onTimeSet(TimePicker view, int hourOfDay, int minute) { calDT.set(Calendar.HOUR_OF_DAY, hourOfDay); calDT.set(Calendar.MINUTE, minute); //updateLabel(); } }; Thanks in advance

    Read the article

  • how to build custom menu using asp.net

    - by Turi
    hi all, i have this situation: i have to build a menu with datasource from the db, because i have to filter them among the user that is loged in. i have tried building a menu using repeater, and all this works fine till i realized that i wanted the menu with more than two levels. i have also tried with treeview, but i really don't want this solution (problem with the style and the treeview doesn't have a pretty view). Could anyone give me any ideas ? thnx in advance.

    Read the article

  • Python/Tkinter make a custom window

    - by user1435947
    I want to make a window without the top taskbar (that is movable), so there is only thin outline around the GUI box. I also want to add my own 'X' to the box. import Tkinter class Application(Frame): def __init__(self, master=None): Frame.__init__(self, master) self.parent = master ............ def main(): root = Tk() root.attributes('-fullscreen', True) root.geometry('500x250+500+200') app = Application(root) app.parent.configure(background = 'gray32') root.resizable(width=FALSE, height=FALSE) app.mainloop() main() I tried forcing the box to resize after going into fullscreen to remove the taskbar, though box is no longer movable. Any suggestions? [I have seen this thread: Python/Tkinter: Removing/disabling a resizable window's maximize button under Windows The -toolwindow attribute didn't work for me, maybe because I use linux...]

    Read the article

< Previous Page | 146 147 148 149 150 151 152 153 154 155 156 157  | Next Page >