Search Results

Search found 14593 results on 584 pages for 'pat inside'.

Page 26/584 | < Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >

  • Declare a Dictionary inside a static class

    - by Ngu Soon Hui
    How to declare a static dictionary object inside a static class? I tried public static class ErrorCode { public const IDictionary<string , string > ErrorCodeDic =new Dictionary<string, string>() { {"1","User name or password problem"} }; } But the compiler complains that "A const field of a reference type other than string can only be initialized with null".

    Read the article

  • Populating a Combobox inside a Gridview

    - by Nawait
    i'm having a few problems working with a gridview and a combobox inside of it. Here is the code for my ListView control: <ListView Height="139" HorizontalAlignment="Left" Margin="10,158,0,0" Name="lvAppointment" VerticalAlignment="Top" Width="250" MinWidth="350"> <ListView.View> <GridView> <GridViewColumn Header="Appointment" Width="120"> <GridViewColumn.CellTemplate> <DataTemplate> <DatePicker SelectedDate="{Binding Path=Appointment}"/> </DataTemplate> </GridViewColumn.CellTemplate> </GridViewColumn> <GridViewColumn Header="Type" Width="170"> <GridViewColumn.CellTemplate> <DataTemplate> <ComboBox ???/> </DataTemplate> </GridViewColumn.CellTemplate> </GridViewColumn> <GridViewColumn Header="Done" Width="50"> <GridViewColumn.CellTemplate> <DataTemplate> <CheckBox IsChecked="{Binding Path=Done}" IsThreeState="False"/> </DataTemplate> </GridViewColumn.CellTemplate> </GridViewColumn> </GridView> </ListView.View> I'm popluating the list from a sql ce database via c# with the following code using (SqlCeCommand sqlCeAppointment = new SqlCeCommand("SELECT appid,appointment,done,apptype.type FROM appointment INNER JOIN apptype ON appointment.refatid = apptype.atid WHERE refeventid = @eventid;", sqlCeConn)) { sqlCeAppointment.Parameters.AddWithValue("@eventid", ((cListEventItem)lvEvent.SelectedItems[0]).id); using (SqlCeDataReader sqlCeAppointmentReader = sqlCeAppointment.ExecuteReader()) { lvAppointment.Items.Clear(); while (sqlCeAppointmentReader.Read()) { lvAppointment.Items.Add(new cListAppointmentItem { id = sqlCeAppointmentReader.GetGuid(sqlCeTerminReader.GetOrdinal("appid")), Appointment = sqlCeAppointmentReader.GetDateTime(sqlCeTerminReader.GetOrdinal("appointment")), Type = sqlCeAppointmentReader.GetString(sqlCeTerminReader.GetOrdinal("type")), Done = sqlCeAppointmentReader.GetByte(sqlCeTerminReader.GetOrdinal("done")) }); } } } I can popluate the list just fine. But i want "Type" to be a combobox so the user can select the apropriate type of the appointment (its a list of appointments connected to an event). This combobox should be filled with data thats inside a table of the sql ce database (apptype). This table is not static, the users can add and delete items from this list. I have tried a few ways i found via google, but failed. I guess i'm having problems understanding how this works/should work. I hope someone can help me :( Thanks in advance

    Read the article

  • relating to objects inside an object

    - by steve
    Got a problem, I have an an array of objects inside a constructor of a class. I'm trying to use the array to relate to a property in the object but I can't relate to them. lessonObjectsArray(0) = lessonObject1 lessonObjectsArray(1) = lessonObject2 lessonObjectsArray(2) = lessonObject3 the properties of the object "lessonObject1" are lessonName, videoLink, pdfLink I thought it would be tbTest.text = lessonObjectsArray(0).lessonObject1.lessonName just doesnt work

    Read the article

  • If inside Where mysql

    - by Barno
    Can I do an if inside Where? or something that allows me to do the checks only if the field is not null (path=null) SELECT IF(path IS NOT NULL, concat("/uploads/attachments/",path, "/thumbnails/" , nome), "/uploads/attachments/default/thumbnails/avatar.png") as avatar_mittente FROM prof_foto   WHERE profilo_id = 15  -- only if path != "/uploads/attachments/default/thumbnails/avatar.png" AND foto_eliminata = 0 AND foto_profilo = 1

    Read the article

  • how to ensure that Nhibernate is inside a transaction when saving, updating or deleting

    - by pms1969
    I'd like to ensure that when I'm persisting any data to the database, using (Fluent)NHibernate, that the operations are executed inside a transaction. Is there anyway of checking that a transaction is active via an interceptor? Or any other eventing mechanism? More specifically, I'm using the System.Transaction.TransactionScope for transaction management, and just want to stop myself from not using it.

    Read the article

  • Struct inside a class

    - by Balakrishnan
    I have a class definition of the form class X { public: //class functions private: A_type *A; //other class variables }; and struct A_type is defined as struct A_type { string s1,s2,s3; }; Inside the constructor, I allocate appropriate memory for A and try A[0].s1="somestring"; It shows segmentation fault. Is this kind of declaration invalid, or am I missing something

    Read the article

  • private classes inside namespaces

    - by blacklion
    Is there a way to restrict access to a class from outside a namespace? What I want is to have a class that is only accessible to other classes inside the same namespace without having to put the namespace in it's own assembly. Is there a reason this is not possible in C#?

    Read the article

  • Javascript to detect if a div is contained inside another and when is not anymore

    - by user3668732
    i have a question. I need to detect using javacript (or JQuery) when a div is contained inside another and when is not contained anymore. I need something like this: if(div #result).contains (div #dbResults) then{#explainMsg.hide, #errorMsg.hide; if(div #result).not contains (div #dbResults) anymore then {#errorMsg.show}. the "not contains anymore" part is because the div's are added dynamically server side. Obliviously is not the code, but what i need to obtain. thanks

    Read the article

  • PHP URL GET parameters inside URL parameter

    - by user547794
    Hello, I am developing facebook/myspace content share buttons. The Facebook link takes you to a URL on my website, but I need to pass additional parameters to my URL along with the parameters passed to facebook. Here's my example: http://www.facebook.com/share.php?t=MyCompany&u=http://foobar.com/test7.php?Share=161&FbShare=Facebook28 Do I need to escape something inside the "u" parameter?

    Read the article

  • Unset an array element inside a foreach loop

    - by Summer
    I'm accessing an array by reference inside a foreach loop, but the unset() function doesn't seem to be working: foreach ( $this->result['list'] as &$row ) { if ($this_row_is_boring) { unset($row); } } print_r($this->result['list']); // Includes rows I thought I unset Ideas? Thanks!

    Read the article

  • How to implement callback functions inside classes (PHP)

    - by sombe
    I need to use a class callback method on an array inside another method (the callback function belongs to the class). class Database { public function escape_string_for_db($string){ return mysql_real_escape_string($string); } public function escape_all_array($array){ return array_filter($array,"$this->escape_string_for_db"); } } Is this the right way to go about that? (I mean, in terms of the second parameter passed to array_filter)

    Read the article

  • \sbox from inside an environment

    - by Miek Gieben
    I'm trying to save some text inside an environment for later use. The smallest test case I could come up with is this. The saved text in the sbox isn't available after the environment is closed. How can I work around that? Thanks. \documentclass{article} \begin{document} \newsavebox{\somebox} \begin{itemize} \item hello1 \item hello1 \sbox{\somebox}{Some text} \end{itemize} This should show something, but does not: "\usebox{\somebox}" \end{document}

    Read the article

  • Search inside dynamic array in python

    - by user2091683
    I want to implement a code that loops inside an array that its size is set by the user that means that the size isn't constant. for example: A=[1,2,3,4,5] then I want the output to be like this: [1],[2],[3],[4],[5] [1,2],[1,3],[1,4],[1,5] [2,3],[2,4],[2,5] [3,4],[3,5] [4,5] [1,2,3],[1,2,4],[1,2,5] [1,3,4],[1,3,5] and so on [1,2,3,4],[1,2,3,5] [2,3,4,5] [1,2,3,4,5] Can you help me implement this code?

    Read the article

  • Vertical textes inside of table headers with respect of a JavaScript based on SVG library

    - by Oleg
    I use jqGrid with many columns contains Boolean information, which are displayed as checkboxes inside of table (see http://www.ok-soft-gmbh.com/VerticalHeaders/TestFixedO.htm as an example). To display information more compact I use vertical column headers. It works very well and works in jqGrid in all browsers (see my discussion with Tony Tomov in jqGrid forum http://www.trirand.com/blog/?page_id=393/feature-request/headers-with-vertical-orientation/), but in IE vertical texts looks not nice enough. I was asked from users why the texted displayed so strange. So I think about using a JavaScript based SVG library like SVG Web ( http://code.google.com/p/svgweb/ ) or Raphaël ( http://raphaeljs.com/ ). SVG is very powerful and it is difficult to find a good example is not very easy. I need only display vertical texts (-90 grad, from bottom to up) and use if possible without working in mode of absolute position. So one more times my question: I need have a possibility to display vertical texts (-90 grad rotation) inside of <td> element of table header. I want use a JavaScript based SVG library like SVG Web or Raphaël. The solution must support on IE6. Have somebody a good reference to example which could help me to do this? If somebody post a whole solution of the problem I would be happy. To be exact here is my current solution: I define .rotate { -webkit-transform: rotate(-90deg); /* Safari, Chrome */ -moz-transform: rotate(-90deg); /* Firefox */ -o-transform: rotate(-90deg); /* Opera starting with 10.50 */ /* Internet Explorer: */ filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); } define RotateCheckboxColumnHeaders function var RotateCheckboxColumnHeaders = function (grid, headerHeight) { // we use grid as context (if one have more as one table on tnhe page) var trHead = $("thead:first tr", grid.hdiv); var cm = grid.getGridParam("colModel"); $("thead:first tr th").height(headerHeight); headerHeight = $("thead:first tr th").height(); for (var iCol = 0; iCol < cm.length; iCol++) { var cmi = cm[iCol]; if (cmi.formatter === 'checkbox') { // we must set width of column header div BEFOR adding class "rotate" to // prevent text cutting based on the current column width var headDiv = $("th:eq(" + iCol + ") div", trHead); headDiv.width(headerHeight).addClass("rotate"); if (!$.browser.msie) { if ($.browser.mozilla) { headDiv.css("left", (cmi.width - headerHeight) / 2 + 3).css("bottom", 7); } else { headDiv.css("left", (cmi.width - headerHeight) / 2); } } else { var ieVer = jQuery.browser.version.substr(0, 3); // Internet Explorer if (ieVer !== "6.0" && ieVer !== "7.0") { headDiv.css("left", cmi.width / 2 - 4).css("bottom", headerHeight / 2); $("span", headDiv).css("left", 0); } else { headDiv.css("left", 3); } } } } }; And include a call like RotateCheckboxColumnHeaders(grid, 110); after creating jqGrid.

    Read the article

  • Vertical text inside table headers using a JavaScript-based SVG library

    - by Oleg
    I use jqGrid with many columns containing boolean information, which are displayed as checkboxes inside the table (see http://www.ok-soft-gmbh.com/VerticalHeaders/TestFixedO.htm as an example). To display information more compactly I use vertical column headers. It works very well and works in jqGrid in all browsers (see my discussion with Tony Tomov in jqGrid forum http://www.trirand.com/blog/?page_id=393/feature-request/headers-with-vertical-orientation/), but in IE vertical text is blurred and doesn't look nice enough (open the link above in IE and you will see exactly what I mean). I was asked from users why the text displayed so strangely. So I'm thinking of using a JavaScript-based SVG library like SVG Web ( http://code.google.com/p/svgweb/ ) or Raphaël ( http://raphaeljs.com/ ). SVG is very powerful and it is difficult to find a good example. I need only to display vertical text (-90 grad, from the bottom up) and use if possible without working in mode of absolute positioning. So one more time my question: I need to have a possibility to display vertical text (-90 grad rotation) inside <td> elements of a table header. I want to use a JavaScript-based SVG library like SVG Web or Raphaël. The solution must support IE6. Does anybody have a good reference example which could help me do this? If somebody posts a whole solution of the problem I would be happy. To be exact here is my current solution: I define .rotate { -webkit-transform: rotate(-90deg); /* Safari 3.1+, Chrome */ -moz-transform: rotate(-90deg); /* Firefox 3.5+ */ -o-transform: rotate(-90deg); /* Opera starting with 10.50 */ /* Internet Explorer: */ filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); /* IE6, IE7 */ -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)" /* IE8 */; } define RotateCheckboxColumnHeaders function var RotateCheckboxColumnHeaders = function (grid, headerHeight) { // we use grid as context (if one have more as one table on tnhe page) var trHead = $("thead:first tr", grid.hdiv); var cm = grid.getGridParam("colModel"); $("thead:first tr th").height(headerHeight); headerHeight = $("thead:first tr th").height(); for (var iCol = 0; iCol < cm.length; iCol++) { var cmi = cm[iCol]; if (cmi.formatter === 'checkbox') { // we must set width of column header div BEFOR adding class "rotate" to // prevent text cutting based on the current column width var headDiv = $("th:eq(" + iCol + ") div", trHead); headDiv.width(headerHeight).addClass("rotate"); if (!$.browser.msie) { if ($.browser.mozilla) { headDiv.css("left", (cmi.width - headerHeight) / 2 + 3).css("bottom", 7); } else { headDiv.css("left", (cmi.width - headerHeight) / 2); } } else { var ieVer = jQuery.browser.version.substr(0, 3); // Internet Explorer if (ieVer !== "6.0" && ieVer !== "7.0") { headDiv.css("left", cmi.width / 2 - 4).css("bottom", headerHeight / 2); $("span", headDiv).css("left", 0); } else { headDiv.css("left", 3); } } } } }; And include a call like RotateCheckboxColumnHeaders(grid, 110); after creating jqGrid.

    Read the article

  • Accessing Layout Items from inside Widget AppWidgetProvider

    - by cam4mav
    I am starting to go insane trying to figure this out. It seems like it should be very easy, I'm starting to wonder if it's possible. What I am trying to do is create a home screen widget, that only contains an ImageButton. When it is pressed, the idea is to change some setting (like the wi-fi toggle) and then change the Buttons image. I have the ImageButton declared like this in my main.xml <ImageButton android:id="@+id/buttonOne" android:src="@drawable/button_normal_ringer" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" /> my AppWidgetProvider class, named ButtonWidget * note that the RemoteViews class is a locally stored variable. this allowed me to get access to the RViews layout elements... or so I thought. @Override public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { remoteViews = new RemoteViews(context.getPackageName(), R.layout.main); Intent active = new Intent(context, ButtonWidget.class); active.setAction(VIBRATE_UPDATE); active.putExtra("msg","TESTING"); PendingIntent actionPendingIntent = PendingIntent.getBroadcast(context, 0, active, 0); remoteViews.setOnClickPendingIntent(R.id.buttonOne, actionPendingIntent); appWidgetManager.updateAppWidget(appWidgetIds, remoteViews); } @Override public void onReceive(Context context, Intent intent) { // v1.5 fix that doesn't call onDelete Action final String action = intent.getAction(); Log.d("onReceive",action); if (AppWidgetManager.ACTION_APPWIDGET_DELETED.equals(action)) { final int appWidgetId = intent.getExtras().getInt( AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID); if (appWidgetId != AppWidgetManager.INVALID_APPWIDGET_ID) { this.onDeleted(context, new int[] { appWidgetId }); } } else { // check, if our Action was called if (intent.getAction().equals(VIBRATE_UPDATE)) { String msg = "null"; try { msg = intent.getStringExtra("msg"); } catch (NullPointerException e) { Log.e("Error", "msg = null"); } Log.d("onReceive",msg); if(remoteViews != null){ Log.d("onReceive",""+remoteViews.getLayoutId()); remoteViews.setImageViewResource(R.id.buttonOne, R.drawable.button_pressed_ringer); Log.d("onReceive", "tried to switch"); } else{ Log.d("F!", "--naughty language used here!!!--"); } } super.onReceive(context, intent); } } so, I've been testing this and the onReceive method works great, I'm able to send notifications and all sorts of stuff (removed from code for ease of reading) the one thing I can't do is change any properties of the view elements. To try and fix this, I made RemoteViews a local and static private variable. Using log's I was able to see that When multiple instances of the app are on screen, they all refer to the one instance of RemoteViews. perfect for what I'm trying to do The trouble is in trying to change the image of the ImageButton. I can do this from within the onUpdate method using this. remoteViews.setImageViewResource(R.id.buttonOne, R.drawable.button_pressed_ringer); that doesn't do me any good though once the widget is created. For some reason, even though its inside the same class, being inside the onReceive method makes that line not work. That line used to throw a Null pointer as a matter of fact, until I changed the variable to static. now it passes the null test, refers to the same layoutId as it did at the start, reads the line, but it does nothing. Its like the code isn't even there, just keeps chugging along. SO...... Is there any way to modify layout elements from within a widget after the widget has been created!? I want to do this based on the environment, not with a configuration activity launch. I've been looking at various questions and this seems to be an issue that really hasn't been solved, such as link text and link text oh and for anyone who finds this and wants a good starting tutorial for widgets, this is easy to follow (though a bit old, it gets you comfortable with widgets) .pdf link text hopefully someone can help here. I kinda have the feeling that this is illegal and there is a different way to go about this. I would LOVE to be told another approach!!!! Thanks

    Read the article

  • Photo inside the image view should not go cross on dragging

    - by TGMCians
    I want photo inside the imageview should not go outside on dragging. In my code when i start to drag bitmap inside the imageview its goes out from imageview but i want when it cross the imageview its should come at starting point of imageview. How to achieve this. please help me for this. @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); canvas.save(); scaleCount=scaleCount+scale; angleCount = addAngle(angleCount, Math.toDegrees(angle)); Log.v("Positions", "X: "+x+" " + "Y: "+y); Log.d("ScaleCount", String.valueOf(scaleCount)); Log.d("Angle", String.valueOf(angleCount)); if (!isInitialized) { int w = getWidth(); int h = getHeight(); position.set(w / 2, h / 2); isInitialized = true; } Paint paint = new Paint(); Log.v("Height and Width", "Height: "+ getHeight() + "Width: "+ getWidth()); transform.reset(); transform.postTranslate(-width / 2.0f, -height / 2.0f); transform.postRotate((float) Math.toDegrees(angle)); transform.postScale(scale, scale); transform.postTranslate(position.getX(), position.getY()); canvas.drawBitmap(bitmap, transform, paint); canvas.restore(); BitmapWidth=BitmapWidth+bitmap.getScaledWidth(canvas); BitmapHeight=BitmapHeight+bitmap.getScaledHeight(canvas); try { /*paint.setColor(0xFF007F00); canvas.drawCircle(vca.getX(), vca.getY(), 30, paint); paint.setColor(0xFF7F0000); canvas.drawCircle(vcb.getX(), vcb.getY(), 30, paint);*/ /*paint.setColor(0xFFFF0000); canvas.drawLine(vpa.getX(), vpa.getY(), vpb.getX(), vpb.getY(), paint); paint.setColor(0xFF00FF00); canvas.drawLine(vca.getX(), vca.getY(), vcb.getX(), vcb.getY(), paint);*/ } catch(NullPointerException e) { // Just being lazy here... } } @Override public boolean onTouch(View v, MotionEvent event) { vca = null; vcb = null; vpa = null; vpb = null; x=event.getX(); y=event.getY(); try { touchManager.update(event); if (touchManager.getPressCount() == 1) { vca = touchManager.getPoint(0); vpa = touchManager.getPreviousPoint(0); position.add(touchManager.moveDelta(0)); } else { if (touchManager.getPressCount() == 2) { vca = touchManager.getPoint(0); vpa = touchManager.getPreviousPoint(0); vcb = touchManager.getPoint(1); vpb = touchManager.getPreviousPoint(1); VMVector2D current = touchManager.getVector(0, 1); VMVector2D previous = touchManager.getPreviousVector(0, 1); float currentDistance = current.getLength(); float previousDistance = previous.getLength(); if (currentDistance-previousDistance != 0) { scale *= currentDistance / previousDistance; } angle -= VMVector2D.getSignedAngleBetween(current, previous); /*angleCount=angleCount+angle;*/ } } invalidate(); } catch(Exception exception) { // Log.d("VM", exception.getMessage()); } return true; }

    Read the article

  • Tablesorter - filter inside input fields and values

    - by Zeracoke
    I have a small quest to accomplish, and I reached a point when nothing works... So the problem is. I have a paged table with a lot of input fields inside the rows with values, and I would like to search inside these values. Let me Show this, I hope that somebody will got the idea what I should do... <script type="text/javascript"> // add parser through the tablesorter addParser method $.tablesorter.addParser({ id: 'inputs', is: function(s) { return false; }, format: function(s, table, cell, cellIndex) { var $c = $(cell); // return 1 for true, 2 for false, so true sorts before false if (!$c.hasClass('updateInput')) { $c .addClass('updateInput') .bind('keyup', function() { $(table).trigger('updateCell', [cell, false]); // false to prevent resort }); } return $c.find('input').val(); }, type: 'text' }); $(function() { $('table').tablesorter({ widgets: ['zebra', 'stickyHeaders', 'resizable', 'filter'], widgetOptions: { stickyHeaders : '', // number or jquery selector targeting the position:fixed element stickyHeaders_offset : 110, // added to table ID, if it exists stickyHeaders_cloneId : '-sticky', // trigger "resize" event on headers stickyHeaders_addResizeEvent : true, // if false and a caption exist, it won't be included in the sticky header stickyHeaders_includeCaption : true, // The zIndex of the stickyHeaders, allows the user to adjust this to their needs stickyHeaders_zIndex : 2, // jQuery selector or object to attach sticky header to stickyHeaders_attachTo : null, // scroll table top into view after filtering stickyHeaders_filteredToTop: true, resizable: true, filter_onlyAvail : 'filter-onlyAvail', filter_childRows : true, filter_startsWith : true, filter_useParsedData : true, filter_defaultAttrib : 'data-value' }, headers: { 1: {sorter: 'inputs', width: '50px'}, 2: {sorter: 'inputs'}, 3: {sorter: 'inputs'}, 4: {sorter: 'inputs'}, 5: {sorter: 'inputs'}, 6: {sorter: 'inputs'}, 7: {sorter: 'inputs', width: '100px'}, 8: {sorter: 'inputs', width: '140px'}, 9: {sorter: 'inputs'}, 10: {sorter: 'inputs'}, 11: {sorter: 'inputs'}, } }); $('table').tablesorterPager({container: $(".pager"), positionFixed: false, size: 50, pageDisplay : $(".pagedisplay"), pageSize : $(".pagesize"), }); $("#table1").tablesorter(options); /* make second table scroll within its wrapper */ options.widgetOptions.stickyHeaders_attachTo = '.wrapper'; // or $('.wrapper') $("#table2").tablesorter(options); }); </script> The structure of the tables: <tr class="odd" style="display: table-row;"> <form action="/self.php" method="POST"> </form><input type="hidden" name="f" value="data"> <td><input type="hidden" name="mod_id" value="741">741</td> <td class="updateInput"><input type="text" name="name" value="Test User Name"></td> <td class="updateInput"><input type="text" name="address" value="2548451 Random address"></td> <td class="updateInput"><input type="email" name="email" value=""></td> <td class="updateInput"><input type="text" name="entitlement" value="none"></td> <td class="updateInput"><input type="text" name="card_number" value="6846416548644352"></td> <td class="updateInput"><input type="checkbox" name="verify" value="1" checked=""></td> <td class="updateInput"><input type="checkbox" name="card_sended" value="1" checked=""></td> <td class="updateInput"><input type="text" name="create_date" value="2014-02-12 21:09:16"></td> <td class="updateInput"><a href="self.php?f=data&amp;del=741">X</a></td> <td class="updateInput"><input type="submit" value="SAVE"></td><td class="updateInput"></td></tr> So the thing is I don't know how to configure the filter to search these values... I already added some options, but none of them are working... Any help would be great!

    Read the article

< Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >