Id
int64
1.68k
75.6M
PostTypeId
int64
1
2
AcceptedAnswerId
int64
1.7k
75.6M
ParentId
int64
1.68k
75.6M
Score
int64
-60
3.16k
ViewCount
int64
8
2.68M
Body
stringlengths
1
41.1k
Title
stringlengths
14
150
ContentLicense
stringclasses
3 values
FavoriteCount
int64
0
1
CreationDate
stringlengths
23
23
LastActivityDate
stringlengths
23
23
LastEditDate
stringlengths
23
23
LastEditorUserId
int64
-1
21.3M
OwnerUserId
int64
1
21.3M
Tags
list
4,657,885
1
4,662,137
null
1
466
I am trying to figure out the best way to handle a field storing the quantity of the same object in my join table. ![Schema](https://i.stack.imgur.com/lpbsF.png) ``` class Element < ActiveRecord::Base has_many :connections has_many :connector_types, :through => :connections end class ConnectorType < ActiveRecord::Base has_many :connections has_many :elements, :through => :connections end class Connection < ActiveRecord::Base belongs_to :element belongs_to :connector_type end ``` When I add a `ConnectorType` to an `Element` : - `Connection``ConnectorType`- `Connection``ConnectorType``Connection#number` When I remove a `ConnectorType` from an `Element` : - `Connection#number`- `Connection#number == 0``Connection` I am new to rails I don't know the Rails way to do this : - - -
has_many through and additional data : count
CC BY-SA 2.5
null
2011-01-11T13:01:25.810
2011-01-11T20:15:39.823
null
null
12,248
[ "ruby-on-rails", "has-many-through" ]
4,657,920
1
null
null
0
836
I currently have a DataGridView which depending on certain row states (which I have defined as "new", "modified", "to be removed" & "normal") I Style rows within my grid with code like this: ``` 'Modified row.DefaultCellStyle.Font = New Font(row.DataGridView.Font, FontStyle.Regular) row.DefaultCellStyle.BackColor = Color.LemonChiffon row.DefaultCellStyle.ForeColor = Color.Empty ``` I hook on to various events to accomplish this - and they fire when I expect them. My issue is that I am using My `DataGridView` in the `EditMode` of `EditOnEnter`. I'm running into an issue that whichever cell is selected (& therefor in edit mode) is not being updated immediately by my Style change code. That is until I leave the selected cell for another one. Here is a couple screen-shots which show's the life-cycle of this issue: ## Before editing anything ![Before Editing](https://i.stack.imgur.com/WagNx.png) ## After modifying a cell ![alt text](https://i.stack.imgur.com/TJB4p.png) ## After tabbing to another cell ![alt text](https://i.stack.imgur.com/pDIwK.png) My Desired result would be transitioning from the first image - directly to the last image (Without having to "tab" out of the cell I'm editing.) Is there something I can do to accomplish this? Thanks. P.S. I'm normally code in C# so I can accept the answer in either language (this project just so happens to be in vb.net v2.0)
DataGridView Bug? Cell Style InEdit Doesn't Update
CC BY-SA 2.5
null
2011-01-11T13:07:10.663
2013-08-02T04:31:35.380
2011-01-13T12:01:46.057
178,383
178,383
[ "c#", "vb.net", "winforms", "datagridview" ]
4,657,947
1
7,531,415
null
0
4,924
Can someone help me to place my GWT application on Jetty. I am not using maven. I have libraries in my build path. First I am taking the war folder already exploded and copy it in jetty/webapps, then in folder context. 1. I have placed a folde named BiddingSystem in folder web apps, it is an already exploded folder and not a .war file 2. In folder jetty/context, there is a file test.xml I am renaming the file to BiddingSystem.xml and also editing content of BiddingSystem.xml, finally the content of BiddingSystem.xml is ``` <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd"> <configure class="org.mortbay.jetty.webapp.WebAppContext"> <set name="contextPath">/BiddingSystem</set> <set name="war"><systemproperty name="jetty.home" default="."/>/webapps/BiddingSystem</set> </configure> ``` I am getting this error: ![alt text](https://i.stack.imgur.com/wru7U.jpg)
Place GWT application on Jetty
CC BY-SA 2.5
0
2011-01-11T13:10:48.057
2011-09-23T15:32:23.183
2011-01-11T13:47:24.607
484,290
484,290
[ "gwt", "deployment", "jetty" ]
4,657,954
1
4,658,101
null
2
4,431
I'm experiencing problems when trying to access my sharepoint site using web services (on powershell) given the following configuration: - `https://sharepoint.company.tld/sites/siteid/`- `https://sharepoint.company.tld/_vti_bin/Lists.asmx``https://sharepoint.company.tld/sites/siteid/_vti_bin/Lists.asmx` After building the web service DLL (following [these](http://sharepoint.microsoft.com/Blogs/zach/Lists/Posts/Post.aspx?ID=9) steps), I do a ``` $list = New-Object Lists ``` and try to obtain a list by it's GUID (known to me): ``` $docs = $list.GetList("GUID-HERE") ``` This results in an exception: ![screenshot](https://i.stack.imgur.com/4RifW.png) Retrieving the list by it's name is the same. Doing a `$list.GetListCollection()` returns me the lists known by `https://sharepoint.company.tld` and yes, my list is not amongst these. Only some lists containing webparts that shall be used for the real sites and similar stuff. Is there any way how I could tell the web services that they shall not access a list located under `https://sharepoint.company.tld` but to search my lists located at `https://sharepoint.company.tld/sites/siteid/Lists`?
How to access lists of a sub-site in Sharepoint using web services?
CC BY-SA 2.5
0
2011-01-11T13:11:41.380
2011-01-11T13:33:01.073
2011-01-11T13:17:19.533
520,162
520,162
[ "web-services", "sharepoint", "powershell" ]
4,658,235
1
4,658,285
null
8
6,456
I have a table of accounts that has columns for start date and end date. I want the user to supply a start date and end date and all data must be returned where the account was active at any time between the user specified start date and end date. The catch is that the end date may be null if the account is still currently active. The account must be selected if it was open at any time between the user specified range which means that even accounts that were opened or closed between the range must be included. Here is a picture of what I want. ![alt text](https://i.stack.imgur.com/Gtqu5.gif) The yellow part is the date range entered by the user. The green parts is what I want selected. The light red part is what I don't want selected. The arrows on the end of G, H and I mean that those accounts don't have an end date. All other ones that don't have an arrow have an end date.
Select rows with date range within another date range
CC BY-SA 2.5
0
2011-01-11T13:44:55.920
2011-01-12T05:25:06.830
2011-01-12T05:25:06.830
509,105
509,105
[ "sql", "sql-server" ]
4,658,335
1
4,658,380
null
0
5,128
I've got a table. Inside the table I've got `<a class="available">available</a>`, but it seems the height doesn't cover the whole table row. html: ``` <table with="100%" class="list_table"> <tbody> <tr> <td><a class="available">Available</a></td> <td><a class="booked"><span>Nose to mouth</span><span>Frown Lines</span></a></td> </tr> </tbody> </table> ``` css: ``` .list_table thead th, .list_table tbody td { border:1px solid #D3D9CB; font-size:12px; position:relative !important;} .available { background:#98AEB3; display:block; height:100%;} .booked { background:#F2AE30; } ``` image is attached: ![alt text](https://i.stack.imgur.com/bQD1X.png)
CSS span height 100% inside table
CC BY-SA 3.0
null
2011-01-11T13:55:14.977
2017-11-11T12:08:24.247
2017-11-11T12:08:24.247
4,370,109
551,559
[ "html", "css", "html-table" ]
4,658,534
1
4,689,980
null
8
2,875
Is it possible to have a circular menu or dock using css or jquery.? I have a set of images as the dock items that need to be displayed as a circular dock... however the number of items in the dock are not constant and may vary.... so i cannot tend to use constant values for positioning each item in a pre-defined manner. Ajax loads some images into this particular div and i need to use css or jquery to style this so that they get displayed as circular dock items. Any idea on how this can be implemented..? I would like a browser in-specific implementation, but i also welcome if some one has some solutions specific to few browsers... I don't think i exactly want a pie menu... it easily gets messed up as the number of dock items increase. I am looking for a spiral dock. and by spiral i mean that the menu items must be in the following alignment.. ![alt text](https://i.stack.imgur.com/Slx9a.gif)
Circular dock/menu in css or jquery
CC BY-SA 2.5
0
2011-01-11T14:16:23.790
2011-01-17T17:12:07.987
2011-01-14T05:05:56.767
522,058
522,058
[ "jquery", "html", "css" ]
4,658,590
1
4,658,920
null
12
46,961
Hey, I'm trying to create a design for a list that looks like (and mostly behaves like) the call log, like shown here: ![alt text](https://i.stack.imgur.com/bJPIS.jpg) For this I downloaded the source code and I'm studying it for know what class and xml file implement it. And I found this two xml files : ``` <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="?android:attr/listPreferredItemHeight" android:paddingLeft="7dip"> <com.psyhclo.DontPressWithParentImageView android:id="@+id/call_icon" android:layout_width="wrap_content" android:layout_height="match_parent" android:paddingLeft="14dip" android:paddingRight="14dip" android:layout_alignParentRight="true" android:gravity="center_vertical" android:src="@android:drawable/sym_action_call" android:background="@drawable/call_background" /> <include layout="@layout/recent_calls_list_item_layout" /> ``` and the other is : ``` <?xml version="1.0" encoding="utf-8"?> <merge xmlns:android="http://schemas.android.com/apk/res/android"> <View android:id="@+id/divider" android:layout_width="1px" android:layout_height="match_parent" android:layout_marginTop="5dip" android:layout_marginBottom="5dip" android:layout_toLeftOf="@id/call_icon" android:layout_marginLeft="11dip" android:background="@drawable/divider_vertical_dark" /> <ImageView android:id="@+id/call_type_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_alignParentLeft="true" android:layout_marginLeft="4dip" /> <TextView android:id="@+id/date" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toLeftOf="@id/divider" android:layout_alignParentBottom="true" android:layout_marginBottom="8dip" android:layout_marginLeft="10dip" android:textAppearance="?android:attr/textAppearanceSmall" android:singleLine="true" /> <TextView android:id="@+id/label" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentBottom="true" android:layout_marginLeft="36dip" android:layout_marginRight="5dip" android:layout_alignBaseline="@id/date" android:singleLine="true" android:ellipsize="marquee" android:textAppearance="?android:attr/textAppearanceSmall" android:textStyle="bold" /> <TextView android:id="@+id/number" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf="@id/label" android:layout_toLeftOf="@id/date" android:layout_alignBaseline="@id/label" android:layout_alignWithParentIfMissing="true" android:singleLine="true" android:ellipsize="marquee" android:textAppearance="?android:attr/textAppearanceSmall" /> <TextView android:id="@+id/line1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:layout_toLeftOf="@id/divider" android:layout_above="@id/date" android:layout_alignWithParentIfMissing="true" android:layout_marginLeft="36dip" android:layout_marginBottom="-10dip" android:textAppearance="?android:attr/textAppearanceLarge" android:singleLine="true" android:ellipsize="marquee" android:gravity="center_vertical" /> ``` And my activity is this: ``` public class RatedCalls extends ListActivity { private static final String LOG_TAG = "RecentCallsList"; private TableLayout table; private CallDataHelper cdh; private TableRow row; private TableRow row2; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.recent_calls_list_item); Log.i(LOG_TAG, "calling from onCreate()"); cdh = new CallDataHelper(this); table = new TableLayout(getApplicationContext()); row = new TableRow(getApplicationContext()); startService(new Intent(this, RatedCallsService.class)); Log.i(LOG_TAG, "Service called."); fillList(); } public void onResume() { super.onResume(); fillList(); } public void fillList() { List<String> ratedCalls = new ArrayList<String>(); ratedCalls = this.cdh.selectTopCalls(); setListAdapter(new ArrayAdapter<String>(RatedCalls.this, android.R.id.list, ratedCalls)); ListView lv = getListView(); lv.setTextFilterEnabled(true); lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Toast.makeText(getApplicationContext(), ((TextView) view).getText(), Toast.LENGTH_LONG).show(); } }); } ``` } And then I tried to run it on the android emulator, and then it the LogCat returned an error like this: > Caused by: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list' So inside the I declared this: ``` <ListView android:id="@android:id/list" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_x="1px" android:layout_y="1px"> </ListView> ``` And now with this declared I tried to run in the emulator, but the LogCat returns another error: > android.content.res.Resources$NotFoundException: File from xml type layout resource ID #0x102000a Thanks.
Error android.content.res.Resources$NotFoundException: File from xml type layout resource ID #0x102000a
CC BY-SA 2.5
0
2011-01-11T14:23:41.313
2022-01-20T06:28:42.083
null
null
399,459
[ "android", "android-layout", "android-source" ]
4,658,700
1
null
null
0
663
I cannot build the solution. The error output is:![alt text](https://i.stack.imgur.com/ptTBb.png) Looking at other people's suggestions pointed to missing dependencies. So I checked it: ![alt text](https://i.stack.imgur.com/wqpZd.png) The properties of a file like Dsofile.dll points to a location on the hard drive. I have checked it and the SourcePath is correct and it is marked as "Exclude" because unmarking it leads to another error. The Dsofile.dll cannot be shared in GAC. So where's the error? The list of dependencies is longer. There is about another 10 SI.ArchiveService.*.dll files.
Detected dependencies problem
CC BY-SA 2.5
null
2011-01-11T14:35:01.917
2011-01-11T14:53:29.583
null
null
510,731
[ "c#", "visual-studio-2008", ".net-3.5", "build" ]
4,658,865
1
4,658,903
null
1
5,451
I got hopelessly stuck on this task. I get other-than-UTC future date input from user > I need to persist it as UTC time. I tried various ways, but it always ends up like this: (method names are irrelevant) ![alt text](https://i.stack.imgur.com/SgkYe.png) Could please anybody give me the right direction ?
Getting timezone offset with Joda Time
CC BY-SA 2.5
null
2011-01-11T14:51:27.010
2011-01-11T14:54:43.780
null
null
306,488
[ "java", "timezone", "jodatime" ]
4,658,972
1
null
null
1
294
I have a wix setup project with the following msbuild bootstraper settings: ``` <GenerateBootstrapper ApplicationFile="$(TargetFileName)" Culture="cs" ApplicationName="Slais" BootstrapperItems="@(BootstrapperFile)" ComponentsLocation="Relative" CopyComponents="True" OutputPath="$(OutputPath)" Path="c:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Bootstrapper\" /> ``` When the bootstraper dialog runs it has UI in english. The EULA is changed but the labels and the buttons like "Accept" are still in English. Is it possible to localize the dialog or to skip it? Or to create silent bootstraper other way? ![alt text](https://i.stack.imgur.com/KO4jP.jpg)
How to localize the Visual Studio bootstrapper?
CC BY-SA 2.5
0
2011-01-11T15:01:32.770
2011-01-11T16:32:57.913
2011-01-11T16:32:57.913
345,068
345,068
[ "installation", "bootstrapper" ]
4,659,029
1
null
null
3
2,127
Does anybody know how you create the that big scrollbar which is used in the contact list? Or the one down there in the screen shot: ![alt text](https://i.stack.imgur.com/ZrV5c.png)
How do you implement the big scrollbar in android
CC BY-SA 2.5
0
2011-01-11T15:06:40.753
2013-06-05T15:22:14.020
2011-01-11T15:51:53.317
364,708
341,091
[ "android", "user-interface", "scrollbar" ]
4,659,628
1
4,661,556
null
0
1,247
I am writing jquery to append a td element and then add image tag to the td. But this is not working if i add src attribute to the image tag. Please find the code below. ``` <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script src="http://dlglobal.dl.com/Admin/IT/operations/Documents/jquery.SPServices-0.5.8.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { //alert("alert test"); /*$Textsql = $("td.ms-vb2:contains('Budakov')"); $Textsql.css("background-color", "#461B7E"); */ $().SPServices({ operation: "GetListItems", async: false, listName: "OnCallList", completefunc: function (xData, Status) { //alert(xData.responseXML.xml); $("#ctl00_m_g_87fe292c_7976_4ad4_bf5c_3c1ecf08b2d8_AdvancedDataGrid tr:first").append("<th></th>"); $(xData.responseXML).find("[nodeName=z:row]").each(function() { var TextList=$(this).attr("ows_Title"); $Textsql = $("td.ms-vb2:contains('" + TextList.toString() + "')"); $Textsql.parent().prepend("<td class='ms-vb2'><img src='http://dlglobal.dl.com/Admin/IT/operations/PublishingImages/OnCall.png' /></td>"); }); } }); }); </script> ``` UPDATE: Thanks for all yor help. My requrirements got changed and I would like to prepend the image now instead of append. But my image is moving all the columns to the right. How to add image to only matching rows but not moving other columns to right. Iam attaching my screenshot here. Please help me.![alt text](https://i.stack.imgur.com/iy3E8.gif) Thanks,
appending image tag in jquery not working(Update:need to prepend td)
CC BY-SA 2.5
null
2011-01-11T16:02:02.030
2011-01-18T18:46:01.810
2011-01-18T18:46:01.810
346,514
346,514
[ "jquery", "sharepoint" ]
4,659,909
1
null
null
0
822
I have a problem showing up a SWF file (Flash) in an ASP MVC file. I have problems adjusting the height to 100%. If this is showed in Firefox or Opera the result is the picture you see below (everything works fine under Chrome and IE). The code used is the following: > Welcome body { margin: 0px; overflow: hidden; margin: 0; padding: 0; height: 100%; width: 100%; } ``` <div id="slideshow" style="height:100%; width:100%"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab" id="name" width="100%" height="100%"> <param name="movie" value="../../Assets/PlayAround.swf" /> <param name="quality" value="high" /> <embed name="name" src="../../Assets/PlayAround.swf" quality="high" width="100%" height="100%" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"> </embed> </object> </div> </body> </html> ``` ![alt text](https://i.stack.imgur.com/MznB2.png) What am i missing?? Thanks in advance!
Flash object not displaying correctly in ASPX file on FF and Opera
CC BY-SA 2.5
null
2011-01-11T16:25:52.557
2011-01-11T19:45:25.783
null
null
225,180
[ "flash", "firefox", "height", "embed", "opera" ]
4,660,101
1
4,660,460
null
-1
3,498
Hey, i'm trying to get a project to work, but i am having trouble with the rewrite module. I'm running Wamp over Windows XP. I changed httpd.conf to change the root of localhost to: ``` DocumentRoot "C:/wamp/www/project/docroot/" ``` I have htaccess ``` RewriteEngine On RewriteBase / ``` my Apache has the rewrite module Activated. my base_url() in config.php is '[http://localhost/](http://localhost/)' in routes.php i have: ``` $route['default_controller'] = "home"; $route['our-recipes'] = "recipes"; and more pairs ``` when i point the browser to [http://localhost/](http://localhost/) i get the homepage of my site, but when i click on any internal link like to 'our-recipes' it loads but i get the same homepage, with the new url on the location bar. if i try to access '[http://localhost/recipes](http://localhost/recipes)' i get the same result. this is my folder structure: ![folder_structure](https://i.stack.imgur.com/erPcn.png) Can anyone please solve this for me??
Code Igniter - URL Rewrite
CC BY-SA 2.5
null
2011-01-11T16:43:42.857
2011-01-11T17:21:02.380
2011-01-11T16:50:59.053
470,772
470,772
[ ".htaccess", "codeigniter", "codeigniter-url" ]
4,660,113
1
4,660,925
null
2
1,469
I try to set up a tableView. I use standard cells for all sections' rows except in the last section (containing one row). Thus, I would also like to use the standard layout for all those sections except that special one. A short example is the following, my "special" cell is in section 3 (there is only one row): ``` - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { if (section == 3) return 5; return **????**; } ``` At I would like to return the width calculated from UITableView (just as if I did not implement the method). > [super self:tableView heightForHeaderInSection:(NSInteger)section]; does not work. I know I can access ``` [tableView setionHeaderHeight] ``` which is by default 10 and obviously does not take into account that I have section headings for the other sections, which will require additional space. I tried that, but it will then get the sections too close (see screenshot): (Note: the section I am interested in is the one which does not look like a cell: the one with the dates (invisible background)). ![alt text](https://i.stack.imgur.com/HOj1G.jpg) So, the easiest thing would be to hand over the layout to the standard implementation which is perfect - except for section3. What are my options?
Accessing "default" methods of UITableView
CC BY-SA 2.5
null
2011-01-11T16:44:39.160
2012-02-17T17:22:17.020
2011-01-11T17:47:42.853
522,102
522,102
[ "iphone", "ios", "uitableview" ]
4,660,334
1
4,757,477
null
3
2,838
I've been getting some [java.lang.OutOfMemoryError: GC overhead limit exceeded](https://stackoverflow.com/questions/1393486/what-means-the-error-message-java-lang-outofmemoryerror-gc-overhead-limit-excee) errors while running my Java app overnight: ``` java.lang.OutOfMemoryError: Java heap space Dumping heap to java_pid6376.hprof ... Heap dump file created [512149941 bytes in 23.586 secs] 23:34:52,163 WARN [HDScanner] Scan failed java.lang.OutOfMemoryError: Java heap space 23:34:52,298 ERROR [ContainerBase] Exception invoking periodic operation: java.lang.OutOfMemoryError: Java heap space 23:34:52,321 ERROR [JIoEndpoint] Socket accept failed java.lang.OutOfMemoryError: Java heap space at java.net.ServerSocket.accept(Unknown Source) at org.apache.tomcat.util.net.DefaultServerSocketFactory.acceptSocket(DefaultServerSocketFactory.java:61) at org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java:310) ``` If I open up jvisualvm, I can see that I am indeed out of heap space: ![monitor](https://i.stack.imgur.com/g834C.png) I'd like to profile it to try to figure out what's going on - etc. However, I'm unable to get the jvisualvm profiler to do anything at all. The `Profiler` tab shows a warning about class sharing being enabled: ![profiler](https://i.stack.imgur.com/wlEN1.png) ...even though I've added the [-Xshare:off flag](https://visualvm.dev.java.net/troubleshooting.html#xshare) to my VM args: ## ## So, - - [G1GC](http://www.oracle.com/technetwork/java/javase/tech/g1-intro-jsp-135488.html)
Unable to profile JBoss 5 using jvisualvm
CC BY-SA 3.0
0
2011-01-11T17:07:33.910
2012-07-31T02:34:51.410
2017-05-23T12:30:36.590
-1
139,010
[ "java", "jboss", "profiling", "jvisualvm" ]
4,660,671
1
4,662,571
null
0
563
I need to post links from posts descriptios as in the screenshot: ![enter image description here](https://i.stack.imgur.com/r10x1.png) I tried lots of things with facebooks php api like this: ``` $POST = array( // 'description' => $smiley[$smileyid]['description'], 'picture' => $oyun_resim, 'name' => 'Arkadaşın ' . $oyun_adi . ' adlı oyunda size meydan okunuyor !', 'link' => $oyun_link, 'caption' => "Arkadaşın sana meydan okuyor !!", 'description' => "<b>Arkadaşın bu oyunda sana meydan okuyor, ona rakip olmak için oyuna başla ve ondan fazla puan topla.</b><br /> {\"name\": \"OYNA !!\", \"link\": \"$oyun_link\"}", // 'message' => "", 'text' => 'OYUNA BAŞLA !', 'href' => $oyun_link, 'actions' => '{"name": "OYNA !!", "link": "' . $oyun_link . '"}', 'cb' => ''); ```
How to give links from post via facebook php api
CC BY-SA 3.0
null
2011-01-11T17:39:50.257
2011-12-05T05:24:39.760
2011-12-05T05:24:39.760
674,039
259,258
[ "facebook", "facebook-graph-api" ]
4,660,674
1
4,660,827
null
0
63
Guys - I have no idea what is causing my code to break here and I'd love your help to find out why! The function you see below, gets a row from a web service and builds a table row based on the data that is returned. ``` function GetData(id, thisRow) { if (id == 0) { var tier = 0; } else { var currenttier = parseInt(thisRow.find("td.Tier").text()); var tier = currenttier + 1; } //*** this console.log is affected by the for loop that appears later.. console.log(tier); $.ajax({ type: "POST", url: "F2.svc/GetChildTable", data: id, contentType: "application/json; charset=utf-8", dataType: "json", success: function (data, textStatus, xhr) { var tempstring = ""; var temp = ""; if (data.Rows.length > 0) { for (var i = 0; i < data.Rows.length; i++) { tempstring += "<tr class = 'Show Row ItemID-" + data.Rows[i].ItemID + " ParentID-" + data.Rows[i].ItemParentID + " Tier-" + tier + "'>"; tempstring += "<td class='Tier'>"; //*** the loop below seems to break the tier variable declared up above.. for (var p = 0; p < tier; p++) { tempstring += "+"; } tempstring += " " + tier; tempstring += "</td>"; tempstring += "<td class='ItemID'>"; tempstring += data.Rows[i].ItemID; tempstring += "</td>"; tempstring += "<td class='ItemParentID'>"; tempstring += data.Rows[i].ItemParentID; tempstring += "</td>"; tempstring += "<td class='ItemDateEntered'>"; tempstring += data.Rows[i].ItemDateEntered; tempstring += "</td>"; tempstring += "<td class='ItemLastUpdated'>"; tempstring += data.Rows[i].ItemLastUpdated; tempstring += "</td>"; tempstring += "<td class='ItemName'>"; tempstring += data.Rows[i].ItemName; tempstring += "</td>"; tempstring += "<td class='ItemStatusID'>"; tempstring += data.Rows[i].ItemStatusID; tempstring += "</td>"; tempstring += "<td class='ItemTasks'>"; tempstring += data.Rows[i].ItemTasks; tempstring += "</td>"; tempstring += "<td class='ItemBlocks'>"; tempstring += data.Rows[i].ItemBlocks; tempstring += "</td>"; tempstring += "<td class='ItemComments'>"; tempstring += data.Rows[i].ItemComments; tempstring += "</td>"; tempstring += "<td class='ItemFilterID'>"; tempstring += data.Rows[i].ItemFilterID; tempstring += "</td>"; tempstring += "<td class='ItemManHoursEst'>"; tempstring += data.Rows[i].ItemManHoursEst; tempstring += "</td>"; tempstring += "<td class='ItemManHoursAct'>"; tempstring += data.Rows[i].ItemManHoursAct; tempstring += "</td><td></td>" } tempstring += "</tr>"; var newRow = $(tempstring); if (id == 0) { $("table#Main > tbody").html(newRow); } else { thisRow.after(newRow); thisRow.addClass("ChildrenLoaded"); } } }, error: function (xhr, textStatus, ex) { var response = xhr.responseText; if (response.length > 11 && response.substr(0, 11) === '{"Message":' && response.charAt(response.length - 1) === '}') { var exInfo = JSON.parse(xhr.responseText); var text = "Message: " + exInfo.Message + "\r\n" + "Exception: " + exInfo.ExceptionType; // + exInfo.StackTrace; alert(text); } else { alert("error"); } } }); } ``` ![alt text](https://i.stack.imgur.com/ZLshg.png) So as you can see, the console.log(tier) displays NaN when it should display 2. What's really weird is that if I comment out the for loop that contains tempstring += "+"; The console.log works as you'd expect. The only relationship I can see, is that the for loop uses p < tier but that shouldn't have any affect on the tier variable declaration earlier on, right? Oh I guess it also goes without saying that tempstring += " " + tier; is broken too ^^ Thank you!
Commenting code changes behavior of prior code
CC BY-SA 2.5
null
2011-01-11T17:40:03.097
2011-01-11T17:53:54.363
null
null
387,285
[ "javascript", "jquery", "ajax" ]
4,660,784
1
4,661,774
null
6
8,203
![alt text](https://i.stack.imgur.com/E2IT6.png) The picture above illustrates my program. Arrows indicate `Binding`. My MainWindow.xaml has its datacontext set as `MainVM`. The Window has a tab control binded to a `ObservableCollection` of `ViewModel`s. Using a data template, the tab control displays views corresponding to the `ViewModel`. The `ObservableCollection` is found in `MainVM`. How do I access properties found in `MainVM` from `ViewModel` (enclosed in the ObservableCollection)? I am open to answers that are require modification of my programming model.
Access MVVM parent view model from within collection
CC BY-SA 2.5
0
2011-01-11T17:48:08.547
2016-07-21T09:48:36.007
null
null
504,310
[ "c#", ".net", "wpf", "mvvm" ]
4,660,803
1
4,660,921
null
0
350
What i want to do here is simple...display an ivestigators ID and him corresponding name... That can be easily done from the users table by selecting based on the user type. However i want to select only some type of investigators. The analogy here is investigators are assigned to an exhibit for them to investigate. One investigator can be assigned to a maximum of 3 cases only. Now during the assigning of investigators, i want to write a select statement that would retrieve only investigatorID's that have been assigned to less than or equal to 2 cases. I have included exhibit and users table that shows sample data below. ![alt text](https://i.stack.imgur.com/mqdfV.jpg) ![alt text](https://i.stack.imgur.com/9dbNu.jpg) Now i sort of have an idea that i will have to first of all pick out all the investigators by their ID from the users list and then filter them through the exhibit table by dropping those assigned to 3 cases and leaving just those with two cases. then afterwards i use this IDs to select the Investigators name. the big questions is how do i write the statement??
Nested and complicated select statement
CC BY-SA 2.5
null
2011-01-11T17:49:37.487
2011-01-11T18:00:26.840
null
null
569,285
[ "c#", "database", "select", "sql" ]
4,661,335
1
4,739,306
null
0
419
I have run the profiler on my web project twice and then selected the two reports and generated a comparison report. When I look at the functions, I'm seeing two rows for each function: ![alt text](https://i.stack.imgur.com/Q4gUJ.png) One line is from the baseline, and the other line is from the second profile run. Shouldn't these lines be combined to show the DELTA between the TWO? I'm seeing every function call as two seperate lines.
VS2010 Profiler comparison report baseline/comparison values
CC BY-SA 2.5
null
2011-01-11T18:41:00.383
2011-01-19T18:44:37.597
null
null
13,413
[ "visual-studio-2010", "profiler" ]
4,661,620
1
null
null
3
578
Ok, I am implementing a flowchart editor in Java. My goal is to provide a possibility to display grid lines on a drawing surface. I partially made it to work: ``` public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2 = (Graphics2D)g; // Scrolling g2.transform(transformation); // Step one: draw grid if(showGrid) { // Horizontal grid lines for(int i = -1; i < getSize().getWidth(); i += 50) { g2.drawLine(i, 0, i, (int)getSize().getHeight()); } // Vertical grid lines for(int i = -1; i < getSize().getHeight(); i += 50) { g2.drawLine(0, i, (int)getSize().getWidth(), i); } } // Step two: draw symbols // ... } ``` The results are like this:![alt text](https://i.stack.imgur.com/aMiCm.png) But, if I scroll the diagram down or up, I get this: ![alt text](https://i.stack.imgur.com/kMqY7.png) As seen, diagram is scrolled, but not the grid. I also tried putting Step one code before g2.transform(transformation) line, but after that, if I scroll, grid lines are not moving. So, the question is: is there a way to draw grid lines and avoid mentioned behavior? The goal is to scroll grid along with other elements on diagram. 1. List item
JPanel grid issue
CC BY-SA 2.5
0
2011-01-11T19:14:48.150
2011-01-11T19:46:51.747
2011-01-11T19:17:13.040
21,234
472,686
[ "java", "graphics", "grid", "jpanel" ]
4,661,673
1
null
null
4
569
I have some problem with GD when i creates images with php. The strange thing is that it works on one server with php version 5.3.1 but not on php version 5.2.14. (I'm not sure if it's the php version or the GD lib that is doing this.) ![alt text](https://i.stack.imgur.com/AdHBg.png) This file is created with convert and saved in a directory in `captcha::get_file()`. ![alt text](https://i.stack.imgur.com/Gqbqm.png) And this file is generated with `imagecreatefrompng()` and `imagepng()` ![alt text](https://i.stack.imgur.com/TmHKw.gif) I made some small changes to the script and made a gif. But there is still a problem with the png What causes this, and how can I fix it? Here is the phpcode: ``` <?php session_start(); require_once("./captcha.php")); // creates the image with convert and returns the location of the picture // document_root/picture/picture.png $picloc = captcha::get_file(); $image = @imagecreatefrompng($picloc); header('Content-type: image/png'); imagepng($image); imagedestroy($image); unlink($picloc); ?> ```
GD: php imagepng creates whitespace in image
CC BY-SA 2.5
null
2011-01-11T19:20:23.267
2012-04-12T09:09:49.530
2012-04-12T09:09:49.530
355,944
571,497
[ "php", "png", "gd" ]
4,661,686
1
6,827,755
null
5
1,582
GWT's [CellBrowser](http://code.google.com/webtoolkit/doc/latest/DevGuideUiCellWidgets.html#cellbrowser) is a great way of presenting dynamic data. However when the browser contains more rows than some (seemingly) arbitrary maximum, it offers a "Show More" label that the user can click to fetch the unseen rows. How can I disable this behavior, and force it to always show every row? ![alt text](https://i.stack.imgur.com/gdpHn.png)
GWT CellBrowser- how to always show all values?
CC BY-SA 2.5
0
2011-01-11T19:22:56.323
2020-02-20T15:15:36.320
null
null
93,995
[ "gwt", "cellbrowser" ]
4,661,818
1
4,723,235
null
35
9,925
## Finite state machine A deterministic finite state machine is a simple computation model, widely used as an introduction to automata theory in basic CS courses. It is a simple model, equivalent to regular expression, which determines of a certain input string is or . [Leaving some formalities aside](http://en.wikipedia.org/wiki/Finite-state_machine#Mathematical_model), A run of a finite state machine is composed of: 1. alphabet, a set of characters. 2. states, usually visualized as circles. One of the states must be the start state. Some of the states might be accepting, usually visualized as double circles. 3. transitions, usually visualized as directed arches between states, are directed links between states associated with an alphabet letter. 4. input string, a list of alphabet characters. A on the machine begins at the starting state. Each letter of the input string is read; If there is a transition between the current state and another state which corresponds to the letter, the current state is changed to the new state. After the last letter was read, if the current state is an accepting state, the input string is accepted. If the last state was not an accepting state, or a letter had no corresponding arch from a state during the run, the input string is rejected. Note: This short descruption is far from being a full, formal definition of a FSM; [Wikipedia's fine article](http://en.wikipedia.org/wiki/Finite-state_machine#Mathematical_model) is a great introduction to the subject. ## Example For example, the following machine tells if a binary number, read from left to right, has an even number of `0`s: ![http://en.wikipedia.org/wiki/Finite-state_machine](https://i.stack.imgur.com/fDBWN.png) 1. The alphabet is the set {0,1}. 2. The states are S1 and S2. 3. The transitions are (S1, 0) -> S2, (S1, 1) -> S1, (S2, 0) -> S1 and (S2, 1) -> S2. 4. The input string is any binary number, including an empty string. ## The rules: Implement a FSM in a language of your choice. ### Input The FSM should accept the following input: ``` <States> List of state, separated by space mark. The first state in the list is the start state. Accepting states begin with a capital letter. <transitions> One or more lines. Each line is a three-tuple: origin state, letter, destination state) <input word> Zero or more characters, followed by a newline. ``` For example, the aforementioned machine with `1001010` as an input string, would be written as: ``` S1 s2 S1 0 s2 S1 1 S1 s2 0 S1 s2 1 s2 1001010 ``` ### Output The FSM's run, written as `<State> <letter> -> <state>`, followed by the final state. The output for the example input would be: ``` S1 1 -> S1 S1 0 -> s2 s2 0 -> S1 S1 1 -> S1 S1 0 -> s2 s2 1 -> s2 s2 0 -> S1 ACCEPT ``` For the empty input `''`: ``` S1 ACCEPT ``` Following your comments, the `S1` line (showing the first state) might be omitted, and the following output is also acceptable: ``` ACCEPT ``` For `101`: ``` S1 1 -> S1 S1 0 -> s2 s2 1 -> s2 REJECT ``` For `'10X'`: ``` S1 1 -> S1 S1 0 -> s2 s2 X REJECT ``` ### Prize A 250 rep bounty will be given to the shortest solution. ## Reference implementation A reference Python implementation is available [here](http://friendpaste.com/58v7LrH0bGqC4b23QjYdDv). Note that output requirements have been relaxed for empty-string input. # Addendum ## Output format Following popular demand, the following output is also acceptable for empty input string: ``` ACCEPT ``` or ``` REJECT ``` Without the first state written in the previous line. ## State names Valid state names are an English letter followed by any number of letters, `_` and digits, much like variable names, e.g. `State1`, `state0`, `STATE_0`. ## Input format Like most code golfs, you can assume your input is correct. ## Summary of answers: - [4078 characters](https://stackoverflow.com/questions/4661818/code-golf-finite-state-machine/4662814#4662814)- [171 characters](https://stackoverflow.com/questions/4661818/code-golf-finite-state-machine/4666506#4666506)[568 characters](https://stackoverflow.com/questions/4661818/code-golf-finite-state-machine/4662032#4662032)[203 characters](https://stackoverflow.com/questions/4661818/code-golf-finite-state-machine/4743454#4743454)[218 characters](https://stackoverflow.com/questions/4661818/code-golf-finite-state-machine/4663124#4663124)[269 characters](https://stackoverflow.com/questions/4661818/code-golf-finite-state-machine/4662150#4662150)- [137 characters](https://stackoverflow.com/questions/4661818/code-golf-finite-state-machine/4687779#4687779)- [145 characters](https://stackoverflow.com/questions/4661818/code-golf-finite-state-machine/4723235#4723235)[183 characters](https://stackoverflow.com/questions/4661818/code-golf-finite-state-machine/4666863#4666863)- [192 characters](https://stackoverflow.com/questions/4661818/code-golf-finite-state-machine/4666075#4666075)[189 characters](https://stackoverflow.com/questions/4661818/code-golf-finite-state-machine/4708713#4708713)- [725 characters](https://stackoverflow.com/questions/4661818/code-golf-finite-state-machine/4728522#4728522)- [184 characters](https://stackoverflow.com/questions/4661818/code-golf-finite-state-machine/4709167#4709167)- [184 characters](https://stackoverflow.com/questions/4661818/code-golf-finite-state-machine/4767994#4767994)- [205 characters](https://stackoverflow.com/questions/4661818/code-golf-finite-state-machine/4702588#4702588)- [356 characters](https://stackoverflow.com/questions/4661818/code-golf-finite-state-machine/4748356#4748356)- [420 characters](https://stackoverflow.com/questions/4661818/code-golf-finite-state-machine/4766246#4766246)- [356 characters](https://stackoverflow.com/questions/4661818/code-golf-finite-state-machine/4753598#4753598)- [Mixal](http://www.catb.org/~esr/mixal/)[898 characters](https://stackoverflow.com/questions/4661818/code-golf-finite-state-machine/4788780#4788780) The [sed 137 solution](https://stackoverflow.com/questions/4661818/code-golf-finite-state-machine/4687779#4687779) is the shortest, [ruby 145](https://stackoverflow.com/questions/4661818/code-golf-finite-state-machine/4723235#4723235) is #2. Currently, I can't get the sed solution to work: ``` cat test.fsm | sed -r solution.sed sed -r solution.sed test.fsm ``` both gave me: ``` sed: -e expression #1, char 12: unterminated `s' command ``` so unless It there are clarifications the bounty goes to the ruby solution.
Code Golf: Finite-state machine!
CC BY-SA 2.5
0
2011-01-11T19:38:07.067
2015-04-03T16:40:55.607
2017-05-23T12:30:36.590
-1
51,197
[ "python", "language-agnostic", "code-golf", "state-machine" ]
4,662,008
1
4,662,043
null
3
15,220
Error: > Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 3: parser error : Input is not proper UTF-8, indicate encoding ! Bytes: 0xE7 0x61 0x69 0x73 XML from database (output from view source in FF): ``` <?xml version="1.0" encoding="UTF-8" ?><audit><audit_detail> <fieldname>role_fra</fieldname> <old_value>Role en fran&#xe7;ais</old_value> <new_value>Role &#xe7; en fran&#xe7;ais</new_value> </audit_detail></audit></xml> ``` If I understand correctly, the error is related to the first ç encoded in the old_value tag. To be precise, the error is related to this based on the bytes: "çais" ? Here's how I load the XML: ``` $xmlData = simplexml_load_string($ed['updates'][$i]['audit_data']); ``` The I loop through using this: ``` foreach ($xmlData->audit_detail as $a){ //code here } ``` The field in the database is of data type text and is set utf8_general_ci. My function to create the audit_detail stubs: ``` function ed_audit_node($field, $new, $old){ $old = htmlentities($old, ENT_QUOTES, "UTF-8"); $new = htmlentities($new, ENT_QUOTES, "UTF-8"); $out = <<<EOF <audit_detail> <fieldname>{$field}</fieldname> <old_value>{$old}</old_value> <new_value>{$new}</new_value> </audit_detail> EOF; return $out; } ``` The insert in the database is done like this: ``` function ed_audit_insert($ed, $xml){ global $visitor; $sql = <<<EOF INSERT INTO ed.audit (employee_id, audit_date, audit_action, audit_data, user_id) VALUES ( {$ed[emp][employee_id]}, now(), '{$ed[audit_action]}', '{$xml}', {$visitor[user_id]} ); EOF; $req = mysql_query($sql,$ed['db']) or die(db_query_error($sql,mysql_error(),__FUNCTION__)); } ``` The weirdest part is that the following works (without the xml declaration though) in a simple PHP file: ``` $testxml = <<<EOF <audit><audit_detail> <fieldname>role_fra</fieldname> <old_value>Role en fran&#xe7;ais</old_value> <new_value>Role &#xe7; en fran&#xe7;ais</new_value> </audit_detail></audit> EOF; ``` $xmlData = simplexml_load_string($testxml); Can someone help shed some light on this? - I'm now using DOM to build the XML document and have gotten rid of the error. Function here: ``` $dom = new DomDocument(); $root = $dom->appendChild($dom->createElement('audit')); $xmlCount = 0; if($role_fra != $curr['role']['role_fra']){ $root->appendChild(ed_audit_node($dom, 'role_fra', $role_fra, $curr['role']['role_fra'])); $xmlCount++; } ... function ed_audit_node($dom, $field, $new, $old){ //create audit_detail node $ad = $dom->createElement('audit_detail'); $fn = $dom->createElement('fieldname'); $fn->appendChild($dom->createTextNode($field)); $ad->appendChild($fn); $ov = $dom->createElement('old_value'); $ov->appendChild($dom->createTextNode($old)); $ad->appendChild($ov); $nv = $dom->createElement('new_value'); $nv->appendChild($dom->createTextNode($new)); $ad->appendChild($nv); //append to document return $ad; } if($xmlCount != 0){ ed_audit_insert($ed,$dom->saveXML()); } ``` However, I think I now have a display problem as this text "Roééleç sé en franêais" (new_value) is being displayed as: display problem: ![](https://i.stack.imgur.com/VSh1K.png) In my HTML document, I have the following declaration for content-type (unfortunately, I don't hold the keys to make changes here): ``` <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> ... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> ``` I've tried iconv() to convert to ISO-8859-1, however, most of the special characters are being removed when doing the conversion. All that remains is "Ro" using this command: ``` iconv('UTF-8','ISO-8859-1',$node->new_value); ``` iconv output: ![](https://i.stack.imgur.com/X3Z7Y.png) The field in the db is: utf8_general_ci. However, the connection charset would be whatever is the default. Not quite sure where to go from here... - I tried utf8_decode to see if that wouldn't help, but it didn't. ``` utf8_decode($a->new_value); ``` Output: ![](https://i.stack.imgur.com/T0bbK.png) I also noticed that my field in the db did contain UTF-8. Which is good.
Another PHP XML parsing error: "Input is not proper UTF-8, indicate encoding!"
CC BY-SA 3.0
0
2011-01-11T20:00:30.377
2013-06-24T02:15:52.700
2013-06-24T02:15:52.700
367,456
503,246
[ "php", "xml", "parsing", "simplexml" ]
4,662,139
1
4,662,164
null
0
1,236
I created a little UserControl and it works perfectly. During design view in Visual Studio, I need to modify some things as the control is resized. Here's the control: ![alt text](https://i.stack.imgur.com/1HNgM.png) It's a comboxBox, that is used to display the selected color; and a XAML usercontrol. But that's not quite important. Basically what I want is that if someone resizes this control during design view in Visual Studio, that little black block remains 1px away from the right side of the control. I have tried modifying the code in the InitializingComponent() method but it seems that you can't do that. Thanks for the suggestions and help.
Resizing a userControl on design view
CC BY-SA 2.5
null
2011-01-11T20:15:55.130
2019-01-17T18:08:10.783
2019-01-17T18:08:10.783
135,138
null
[ "c#", "winforms", "user-controls" ]
4,662,140
1
4,662,247
null
0
1,028
I have been trying to write a macro (in steps) to organize the results of a very poorly designed survey, but I am having very little luck. Here is a sample of what I have: ![alt text](https://i.stack.imgur.com/wzXPM.png) Here is a sample of what I need: ![alt text](https://i.stack.imgur.com/dWBHC.png) I am running into several problems, one of which is that not all of the 15 questions on the survey had to be answered which makes looping through the results in a smooth fashion difficult. An even bigger problem (tied to the previous issue) is that 3 of the 15 questions on the survey were "Select All That Apply" type questions, and every selection was recorded as a separate answer, but with the same number. For example question 10 had 11 possible selections which a user could choose as many or as few of as they wanted. If they selected the 1st and 3th options of question 10 the result would look like rows 3 and 4 of my `What I have` sample. My `What I need` sample shows that I need all the questions in columns and all the respondent numbers in their own row, with the long answers from a respondent under their respective number. The `ID` column from the `What I have` sample is not needed in the final product, but I have left it in the results for now thinking it might somehow help sort this mess out. Any other comments, thoughts, or suggestions are also welcome.
Need help with Excel macro to organize a messed up survey
CC BY-SA 2.5
null
2011-01-11T20:16:04.580
2015-02-23T19:25:03.073
2015-02-23T19:25:03.073
3,204,551
288,341
[ "excel", "vbscript", "survey" ]
4,662,279
1
4,662,371
null
2
2,995
![alt text](https://i.stack.imgur.com/5uTaN.png) Hey Guys, Anyone have any idea why I'm getting the warning pictured in the attached image? Right above the code in question is a comment from the code I got from "More iPhone 3 Development" which is an Apress book. The author trying to tell me something about typecasting to quiet the warning but I don't know how. > "warning: type 'id ' does not conform to the 'UITabBarControllerDelegate' protocol" I'm not using a tab bar or it's delegate anywhere in my app. I get the same warning in both places where I use: ``` AV_MonitorAppDelegate *appDelegate = [[UIApplication sharedApplication] delegate]; ``` to get a pointer to my app delegate. Thanks.
"warning: type 'id <UIApplicationDelegate>' does not conform to the 'UITabBarControllerDelegate' protocol"?
CC BY-SA 2.5
null
2011-01-11T20:29:18.353
2011-01-11T20:37:38.250
2011-01-11T20:32:44.793
106,224
519,493
[ "ios", "core-data", "casting" ]
4,662,337
1
4,662,585
null
6
31,344
I'm using the method "clearGridData" of "jqGrid 3.8 " to clear all data, but not clearing the "Navigation layer". ``` $("#MyGrid").jqGrid("clearGridData", true); ``` Thoroughly clean the grid, but leaves the "Navigation layer": ![alt text](https://i.stack.imgur.com/f6TCp.png) change "paging toolbar" by "Navigation layer"
The method "clearGridData" does not clear the paging toolbar
CC BY-SA 2.5
0
2011-01-11T20:34:02.317
2011-01-12T18:21:19.537
2011-01-12T18:21:19.537
138,071
138,071
[ "jquery", "jqgrid" ]
4,662,449
1
null
null
1
1,490
In my application I have squares at around 160 x 160 in size. Inside the squares are TextBlocks. The Textblocks are dynamic and can be filled in with any amount of words. The design I have been given requires the Line Height of the text inside the TextBlock to be smaller than the default size. Smaller in that it almost looks like its overlapping. If I were to do this in CSS/HTML I would simple do... ``` <p style="display: block; width: 90px; padding: 10px; background: none repeat scroll 0% 0% rgb(51, 51, 51); color: rgb(255, 255, 255); font-family: arial,san-serif; height: 90px; font-size: 16px; line-height: 9px;">This is my sentence, it is contained inside a small square. I need the line height to be less than normal</p> ``` If you test that out you will get something like this... ![alt text](https://i.stack.imgur.com/Goo4D.png) However, I can't seem to adjust the LineHeight Property below the default 0 value in silverlight. It throws an error... What do can I do to get a lower-than-default-line-height like I did with css/html?
Adjusting LineHeight in Silverlight for Windows Phone 7 Applications
CC BY-SA 2.5
null
2011-01-11T20:47:10.847
2011-07-11T01:29:23.843
null
null
191,006
[ "c#", "silverlight", "windows-phone-7", "expression-blend", "css" ]
4,662,835
1
4,663,916
null
16
3,566
So my django book is back at university and I'm struggling to work this one out. I've subclassed `django.forms.widgets.MultiWidget` like so: ``` class DateSelectorWidget(widgets.MultiWidget): def __init__(self, attrs=None, dt=None, mode=0): if dt is not None: self.datepos = dt else: self.datepos = date.today() # bits of python to create days, months, years # example below, the rest snipped for neatness. years = [(year, year) for year in year_digits] _widgets = ( widgets.Select(attrs=attrs, choices=days), widgets.Select(attrs=attrs, choices=months), widgets.Select(attrs=attrs, choices=years), ) super(DateSelectorWidget, self).__init__(_widgets, attrs) def decompress(self, value): if value: return [value.day, value.month, value.year] return [None, None, None] def format_output(self, rendered_widgets): return u''.join(rendered_widgets) ``` Which gives me a nifty looking date selection field like so: ![Nifty looking date selection thing](https://i.stack.imgur.com/8X9n1.png) My queston is very simple really. When I submit said form to its handling method (which uses a process like this: ``` forminstance = ModelNameForm(request.POST, instance=modelinstance) if forminstance.is_valid(): forminstance.save() ``` This fails, because Django doesn't know how to take my multi-widget and convert it back to the underlying field type, which is set in `models.py` to `DateField()`, clearly. Now, the comments around the MultiWidget in the django source give me this useful hint: > > You'll probably want to use this class with MultiValueField. But the thing is - I probably don't. I want to keep my `DateField()` because it is very useful and there is no point duplicating it. What I need to do then is somehow convert these multiple fields back into a single valid datestring (`yyyy-mm-dd`) for insertion into the database. My question is then: How? What is the best way to achieve this?
Django subclassing multiwidget - reconstructing date on post using custom multiwidget
CC BY-SA 2.5
0
2011-01-11T21:25:09.160
2011-01-17T22:34:30.557
2011-01-11T22:32:36.487
null
null
[ "python", "django", "django-widget", "django-multiwidget" ]
4,663,099
1
4,663,392
null
0
130
I don't really know how to ask this. Lets say I have a box with dynamically generated content. I want to add a separator, let's say a line, the content is larger than something. So it would basically look like this: ![alt text](https://i.stack.imgur.com/UIOVn.png) It doesn't really matter how I accomplish this, CSS, JavaScript, anything. Thanks, JC.
Separate content if it's larger than - px
CC BY-SA 2.5
0
2011-01-11T21:58:49.780
2012-04-27T10:39:48.300
2012-04-27T10:39:48.300
106,224
532,978
[ "javascript", "html", "css" ]
4,663,252
1
4,663,503
null
3
1,194
I've managed to delete all entities stored using Core Data (following [this answer](https://stackoverflow.com/questions/1077810/delete-reset-all-entries-in-core-data)). The problem is, I've noticed the primary key is still counting upwards. Is there a way (without manually writing a SQL query) to reset the Z_MAX value for the entity? Screenshot below to clarify what I mean. The value itself isn't an issue, but I'm just concerned that at some point in the future the maximum integer may be reached and I don't want this to happen. My application syncs data with a web service and caches it using core data, so potentially the primary key may increase by hundreds/thousands at a time. Deleting the entire Sqlite DB isn't an option as I need to retain some of the information for other entities. I've seen the 'reset' method, but surely that will reset the entire Sqlite DB? How can I reset the primary key for just this one set of entities? There are no relationships to other entities with the primary key I want to reset. ![Screenshot](https://i.stack.imgur.com/xtjrm.png)
How do I reset the primary key count/max in Core Data?
CC BY-SA 2.5
0
2011-01-11T22:16:04.180
2013-03-21T00:31:20.430
2017-05-23T10:32:45.283
-1
259,296
[ "iphone", "objective-c", "cocoa", "core-data" ]
4,663,366
1
4,698,757
null
3
4,450
Full disclosure...Trying feverishly here to learn more about databases so I am putting in the time and also tried to get this answer from the source to no avail. Barry Williams from databaseanswers has this schema posted. [Clients and Fees Schema](http://www.databaseanswers.org/data_models/clients_and_fees/index.htm) ![alt text](https://i.stack.imgur.com/Kf1ae.gif) I am trying to understand the split of address tables in this schema. Its clear to me that the Addresses table contains the details of a given address. The Client_Addresses and Staff_Addresses tables are what gets me. 1) I understand the use of Primary Foreign Keys as shown but I was under the assumption that when these are used you don't have a resident Primary Key in that same table (date_address_from in this case). Can someone explain the reasoning for both and put it into words how this actually works out? 2) Why would you use date_address_from as the primary key instead of something like client_address_id as the PK? What if someone enters two addresses in one day would there be conflicts in his design? If so or if not, what? 3) Along the lines of normalization...Since both date_address_from and date_address_to are the same in the Client_Addresses and Staff_Addresses table should those fields just not be included in the main Address table?
Database Design: Explain this schema
CC BY-SA 2.5
0
2011-01-11T22:25:57.093
2011-01-17T00:20:39.063
2011-01-13T02:17:10.830
527,298
527,298
[ "database", "database-design", "primary-key", "foreign-key-relationship", "database-schema" ]
4,664,517
1
4,671,500
null
21
11,803
I've spent the last few hours trying to find the solution to this question online. I've found plenty of examples on how to convert from nested set to adjacency... but few that go the other way around. The examples I have found either don't work or use MySQL procedures. Unfortunately, I can't use procedures for this project. I need a pure PHP solution. I have a table that uses the adjacency model below: ``` id parent_id category 1 0 Books 2 0 CD's 3 0 Magazines 4 1 Books/Hardcover 5 1 Books/Large Format 6 3 Magazines/Vintage ``` And I would like to convert it to a Nested Set table below: ``` id left right category 0 1 14 Root Node 1 2 7 Books 4 3 4 Books/Hardcover 5 5 6 Books/Large Format 2 8 9 CD's 3 10 13 Magazines 6 11 12 Magazines/Vintage ``` Here is an image of what I need: ![Nested Tree Chart](https://i.stack.imgur.com/3EFqO.png) I have a function, based on the pseudo code from this forum post ([http://www.sitepoint.com/forums/showthread.php?t=320444](http://www.sitepoint.com/forums/showthread.php?t=320444)) but it doesn't work. I get multiple rows that have the same value for left. This should not happen. ``` <?php /** -- -- Table structure for table `adjacent_table` -- CREATE TABLE IF NOT EXISTS `adjacent_table` ( `id` int(11) NOT NULL AUTO_INCREMENT, `father_id` int(11) DEFAULT NULL, `category` varchar(128) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ; -- -- Dumping data for table `adjacent_table` -- INSERT INTO `adjacent_table` (`id`, `father_id`, `category`) VALUES (1, 0, 'ROOT'), (2, 1, 'Books'), (3, 1, 'CD''s'), (4, 1, 'Magazines'), (5, 2, 'Hard Cover'), (6, 2, 'Large Format'), (7, 4, 'Vintage'); -- -- Table structure for table `nested_table` -- CREATE TABLE IF NOT EXISTS `nested_table` ( `id` int(11) NOT NULL AUTO_INCREMENT, `lft` int(11) DEFAULT NULL, `rgt` int(11) DEFAULT NULL, `category` varchar(128) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; */ mysql_connect('localhost','USER','PASSWORD') or die(mysql_error()); mysql_select_db('DATABASE') or die(mysql_error()); adjacent_to_nested(0); /** * adjacent_to_nested * * Reads a "adjacent model" table and converts it to a "Nested Set" table. * @param integer $i_id Should be the id of the "root node" in the adjacent table; * @param integer $i_left Should only be used on recursive calls. Holds the current value for lft */ function adjacent_to_nested($i_id, $i_left = 0) { // the right value of this node is the left value + 1 $i_right = $i_left + 1; // get all children of this node $a_children = get_source_children($i_id); foreach ($a_children as $a) { // recursive execution of this function for each child of this node // $i_right is the current right value, which is incremented by the // import_from_dc_link_category method $i_right = adjacent_to_nested($a['id'], $i_right); // insert stuff into the our new "Nested Sets" table $s_query = " INSERT INTO `nested_table` (`id`, `lft`, `rgt`, `category`) VALUES( NULL, '".$i_left."', '".$i_right."', '".mysql_real_escape_string($a['category'])."' ) "; if (!mysql_query($s_query)) { echo "<pre>$s_query</pre>\n"; throw new Exception(mysql_error()); } echo "<p>$s_query</p>\n"; // get the newly created row id $i_new_nested_id = mysql_insert_id(); } return $i_right + 1; } /** * get_source_children * * Examines the "adjacent" table and finds all the immediate children of a node * @param integer $i_id The unique id for a node in the adjacent_table table * @return array Returns an array of results or an empty array if no results. */ function get_source_children($i_id) { $a_return = array(); $s_query = "SELECT * FROM `adjacent_table` WHERE `father_id` = '".$i_id."'"; if (!$i_result = mysql_query($s_query)) { echo "<pre>$s_query</pre>\n"; throw new Exception(mysql_error()); } if (mysql_num_rows($i_result) > 0) { while($a = mysql_fetch_assoc($i_result)) { $a_return[] = $a; } } return $a_return; } ?> ``` This is the output of the above script. > INSERT INTO `nested_table` (`id`, `lft`, `rgt`, `category`) VALUES( NULL, '2', '5', 'Hard Cover' )INSERT INTO `nested_table` (`id`, `lft`, `rgt`, `category`) VALUES( NULL, '2', '7', 'Large Format' )INSERT INTO `nested_table` (`id`, `lft`, `rgt`, `category`) VALUES( NULL, '1', '8', 'Books' )INSERT INTO `nested_table` (`id`, `lft`, `rgt`, `category`) VALUES( NULL, '1', '10', 'CD\'s' )INSERT INTO `nested_table` (`id`, `lft`, `rgt`, `category`) VALUES( NULL, '10', '13', 'Vintage' )INSERT INTO `nested_table` (`id`, `lft`, `rgt`, `category`) VALUES( NULL, '1', '14', 'Magazines' )INSERT INTO `nested_table` (`id`, `lft`, `rgt`, `category`) VALUES( NULL, '0', '15', 'ROOT' ) As you can see, there are multiple rows sharing the lft value of "1" same goes for "2" In a nested-set, the values for left and right must be unique. Here is an example of how to manually number the left and right ID's in a nested set: ![How to number nested sets](https://i.stack.imgur.com/rljwW.gif) Image Credit: Gijs Van Tulder, [ref article](https://www.sitepoint.com/hierarchical-data-database-2/)
How do you convert a parent-child (adjacency) table to a nested set using PHP and MySQL?
CC BY-SA 3.0
0
2011-01-12T01:18:34.497
2016-07-01T03:30:57.263
2016-07-01T03:30:57.263
1,816,093
331,503
[ "php", "mysql", "nested-sets", "adjacency-list" ]
4,664,625
1
null
null
1
1,252
Sorry the title couldn't be a more descriptive I still don't know the name of what I'm dealing with. I'm developing a search system for a realty site and it was working well until I realized I had forgotten to take for account that some of my fields (which are used as filters in the search page) could be multiple values. What I mean is that I had only one field for Sale and Rent and one only one field as well for Residential and Commercial (other fields too) -- the problem is that a property could be for sale or rent or could be residential, commercial and industrial. What I thought I'd do is move those to their own table. The thing is, I have yet another table that lists the possible values for each field, which is used to display value names, populate forms, used as constraints, etc. So now I'm stuck with a myriad of tables. A table for properties, then tables for values, then tables that join these values to the properties. A plain search query with no filters (more filters, more joins) I'm at 7 inner joins. I'm having an extremely hard time getting joins to work both for constraining results and returning values in the SELECT portion of the query. I'd appreciate any suggestions as this problem has left me mentally fatigued for the last 2 days. I have the following tables at the moment: properties properties_images properties_listings properties_options properties_purposes res_geo_address res_geo_cities res_geo_neighborhoods res_geo_states res_property_options res_property_type_age res_property_type_listing res_property_type_property res_property_type_purpose res_property_type_purpose_property The properties table is the main property table, has a handful of colums that describe the property. The properties_ tables are used to bridge the properties table and the res_property_ tables (usings ids - one for the property and one for the value) (exception is the images, which just contains image records) The res_ tables list id and value names for the most part. (exception are the res_geo tables) As of right now, my queries don't work. To be honest I've reached such intricacy that is hard for me to explain my current setup. I'd be nice if there was a simple way to query tables with fields that have arrays and easily retrieve those. ![alt text](https://i.stack.imgur.com/kM4EM.gif) The image above shows one of the joins. How would I be able to query for a property, always retrieve a concat of all the listing name associated with it but optionally limit the properties by a certain group of listing ids?
MySQL multiple values in fields, EAV, etc
CC BY-SA 2.5
null
2011-01-12T01:41:33.210
2011-01-13T03:24:16.730
2011-01-12T12:15:25.580
528,813
528,813
[ "mysql", "database", "database-design", "schema", "entity-attribute-value" ]
4,664,816
1
4,729,572
null
0
3,548
Below is my query. Access does not like it, giving me the error `Syntax error (missing operator) in query expression 'answer WHERE question = 1'.` Hopefully you can see what I am trying to do. Please pay particular attention to 3rd, 4th, and 5th lines under the `SELECT` statement. ``` INSERT INTO Table2 (respondent,1,2,3-1,3-2,3-3,4,5) SELECT respondent, answer WHERE question = 1, answer WHERE question = 2, answer WHERE answer = 'text 1' AND question = 3, answer WHERE answer = 'text 2' AND question = 3, answer WHERE answer = 'text 3' AND question = 3, answer WHERE question = 4, longanswer WHERE question 5 FROM Table1 GROUP BY respondent; ``` I have made a little progress with this, but I still cannot get my data in the format I really want. I used several `Iif` statements to get as far as I am now, but `GROUP BY` simply isn't working the way I would expect it to. I have also tried variations on my `SELECT` statement (like `SELECT DISTINCT TOP 100 PERCENT` and `TRANSFORM`) but I guess I am not using them correctly because I always get errors. Here is what my data looks like now: ![alt text](https://i.stack.imgur.com/5hFx5.png) All I need to do now is smash all the similar `respondent` rows together (that is, `respondent` rows that have the same number) so all the cells that are empty are removed.
Access SQL query to SELECT from one table and INSERT into another
CC BY-SA 2.5
null
2011-01-12T02:27:32.213
2011-01-18T22:04:44.677
2011-01-18T18:46:26.830
288,341
288,341
[ "sql", "sql-server", "ms-access" ]
4,665,036
1
4,665,165
null
2
846
I have a graph I am trying to replicate: ![GAP Graph](https://i.stack.imgur.com/yEvOf.gif) I have the following PHP code: ``` $sale_price = 25000; $future_val = 5000; $term = 60; $x = $sale_price / $future_val; $pts = array(); $pts[] = array($x,0); for ($i=1; $i<=$term; $i++) { $y = log($x+0.4)+2.5; $pts[] = array($i,$y); echo $y . " <br>\n"; } ``` How do I make the code work to give me the points along the lower line (between the yellow and blue areas)? It doesn't need to be exact, just somewhat close. The formula is: ``` -ln(x+.4)+2.5 ``` I got that by using the Online Function Grapher at [http://www.livephysics.com/](http://www.livephysics.com/ptools/online-function-grapher.php?ymin=0&xmin=0&ymax=5&xmax=5&f1=-ln%28x%2B.4%29%2B2.5&f2=&f3=) Thanks in advance!!
How do I get points on a curve in PHP with log()?
CC BY-SA 2.5
null
2011-01-12T03:15:48.840
2011-01-12T03:46:13.920
null
null
278,251
[ "php", "math", "logging", "points", "curve" ]
4,665,046
1
4,812,073
null
0
723
Can I please get input on the following subset of a schema? ![alt text](https://i.stack.imgur.com/p7ob1.png) One of the goals of this database is to be able to store the membership info for two completely different types of members. In this schema I just named them Users and Businesses. I am far enough along in the design of this database and know that Users and Businesses will come from different tables as represented here. The concern is tracking their membership information. Here are some knowns: - - - - - The Membership_Types table will hold information in regards to whether or not a member is a paying member or a comp member or part of any group memberships. In the User_Memberships and Business_Memberships tables I have identified a member_status attribute as I will need a quick look into the active state of a membership. Instead of using a boolean status here should I switch it out with a membership_suspended_date and perform a calculation off of that instead? Any input into the good or bad of this design will be greatly appreciated. Thanks Attempt #2 trying to take into consideration input from dportas. ![alt text](https://i.stack.imgur.com/kCmJM.png) Since a there can only be a given unique instance of a member (user or business) I added membership_change_date to capture the history of a member if they are to switch from free to paid to free etc. Any inputs here still considering the original criteria listed above.
Database: Schema Verification
CC BY-SA 2.5
null
2011-01-12T03:18:33.023
2022-01-12T11:09:08.353
2022-01-12T11:09:08.353
4,758,255
527,298
[ "database", "database-design", "database-schema" ]
4,665,123
1
4,665,376
null
3
1,460
I use wpf 4.0. I use canvas as workspace. It's bigger than screen. I want to create minimap of workspace for overview workspace. How to implement minimap of workspace? ![alt text](https://i.stack.imgur.com/DsiOl.jpg)
How to implement minimap of workspace?
CC BY-SA 2.5
0
2011-01-12T03:37:47.507
2012-07-11T17:56:00.513
null
null
563,872
[ "c#", "wpf", "canvas" ]
4,665,327
1
null
null
17
5,328
So I have a C# app. It has some assets that are linked into it and are beeng embeded during compile time. App compiles and runs perfectly on windows. when testing for compatabilety with mono tells that all is correct. If I try to compile gives one error n xml file ``` /home/rupert/Desktop/CloudObserverLite(4)/CloudObserverLite/Properties/Resources.resx: Error: Error: Invalid ResX input. Position: Line 123, Column 5. Inner exception: value (CloudObserverLite) ``` And If we will look at resx xml ``` ...<resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <data name="framework_4_5_0_17689_swz" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>../assets/framework_4.5.0.17689.swz;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> <data name="index_html" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>../assets/index.html;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;windows-1251</value> </data>... ``` line 123 would be first `</data>` tag. Here is all resx file if it can give any more info ``` <?xml version="1.0" encoding="utf-8"?> <root> <!-- Microsoft ResX Schema Version 2.0 The primary goals of this format is to allow a simple XML format that is mostly human readable. The generation and parsing of the various data types are done through the TypeConverter classes associated with the data types. Example: ... ado.net/XML headers & schema ... <resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="version">2.0</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <value>[base64 mime encoded serialized .NET Framework object]</value> </data> <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> <comment>This is a comment</comment> </data> There are any number of "resheader" rows that contain simple name/value pairs. Each data row contains a name, and value. The row also contains a type or mimetype. Type corresponds to a .NET class that support text/value conversion through the TypeConverter architecture. Classes that don't support this are serialized and stored with the mimetype set. The mimetype is used for serialized objects, and tells the ResXResourceReader how to depersist the object. This is currently not extensible. For a given mimetype the value must be set accordingly: Note - application/x-microsoft.net.object.binary.base64 is the format that the ResXResourceWriter will generate, however the reader can read any of the formats listed below. mimetype: application/x-microsoft.net.object.binary.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.soap.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Soap.SoapFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.bytearray.base64 value : The object must be serialized into a byte array : using a System.ComponentModel.TypeConverter : and then encoded with base64 encoding. --> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> <xsd:element name="root" msdata:IsDataSet="true"> <xsd:complexType> <xsd:choice maxOccurs="unbounded"> <xsd:element name="metadata"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" /> </xsd:sequence> <xsd:attribute name="name" use="required" type="xsd:string" /> <xsd:attribute name="type" type="xsd:string" /> <xsd:attribute name="mimetype" type="xsd:string" /> <xsd:attribute ref="xml:space" /> </xsd:complexType> </xsd:element> <xsd:element name="assembly"> <xsd:complexType> <xsd:attribute name="alias" type="xsd:string" /> <xsd:attribute name="name" type="xsd:string" /> </xsd:complexType> </xsd:element> <xsd:element name="data"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> <xsd:attribute ref="xml:space" /> </xsd:complexType> </xsd:element> <xsd:element name="resheader"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" /> </xsd:complexType> </xsd:element> </xsd:choice> </xsd:complexType> </xsd:element> </xsd:schema> <resheader name="resmimetype"> <value>text/microsoft-resx</value> </resheader> <resheader name="version"> <value>2.0</value> </resheader> <resheader name="reader"> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <data name="framework_4_5_0_17689_swz" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>../assets/framework_4.5.0.17689.swz;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> <data name="index_html" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>../assets/index.html;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;windows-1251</value> </data> <data name="osmf_1_0_0_16316_swz" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\assets\osmf_1.0.0.16316.swz;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> <data name="playerProductInstall_swf" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\assets\playerproductinstall.swf;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> <data name="player_html" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\assets\player.html;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;windows-1251</value> </data> <data name="rpc_4_5_0_17689_swz" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\assets\rpc_4.5.0.17689.swz;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> <data name="sparkskins_4_5_0_17689_swz" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\assets\sparkskins_4.5.0.17689.swz;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> <data name="spark_4_5_0_17689_swz" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\assets\spark_4.5.0.17689.swz;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> <data name="swfobject_js" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\assets\swfobject.js;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> <data name="textLayout_2_0_0_139_swz" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\assets\textlayout_2.0.0.139.swz;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> <data name="AC_OETags_js" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\assets\ac_oetags.js;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> <data name="history_historyFrame_html" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\assets\history_historyframe.html;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> <data name="history_history_css" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\assets\history_history.css;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> <data name="history_history_js" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\assets\history_history.js;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> <data name="player_swf" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\assets\player.swf;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </data> </root> ``` If we were looking at the project structure we would see: ![alt text](https://i.stack.imgur.com/BkZQE.jpg) Sorry I am new to mono - plase help.
Mono resources.resx problem when porting (strange error in resx xml file on '</data>')
CC BY-SA 2.5
0
2011-01-12T04:25:46.837
2015-12-01T10:02:49.677
2011-01-12T05:32:42.437
434,051
434,051
[ "c#", ".net", "resources", "mono", "embedded-resource" ]
4,665,886
1
4,679,904
null
2
185
I have 3 tables in my db. AdminGroup, AdminSection and joining these two AdminAccess. AdminGroup => AdminGroupId, AdminId AdminSection => AdminSectionId, Code, Desc AdminAccess => AdminSectionId, AdminGroupId I need to get a list of all Codes available given AdminId. This is what I have so far: ``` this.AdminGroupRepository.List().Where(x => x.Admin.Any(y => y.AdminId == loginEntity.AdminId)) ``` But this gives me a list of AdminGroups and I simply need a List of Codes. ![alt text](https://i.stack.imgur.com/UuslZ.png)
Linq Many-to-Many relationship
CC BY-SA 3.0
null
2011-01-12T06:19:34.020
2012-10-31T14:36:05.083
2012-10-31T14:36:05.083
30,913
455,042
[ "asp.net-mvc", "linq", "many-to-many" ]
4,665,860
1
4,730,424
null
0
2,901
I'm trying to replicate [this](http://jquery.malsup.com/cycle/after.html) functionality in SharePoint 2010. I've added "Content Editor" web part and modifying the source html. However, I'm not getting the desire result, something I'm missing in the code . My output is coming something like , ![alt text](https://i.stack.imgur.com/ezaoa.png) Here is my code, ``` <IMG ID="slideshowPicturePlaceholder" src="/_layouts/images/GEARS_AN.GIF" style="display:none"/> <center><div id="slideshowContentArea" style="display:none">&nbsp;</div></center> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript" src="http://malsup.github.com/chili-1.7.pack.js"></script> <script type="text/javascript" src="http://cloud.github.com/downloads/malsup/cycle/jquery.cycle.all.2.72.js"></script> <script> function GetAllImages() { $("#slideshowPicturePlaceholder").css("display", "block"); var soapEnv = "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'><soapenv:Body><GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'>"; //The name of the image library is called 'SlideShow'. Replace the name bewlo with the name of your image library soapEnv += "<listName>SlideShow</listName>"; soapEnv += "<query><Query><OrderBy Override='TRUE'><FieldRef Name='Created' Ascending='FALSE' /></OrderBy></Query></query>"; soapEnv += "<viewFields><ViewFields><FieldRef Name='Title'/><FieldRef Name='ows_FileLeafRef'/></ViewFields></viewFields><rowLimit></rowLimit>"; soapEnv += "</GetListItems></soapenv:Body></soapenv:Envelope>"; var port = window.location.port; if (port.length <= 0) port = ""; else port = ":"+port; var webservice = window.location.protocol+"//"+window.location.hostname+port+L_Menu_BaseUrl+"/_vti_bin/lists.asmx"; $.ajax({ url: webservice, type: "POST", dataType: "xml", data: soapEnv, complete: processQueryResults, contentType: "text/xml; charset=utf-8", error: function(xhr) { alert('Error! Status = ' + xhr.status);} }); } function processQueryResults(xData, status) { var port = window.location.port; if (port.length <= 0) port = ""; else port = ":"+port; //Change the below to point to your image library var imageURL = window.location.protocol+"//"+window.location.hostname+port+L_Menu_BaseUrl+"/SlideShow/"; var itemURL = window.location.protocol+"//"+window.location.hostname+port+L_Menu_BaseUrl+"/SlideShow/Forms/DispForm.aspx?ID="; $("#slideshowContentArea").html("") $("#slideshowContentArea").html("<table cellspacing='20'><tr><td>") $("#slideshowContentArea").html("<div class='nav'><a id='prev href='#'>Prev</a><a id='next' href='#'>Next</a></div>") $(xData.responseXML).find("z\\:row").each(function() { var title = $(this).attr("ows_Title"); var imageLink = imageURL+$(this).attr("ows_FileLeafRef").substring($(this).attr("ows_FileLeafRef").indexOf('#')+1); var itemLink = itemURL+$(this).attr("ows_ID"); var Html ="<div style='padding: 10px;border:1px solid #ccc;background-color:#eee;width:270px;height: 270px;top:0;left: 0;'><a target='_blank' border='0' href='"+itemLink+"'><img width='250' height='250' src='"+ imageLink +"'/></a><p align='center'></p></div><pre><code>$('#slideshow').cycle({fx:'scrollHorz',prev:'#prev',next:'#next',after:onAfter,timeout:0});</code></pre></td></tr></table>"; $("#slideshowContentArea").append(Html); }); $("#slideshowPicturePlaceholder").css("display", "none"); $("#slideshowContentArea").css("display", "block"); } GetAllImages(); </script> ``` Where am I missing ?
JQuery cycle plugin code with SharePoint
CC BY-SA 2.5
null
2011-01-12T06:14:13.387
2011-05-16T17:28:39.267
2011-01-12T06:36:44.877
263,357
263,357
[ "jquery-plugins", "sharepoint-2010" ]
4,666,055
1
4,666,144
null
1
1,383
What is the recommended way to put a header on the android app like the twitter app (screenshot below - header marked). I am extending ArrayAdapter to create the listing. But cannot find a way to put the header. ![alt text](https://i.stack.imgur.com/ZCLgq.png) Thanks in advance.
Android: How to put image as Listview Header as in Twitter
CC BY-SA 2.5
null
2011-01-12T06:49:19.287
2011-01-12T07:32:27.807
null
null
48,557
[ "android", "listview" ]
4,666,178
1
4,761,012
null
1
173
I have one stubborn data grid view is refusing to display the bound data. i placed a grid view named exhibitgridview and set its datasource to none. then i added a standalone data source that can return columns into the grid but first there data displayed in the grid would be based on a what gets selected from a dropdown list. check it out from the picture below. ![alt text](https://i.stack.imgur.com/6vrFB.jpg) So basically some item is selected from the dropdown list next to the caseid label and the grid displays values accordingly... AS such i needed a selectedIndexchanged method so i had this in my page.cs ``` protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { CreateDataSet(); caseID = DropDownList1.SelectedItem.Value.Trim(); DataView exhibitDataView = new DataView(exhibitDataSet.Tables[0]); exhibitDataView.RowFilter = "FilingID = '" + caseID + "' "; ExhibitGridView.DataSource = exhibitDataView; ExhibitGridView.DataBind(); } private void CreateDataSet() { exhibitConnection.ConnectionString = ExhibitListSqlDataSource.ConnectionString; exhibitSqlDataAdapter.SelectCommand = new SqlCommand(ExhibitListSqlDataSource.SelectCommand, exhibitConnection); exhibitSqlDataAdapter.Fill(exhibitDataSet); } ``` The code runs sweet...I inserted a breakpoint as to ensure some data is actually returned for binding and there is...you can see that from the screen shot below: ![alt text](https://i.stack.imgur.com/5BfQV.jpg) that was until (ExhibitGridView.DataBind()). So when i run the next block, i expect the data to bind and display in the browser but for some unknown reason the gridview is acting stubborn. i tried specifying the datasource directly and it displays successfully at pageload but otherwise it wouldn't respond. What could be the cause?
DataGridView playing stubborn. It just wouldn't bind
CC BY-SA 3.0
null
2011-01-12T07:08:39.333
2018-01-18T02:05:46.193
2018-01-18T02:05:46.193
1,033,581
569,285
[ "c#", "asp.net", "sql-server", "data-binding", "datagridview" ]
4,666,202
1
null
null
3
337
I'm somewhat new to OpenGL though I'm fairly sure my problem lies in the pixel format being used, or how my texture is being generated... I'm drawing a texture onto a flat 2D quad using a 16bit RGB5_A1 pixel format, though I don't make use of any alpha at this stage. The problem I'm having is that each pair of horizontal pixel values have been . That is... if the pixels positions should be in this order (assume 8x2 image) ``` 0 1 2 3 4 5 6 7 ``` they are instead drawn as ``` 1 0 3 2 5 4 7 6 ``` Or, more clearly from this image (below). Left is what I get... Right is what I should get. ![](https://i.stack.imgur.com/T1bSW.png). The question is... How have I ended up with this? Is there something wrong with the pixel format? Unlikely since the colours all appear correct, and I would expect all kinds of nasty if it were down to endian-ness. Suggestions greatly appreciated. : Turns out the problem was in my source renderer. Interestingly, I've avoided the problem entirely by using 32-bit textures (haven't tried 24-bit at this point).
OpenGL pixels drawn with each horizontal pair swapped
CC BY-SA 2.5
null
2011-01-12T07:11:55.117
2011-01-13T07:09:05.547
2011-01-13T05:47:11.020
349,660
349,660
[ "opengl", "distortion", "pixelformat" ]
4,666,347
1
4,666,426
null
30
13,614
I was wondering how can I create text stroke for UILabel in iOS4 ? I need some suggestion . I want something like this : ![alt text](https://i.stack.imgur.com/3rg5V.jpg) EDITED : ``` UIFont *font = [UIFont fontWithName:@"Arial" size:222]; CGPoint point = CGPointMake(0,0); CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetRGBFillColor(context, 1.0, 1.0, 1.0, 0.7); CGContextSetRGBStrokeColor(context, 2, 2, 2, 1.0); CGContextSetTextDrawingMode(context, kCGTextFillStroke); CGContextSaveGState(context); // I change it to my outlet [label.text drawAtPoint:point withFont:font]; CGContextRestoreGState(context); ```
Create text Stroke for UILabel iphone
CC BY-SA 3.0
0
2011-01-12T07:39:57.203
2015-02-19T17:31:04.643
2011-06-09T09:46:33.510
491,980
319,097
[ "iphone", "ios4" ]
4,666,396
1
4,667,255
null
2
2,949
I am facing trouble to set WrapText kind of facility in EditText. : When i try tp enter data in EditText, it goes beyond the screen width (scrolling horizontally). Instead of it should be appear in next-line. Actually, i want to implement multiline edittext, initially it should display with single-line as usual, but it will be expanded vertically(not horizontally) as when data is being entered. Please have a look at below image: ![alt text](https://i.stack.imgur.com/ly4uu.png) I have done the below XML coding: ``` <TableLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingTop="10dp" android:paddingLeft="10dp" android:paddingRight="10dp" android:stretchColumns="1"> <TableRow android:id="@+id/TableRow02" android:layout_width="fill_parent" android:layout_height="wrap_content"> <TextView android:text="Name:" android:id="@+id/TextView01" android:layout_width="80dp" android:layout_height="wrap_content" android:textSize="16dip"> </TextView> <EditText android:id="@+id/txtViewName" android:layout_height="wrap_content" android:layout_width="wrap_content" android:inputType="textFilter|textMultiLine|textNoSuggestions" android:scrollHorizontally="false"> </EditText> </TableRow> </TableLayout> ```
Android - Problem of WrapText in Edittext
CC BY-SA 2.5
null
2011-01-12T07:49:53.200
2018-09-13T10:39:46.417
2011-01-12T09:10:30.133
379,693
379,693
[ "android", "android-edittext" ]
4,666,463
1
4,666,715
null
2
109
I am trying to build a solution consisting of 45 projects, but there is some problems. I get the (unable to determine name) in the solution explorer. ![alt text](https://i.stack.imgur.com/FnMR4.png) What causes this? Can it be because some projects have been removed. There were 2 obsolete projects that were deleted. It's kind of indicated in the error output. Here is the errors generated: ![alt text](https://i.stack.imgur.com/Ne63C.png)
Projects solution building
CC BY-SA 3.0
null
2011-01-12T08:01:35.410
2011-12-16T22:21:49.740
2011-12-16T22:21:49.740
606,664
510,731
[ "c#", "visual-studio-2008", "build", "projects-and-solutions" ]
4,666,491
1
4,844,955
null
1
10,186
I've set-up jQueryMobile plugin into my blog mobile version by the instruction of jQueryMobile documentation. ``` <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.css" /> <script src="http://code.jquery.com/jquery-1.4.4.min.js"></script> <script src="http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.js"></script> ``` and description page is as follow ``` <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>Against All Odds</title> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.css" /> <link rel="stylesheet" href="_assets/css/jqm-docs.css"/> <script src="http://code.jquery.com/jquery-1.4.4.min.js"></script> <script type="text/javascript" src="http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.js"></script> </head> <body> <div data-role="page"> <div data-role="header"> <h1>my title</h1> </div><!-- /header --> <div data-role="content"> my description </div><!-- /content --> </div><!-- /page --> </body> </html> ``` Unfortunately, the image in back button doesn't appear in my page. And I've also put jQuerymobile images folder into my project page. Is there any configuration did I forget to setup? ![alt text](https://i.stack.imgur.com/Plrws.png)
Image in jQuery Mobile back button doesn't appear
CC BY-SA 2.5
null
2011-01-12T08:05:51.493
2011-01-30T19:25:20.663
null
null
2,555,911
[ "jquery", "jquery-ui", "jquery-plugins", "jquery-mobile" ]
4,666,520
1
16,583,367
null
0
3,800
I have a core data/ uitableview based app. Actually 80% of the code so far is equal to the Apple Sample app CoreDataRecipes. My problem is that when I enter the edit mode (by pushing the edit button), there are no "delete badges" on the left side of the rows. Bumper. ![alt text](https://i.stack.imgur.com/B8lTF.png) The differences in code with CoreDataRecipes: 1. I have custom UITabelview cell with a nib file instead of code only. 2. My Tableview is an Outlet inside my class view. So my class RecipeListTableViewController is an UIViewController with Tableview delegates instead of a UITableViewController What I tried: - - - I checked if the editingstyle is ok. It should be by default but to make sure I added:(UITableViewCellEditingStyle)tableView:(UITableView*)tableVieweditingStyleForRowAtIndexPath(NSIndexPath*)indexPath {return UITableViewCellEditingStyleDelete;}- I checked if the delete icons where not behind my cellview. There are not. I now think that the cell behaviour of moving to the right is handled by iOS.- - ![alt text](https://i.stack.imgur.com/0WLpq.png) Anyone any ideas? It must be something simple.
Left delete icons not appearing while UITableview edit mode
CC BY-SA 3.0
null
2011-01-12T08:09:19.367
2015-09-02T05:24:30.437
2015-07-16T09:07:35.937
4,370,109
224,907
[ "iphone", "uitableview", "swipe" ]
4,666,542
1
4,666,584
null
0
311
I have a Grid in which I am showing some records in each row. Here's how it is: ![alt text](https://i.stack.imgur.com/h8rME.jpg) Now, my problem is that when I press the view button, I want to fetch the ID from the first column in a session variable so that I can display the same ID on the next page. For the ItemTemplate of EditButton, I am using this code: ``` <ItemTemplate> <asp:LinkButton ID="EditBtn" CssClass="btn green" CommandName="edit" ToolTip="Edit" Text="Edit" runat="server" /> </ItemTemplate> ```
Fetching the id from the first column of GridView
CC BY-SA 2.5
null
2011-01-12T08:12:44.483
2011-01-12T09:01:15.050
2011-01-12T09:01:15.050
41,956
458,790
[ "asp.net", "gridview" ]
4,666,877
1
4,666,889
null
1
13,899
I've just started learning jQuery and already love it, but my skills aren't enough yet to solve this probably simple problem for my work: I have 3 different forms with an input field immediately followed by submit button: ![alt text](https://i.stack.imgur.com/Eqvmb.png) I would like to prevent form submission if the text input field or the textarea before the submit button is empty. I've stolen a snippet from the [jQuery Ninja book](http://www.sitepoint.com/books/jquery1/): ``` $(function() { $(':submit').click(function(e) { $(':text').each(function() { if ($(this).val().length == 0) { $(this).css('border', '2px solid red'); } }); e.preventDefault(); }); }); ``` But it has following problems: 1. It ignores the textarea in the last form, because $(':text').each() does not apply to it 2. It doesn't allow submitting any form - I guess I need to move preventDefault() under an "if" 3. I probably should better use prev() instead of each() 4. If the user changes her mind and clicks another form, the previous form should be cleared Could someone help me please? Alex I've tried: ``` $(function() { $(':submit').click(function(e) { $(this).prev(function() { if ($(this).val().length < 2) { // would be good to clear border for // each text and textarea here... $(this).css('border', '2px solid red'); e.preventDefault(); } }); }); }); ``` but unfortunately get 2 warnings: ``` Warning: Unexpected token in attribute selector: '!'. Warning: Unknown pseudo-class or pseudo-element 'submit'. ``` and the red border doesn't appear and the form is submitted when a button is clicked. Also I've tried: ``` $(function() { $('form').submit(function(e) { $(':text, textarea').each(function() { if ($(this).val().length < 2) { $(this).css('border', '2px solid red'); e.preventDefault(); } }); }); }); ``` but the form is never submitted and all 3 text fields turn red instead of just one.
jQuery: prevent form submission if the field before submit button is empty
CC BY-SA 3.0
null
2011-01-12T09:01:09.777
2014-03-03T18:50:19.257
2014-03-03T18:50:19.257
1,296,746
165,071
[ "jquery", "form-submit" ]
4,667,064
1
null
null
33
40,124
Taking inspiration from Android Market, i have implemented a Endless List which loads more data from the server when we reach the end of the List. Now, i need to implement the progressbar & "Loading.." text as shown![alt text](https://i.stack.imgur.com/H4HvB.png) Sample code to take inspiration from would be great.
Android: Implementing progressbar and "loading..." for Endless List like Android Market
CC BY-SA 3.0
0
2011-01-12T09:24:29.163
2020-01-08T16:14:37.623
2013-01-30T20:57:03.943
85,950
548,903
[ "android", "android-listview" ]
4,667,146
1
null
null
4
3,433
How it could be difficult to make a web site which is integrated with domain authentication in visual studio!? This is my web.config: ``` <authentication mode="Windows"/> <identity impersonate="true"/> <authorization> <allow users="xxxDomains\yyyGroup"/> <deny users="*"/> </authorization> ``` This is the result: ![alt text](https://i.stack.imgur.com/VAsx7.png) But I think there would be a which is for entering `domain_name\username` and `password`. Bu page is directed me always to the Access Denied Page without asking my username and password. PS: I'm not belong to any domain. I want to use visual studio's web server(cassini). I will deploy the site after finishing project, I don't want to deploy project to web server in every F5 ... Any help would be appreciated...
Visual Studio 2010 and Cassini web server can't make windows authentication! (Access Denied 401.2)
CC BY-SA 2.5
0
2011-01-12T09:34:45.783
2013-09-27T14:30:34.970
2011-01-12T10:06:52.553
104,085
104,085
[ "visual-studio-2010", "windows-authentication", "cassini" ]
4,667,266
1
4,668,788
null
11
4,465
I am writing a script for the [IDA Pro](http://www.hex-rays.com/idapro/) disassembler in Python using the [idapython](http://code.google.com/p/idapython/) plugin. Using this, I am able to fill in the gaps where IDA's auto-analysis falls short. One area that has me stumped is naming locations/functions with (for want of a better term) "pretty names". An example of what I mean is illustrated below: ![IDA pretty names sample screenshot](https://i.stack.imgur.com/eEcMK.png) `idapython` and IDA Pro itself only allow me to enter basic C-ish function names. If I enter disallowed symbols (e.g. the scope resolution operator), they're replaced with underscores. , if I enter a mangled name by hand (e.g. `__ZN9IOService15powerChangeDoneEm`), IDA Pro prettify this for me. Hence my question: how can I generate mangled names to pass through `idapython`? Is there a name-mangling library available? Is one available in Python? Is my only hope to tear the mangling functionality out of `g++` and work around that?
C++ name mangling by hand
CC BY-SA 2.5
0
2011-01-12T09:45:52.997
2016-07-07T17:40:20.433
2016-07-07T17:40:20.433
1,354,557
216,724
[ "python", "c++", "name-mangling", "ida" ]
4,667,310
1
4,682,933
null
0
4,519
i have big problem about CssFilePath property in ASPXGridView . also used Theme Deployer. i created ASPXGRidView that is goog in 9.3.4 version not problem is occured but i upgrated my system to 2010.2 version (Last version) but GridView CssFilePath not working my GridView looks html table. How can i solve it : ![alt text](https://i.stack.imgur.com/cncgl.png) i converted my project devexpress 9.3.4 to 2010.2 but My Working gridView look like this:TEST.ASCX has got a DevExpress GridView. ![alt text](https://i.stack.imgur.com/Zg456.png) ``` <Styles CssFilePath="../../App_Themes/Aqua/GridView/styles.css" CssPostfix="Aqua"></Styles> ``` i see asp.net design mode Aqua mode every thing ok. But press f5 my Gridview look above! how can i see aqua style...
How to Add Css style sheet on DevExpress Gridview?
CC BY-SA 2.5
0
2011-01-12T09:50:04.433
2011-01-13T17:09:04.783
2020-06-20T09:12:55.060
-1
52,420
[ ".net", "visual-studio-2010", "c#-4.0", "devexpress" ]
4,667,323
1
null
null
10
3,190
The following Mathematica code generates a highly oscillatory plot. I want to plot only the lower envelope of the plot but do not know how. Any suggestions wouuld be appreciated. ``` tk0 = \[Theta]'[t]*\[Theta]'[t] - \[Theta][t]*\[Theta]''[t] tk1 = \[Theta]''[t]*\[Theta]''[t] - \[Theta]'[t]*\[Theta]'''[t] a = tk0/Sqrt[tk1] f = Sqrt[tk1/tk0] s = NDSolve[{\[Theta]''[t] + \[Theta][t] - 0.167 \[Theta][t]^3 == 0.005 Cos[t - 0.5*0.00009*t^2], \[Theta][0] == 0, \[Theta]'[0] == 0}, \[Theta], {t, 0, 1000}] Plot[Evaluate [f /. s], {t, 0, 1000}, Frame -> {True, True, False, False}, FrameLabel -> {"t", "Frequency"}, FrameStyle -> Directive[FontSize -> 15], Axes -> False] ``` ![Mathematica graphics](https://i.stack.imgur.com/4LPje.png)
mathematica envelope detection data smoothing
CC BY-SA 3.0
0
2011-01-12T09:51:32.637
2012-01-03T20:17:07.857
2012-01-03T20:17:07.857
615,464
552,642
[ "math", "wolfram-mathematica" ]
4,667,431
1
null
null
0
383
> [Any guaranteed minimum sizes for types in C?](https://stackoverflow.com/questions/1738568/any-guaranteed-minimum-sizes-for-types-in-c) [C/C++: Size of builtin types for various compilers/platforms](https://stackoverflow.com/questions/1457431/c-c-size-of-builtin-types-for-various-compilers-platforms) ![alt text](https://i.stack.imgur.com/P9DlV.png) i have a question regarding c language in books it is written that size of int, float in c is one word ad two words respectively. these words are machine specific. for a 16 bit machine size of word is 16 bit and so size of int in c is 16 bit i.e. 2 byte. some say that size of int in c is operating system specific. because in windows it gives size of int is 2 byte and in linux size of int is 4 byte some say it is compiler specific because for tc size of int is 2 byte and for gcc it is 4 byte long mine is a intel pentium dual processor(hope it is 32 bit) and 32 bit os (shown in system properties) and i am using tc when i make show size of int in c program it shows 2 bytes. but if it is machine or os dependent it should show 4 byte long i am completely confused. please help me solving my prob (attached: my system's properties shown by computer)
confusion with size of variable in C
CC BY-SA 2.5
null
2011-01-12T10:01:37.850
2011-01-12T12:36:47.857
2017-05-23T12:07:07.397
-1
448,413
[ "c", "windows" ]
4,667,614
1
4,670,989
null
2
13,914
So the issue I'm having now is with UIWebViews displaying a single image. What I'd like is the image to be reduced if it doesn't fit the place, and keep it's original size if not. So here is how I do it (in a UIViewController): ``` - (void)viewDidLoad { [super viewDidLoad]; UIWebView *webView = [[UIWebView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 80)]; NSString *path =[[NSBundle mainBundle] bundlePath]; NSURL *baseUrl =[NSURL fileURLWithPath:path]; NSString *html = [NSString stringWithFormat:@"<html><head>" //THE LINE ABOVE IS TO PREVENT THE VIEW TO BE SCROLLABLE "<script>document.ontouchstart = function(event) { event.preventDefault(); }</script>" "</head><body style=\"text-align:center;margin:0;padding:0\">" "<img src=\"banner.gif\" />" "</body>" "</html>"]; webView.scalesPageToFit = YES; [webView loadHTMLString:html baseURL:baseUrl]; [self.view addSubview:webView]; [webView release]; } ``` This crops the image and makes the webview scrollable, which is not the desired behavior. So I started trying with some CSS int the image tag : ``` "<img style=\"width:100%\" src=\"banner.gif\" />" ``` or ``` "<img style=\"max-width:100%\" src=\"banner.gif\" />" ``` I don't know why, but 100% doesn't seem to be the width of the UIView, it's really small ! (the source image in the view is bigger than 320px, and here's the result :) ![Too Small Image](https://i.stack.imgur.com/h0plU.png) So I tried seting the body's width : ``` "</head><body style=\"width:100%;text-align:center;margin:0;padding:0\">" "<img style=\"width:100%\" src=\"banner.gif\" />" ``` And what that does is just preventing the "text-align" property to work. I tried also removing the text-align, because if the width fits the view, it's unnecessary, but it still doesn't work. I also tried set an image size to the view's width, but it doesn't work on retina devices then… I tried to set a viewport to device-width, but it doesn't change. Any idea on how to do this ? Here is [a little sample with 3 images I'd like to fit, in case you have time to have a look](http://stoeffler.cc/TestCenterWV.zip)
UIWebView with just an image that should fit the whole view
CC BY-SA 2.5
0
2011-01-12T10:19:49.580
2013-09-02T12:48:58.690
null
null
183,904
[ "iphone", "html", "css", "uiwebview" ]
4,667,671
1
null
null
1
933
I didn't understand very well RelativeLayout, I didn't understand why with this XML (it represent an item of a listview): ``` <?xml version="1.0" encoding="UTF-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/sfumatura_riga" > <ImageView android:id="@+id/featured_new_image" android:layout_alignParentLeft="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/no_foto" /> <LinearLayout android:layout_toRightOf="@id/featured_new_image" android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="5dp" > <TextView style="@style/featured_new_title" android:id="@+id/featured_city" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="5dp" android:layout_marginTop="10dp" /> <TextView style="@style/featured_name_country" android:id="@+id/featured_country" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout> <TextView style="@style/featured_date" android:id="@+id/featured_date" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="10dp" android:layout_marginRight="5dp" android:layout_alignParentRight="true" /> </RelativeLayout> ``` I meet this result, why too much margin at the bottom of the row? ![alt text](https://i.stack.imgur.com/U1vXI.png)
Relative Layout
CC BY-SA 2.5
0
2011-01-12T10:25:15.173
2011-01-12T12:06:03.717
null
null
554,892
[ "android" ]
4,667,757
1
null
null
0
1,062
Is there an API for opening a popup containing the same status update functionality as in the Facebook Wall? I basically want to open the following UI in a popup... ![Facebook Status Update](https://i.stack.imgur.com/4Cvuq.png) How can I do that?
Facebook standard status update popup?
CC BY-SA 2.5
0
2011-01-12T10:33:52.203
2011-01-12T13:04:15.597
null
null
160,574
[ "facebook" ]
4,667,794
1
4,667,859
null
0
180
I have a db file which I want to open using a firefox plugin. However, I can't open the file. I've also got other files like this with other file types. I'm sure I've had this problem before, any ideas ? ![alt text](https://i.stack.imgur.com/y6RKC.png) I've tried... ``` defaults write com.apple.finder AppleShowAllFiles TRUE killall Finder ``` But that didn't work.
How do I make certain files accessible in Mac OS X?
CC BY-SA 2.5
null
2011-01-12T10:37:44.200
2011-01-17T09:05:38.533
2011-01-12T10:49:57.843
366,904
450,456
[ "macos", "file", "finder" ]
4,667,935
1
4,679,316
null
1
1,283
This should be simple but it just eludes me now. I have an app in portrait mode, and when tilting the device into landscape mode, I just want all of the content to aspect scale down so that all content is displayed in the center of the screen, which would cause empty space on the left and right sides (this is fine). How do I set this up in Interface Builder? I have one containing UIView and am hoping that by having that one properly resized, all of the UIImageViews etc should also be aspect scaled down. ![alt text](https://i.stack.imgur.com/ftMom.jpg)
Automatically scaling UIView and all contents on rotation
CC BY-SA 2.5
0
2011-01-12T10:54:48.883
2011-01-13T11:02:03.070
null
null
129,202
[ "ios", "scaling" ]
4,668,178
1
null
null
0
5,395
![alt text](https://i.stack.imgur.com/W5J2q.png) I want to show level master detail data through a datagridview & C# in Windows application. Here I attached a picture where the master detail data is shown through grid. So please advice me how I can show data in this tree structure through datagridview in Windows apps with C#.
How to show multi level nested data through datagridview in C# Windows application?
CC BY-SA 3.0
0
2011-01-12T11:22:08.603
2015-07-05T06:46:25.937
2012-01-15T08:58:12.083
1,128,737
508,127
[ "c#", "datagridview" ]
4,668,231
1
4,934,571
null
2
3,118
I have data in the form of a 2D array of intensities that should be plotted in a contour plot. In the end it should look like a topographic map with contour lines like the following image: ![alt text](https://i.stack.imgur.com/Y7M2B.png) The idea is that the typical multitouch gestures (pinch for zooming, dragging for moving around) can be used to navigate the contour plot. The maximum size of the data should be around 4k*4k points, each 4 bytes big. Is there some plotting library that I can use, or do I have to start from scratch? Is there an easily implemented algorithm for that?
Creating interactive contour plots on Android
CC BY-SA 2.5
null
2011-01-12T11:27:19.120
2016-03-23T09:14:25.417
null
null
347,857
[ "java", "android", "plot" ]
4,668,266
1
4,668,683
null
15
23,143
I created a view which has three exposed filters. Everything works fine except the fact that I can neither translate or change the default string (-Any-) for the dropdowns. Is there a way to change this string to something more meaningful like "Please Select" and make it translatable so the German version displays "Bitte wählen"? I have two screen captures that may be helpful: ![the exposed filters](https://i.stack.imgur.com/HFVAD.png) and ![dropdown box](https://i.stack.imgur.com/8sLfb.png) A further improvement would be the ability to change the text "any" to something like "please select a (field name here)" but I am losing hope for that =) # UPDATE ### IMPORTANT: On further testing, I found that if you choose to display "-Any-" from "admin/build/views/tools", then THAT IS translatable.
How to change the label of the default value (-Any-) of an exposed filter in Drupal Views?
CC BY-SA 3.0
0
2011-01-12T11:31:06.377
2023-02-24T08:34:45.437
2020-06-20T09:12:55.060
-1
300,011
[ "drupal", "drupal-6", "drupal-views", "drupal-exposed-filter" ]
4,668,382
1
null
null
0
3,700
Can somebody plz post the xml layout code for this (have a look at the link), really don't get this done... Thanks. ![http://img832.imageshack.us/img832/6589/layouthelp.jpg](https://i.stack.imgur.com/0hq4l.jpg) ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout android:id="@+id/LinearLayout01" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" android:background="@drawable/background" android:layout_gravity="bottom" android:orientation="vertical" android:baselineAligned="false"> <ImageView android:id="@+id/ImageView01" android:layout_width="fill_parent" android:background="@drawable/logo" android:layout_height="wrap_content"></ImageView> <LinearLayout android:layout_gravity="center_vertical" android:id="@+id/LinearLayout02" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content"><Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/Button02" android:layout_gravity="right" android:text="@+id/Button02"></Button> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/Button03" android:text="@+id/Button03"></Button> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/Button01" android:layout_gravity="bottom" android:text="@+id/Button01"></Button> </LinearLayout> </LinearLayout> ```
Android layout XML code
CC BY-SA 3.0
null
2011-01-12T11:46:15.077
2019-12-30T10:50:47.830
2011-11-28T02:57:16.327
234,976
572,636
[ "android", "xml", "layout" ]
4,668,453
1
null
null
0
287
![alt text](https://i.stack.imgur.com/mxHIz.png) when I clicked on Browse *;80(http) I got this screen in IIS..what could wrong? please give me solution.
when I click on Browse &;80(http) i got this screen
CC BY-SA 2.5
null
2011-01-12T11:52:53.063
2011-01-18T19:38:59.230
null
null
568,585
[ "asp.net", "mysql", "iis" ]
4,668,432
1
4,672,015
null
6
3,972
I use [matplotlib](http://matplotlib.sourceforge.net/) to display a matrix of numbers as an image, attach labels along the axes, and save the plot to a PNG file. For the purpose of creating an HTML image map, I need to know the pixel coordinates in the PNG file for a region in the image being displayed by imshow. I have found [an example](http://hackmap.blogspot.com/2008/06/pylab-matplotlib-imagemap.html) of how to do this with a regular plot, but when I try to do the same with imshow, the mapping is not correct. Here is my code, which saves an image and attempts to print the pixel coordinates of the center of each square on the diagonal: ``` import numpy as np import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_axes([0.1, 0.1, 0.8, 0.8]) axim = ax.imshow(np.random.random((27,27)), interpolation='nearest') for x, y in axim.get_transform().transform(zip(range(28), range(28))): print int(x), int(fig.get_figheight() * fig.get_dpi() - y) plt.savefig('foo.png', dpi=fig.get_dpi()) ``` Here is the resulting foo.png, shown as a screenshot in order to include the rulers: ![Screenshot of foo.png with rulers](https://i.stack.imgur.com/RCzSQ.png) The output of the script starts and ends as follows: ``` 73 55 92 69 111 83 130 97 149 112 … 509 382 528 396 547 410 566 424 585 439 ``` As you see, the y-coordinates are correct, but the x-coordinates are stretched: they range from 73 to 585 instead of the expected 135 to 506, and they are spaced 19 pixels o.c. instead of the expected 14. What am I doing wrong?
How to map coordinates in AxesImage to coordinates in saved image file?
CC BY-SA 2.5
0
2011-01-12T11:50:24.623
2011-01-12T17:51:11.097
null
null
17,498
[ "python", "matplotlib" ]
4,668,871
1
null
null
32
119,449
i want to send email programmatically. i tried out the following code. > final Intent emailIntent = new Intent( android.content.Intent.ACTION_SEND);``` emailIntent.setType("plain/text"); emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[] { "[email protected]" }); emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Email Subject"); emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Email Body"); startActivity(Intent.createChooser( emailIntent, "Send mail...")); ``` but problem is that before sending email the application open the activity ![alt text](https://i.stack.imgur.com/E5L4g.png) i want to send email directly without open compose activity. how this possible?
Send auto email programmatically
CC BY-SA 2.5
0
2011-01-12T12:37:34.137
2020-02-06T10:20:48.647
2013-06-01T00:24:05.487
null
309,990
[ "android", "email" ]
4,669,029
1
4,669,542
null
1
2,207
You need to have several 200px wide DIVs (.item) inside a 620px wide DIV (.container). - - - See the figure bellow for a better understanding. How would you achieve it - margins, a table...? ![alt text](https://i.stack.imgur.com/DTwoB.png)
Positioning elements in a grid
CC BY-SA 2.5
null
2011-01-12T12:55:10.507
2011-01-12T13:55:15.537
2011-01-12T13:22:46.873
200,145
200,145
[ "html", "css" ]
4,669,238
1
4,669,299
null
1
225
![alt text](https://i.stack.imgur.com/C7Xc6.png)![alt text](https://i.stack.imgur.com/iTJJx.png) static NSString *CellIdentifier = @"Cell"; ``` UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@""]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; } cell.backgroundView = [[[CustomCell alloc] init] autorelease]; cell.selectedBackgroundView = [[[CustomCell alloc] init] autorelease]; // At end of function, right before return cell: cell.textLabel.backgroundColor = [UIColor clearColor]; // Configure the cell. UILabel *myLabel1 = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 300, 45)]; UILabel *myLabel2 = [[UILabel alloc] initWithFrame:CGRectMake(5, 55, 300, 20)]; UILabel *myLabel3 = [[UILabel alloc] initWithFrame:CGRectMake(0, 68, 300, 60)]; Book *aBook = [appDelegate.books objectAtIndex:indexPath.row]; myLabel1.text=aBook.title; myLabel2.text=aBook.pubDate; myLabel3.text=aBook.description; //myLabel1.lineBreakMode=UILineBreakModeCharacterWrap; myLabel1.lineBreakMode=UILineBreakModeWordWrap; myLabel1.numberOfLines=1; myLabel1.textColor=[UIColor redColor]; myLabel1.backgroundColor = [UIColor blueColor]; myLabel1.font=[UIFont systemFontOfSize:14]; myLabel2.font=[UIFont systemFontOfSize:12]; myLabel3.textAlignment=UITextAlignmentLeft; myLabel3.textColor=[UIColor blueColor]; myLabel3.lineBreakMode=UILineBreakModeCharacterWrap; myLabel3.numberOfLines=3; //myLabel3.lineBreakMode=UILineBreakModeWordWrap; myLabel3.lineBreakMode=UILineBreakModeTailTruncation; myLabel3.font=[UIFont systemFontOfSize:14]; //myLabel1.shadowColor=[UIColor redColor]; //myLabel1.backgroundColor=[UIColor grayColor]; [cell.contentView addSubview:myLabel1]; [cell.contentView addSubview:myLabel2]; [cell.contentView addSubview:myLabel3]; //cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; [myLabel1 release]; [myLabel2 release]; [myLabel3 release]; //Set up the cell return cell; ``` guys i have these codings. in mylabel 1 if i sets to 2, the text goes down so i cant see. now finally i want to display 2lines of Title, 1 line of pubDate and 3 Lines of Description in one row. i have displayed but i need some alignment i.e. above points, it should remove HTML(&mdash) tags i dont know hw to customizing this.struggling with this.pls help me out
nsxmlparse Tableview Alignment
CC BY-SA 2.5
null
2011-01-12T13:20:06.793
2012-11-28T12:42:23.023
2011-01-12T14:12:48.657
543,745
543,745
[ "iphone", "tableview" ]
4,669,583
1
4,669,634
null
4
2,391
I have a problem with following tutorial: [http://www.mkyong.com/jsf2/jsf-2-internationalization-example/](http://www.mkyong.com/jsf2/jsf-2-internationalization-example/) In faces-context file you have to declare the place where all the language properties-files are (`<base-name>HERE</base-name>`). But in that example they use apparently maven2 and so they have a resource folder. I am using eclipse and dynamic web project, that's why there is no resource folder. I tried a few possibilities like adding a new folder to the build path but I don't get it work. Can you tell me please where to place those files to let my app find it. thank you so much In addition I add a picture of my directory-structure: ![alt text](https://i.stack.imgur.com/rC3cQ.jpg)
Java EE Directory Structure
CC BY-SA 3.0
null
2011-01-12T13:58:20.013
2012-12-02T18:11:36.483
2012-12-02T18:11:36.483
472,792
389,430
[ "java", "jsf", "resources", "internationalization" ]
4,669,704
1
4,669,738
null
33
53,994
I have Visual Studio 2010 Premium installed, and I want to install the Silverlight 4 SDK. The SDK says that it requires the Visual Web Developer feature for Visual Studio 2010. Any idea as to how to install, or activate this feature? --- ![enter image description here](https://i.stack.imgur.com/orCLl.png)
How do I install the Visual Web Developer feature for Visual Studio 2010
CC BY-SA 3.0
0
2011-01-12T14:09:51.410
2017-03-08T07:49:59.967
2013-03-26T11:57:29.337
284,795
394,157
[ "visual-studio", "visual-studio-2010", "visual-web-developer" ]
4,670,128
1
4,670,329
null
2
1,388
I have some tasks in the tree structure and I wish to display only tasks which belongs to the current user as the list, but from all levels. What I've done is the function to display a list, which hides tree buttons, tree lines, sets the fixed indent and enable toShowHiddenNodes option. Then in this function I iterate through the whole tree (all levels) and hide nodes which doesn't belong to the current user and show those which belongs him , but the subnodes which should be displayed are invisible when their parent is hidden. VT.TreeOptions.PaintOptions - toShowButtons - toShowTreeLines + toFixedIndent + toShowHiddenNodes ![alt text](https://i.stack.imgur.com/FmlE5.jpg)
Virtual String Tree - Display subnode when parent node is hidden
CC BY-SA 2.5
0
2011-01-12T14:52:05.583
2011-01-12T15:12:11.443
null
null
null
[ "delphi", "virtualtreeview" ]
4,670,196
1
4,674,774
null
0
661
I am looking for useful tips for reducing or removing triangle overlapping in Away3D. I already tried to increas segmentsW and segmentsH but it doesn't solve the problem. Here is a snapshot of my problem (The complex cubes are made of Plane objects, Maybe there is a better way to build the complex cubes ?) : ![alt text](https://i.stack.imgur.com/v3RjH.jpg) ![alt text](https://i.stack.imgur.com/9eWN9.jpg) Alternatively does other flash 3d engines produces betters results ?
How to reduce or remove triangles overlapping in Away3D
CC BY-SA 2.5
null
2011-01-12T14:58:44.627
2011-01-12T22:35:12.927
2020-06-20T09:12:55.060
-1
30,871
[ "actionscript-3", "away3d" ]
4,670,421
1
4,670,552
null
0
173
I would like my Rails app to somehow generate forum signature images, like this one: ![alt text](https://i.stack.imgur.com/NnV4b.jpg) I couldn't really find anything on Google. Have anyone seen any kind of implementation of this in Ruby (I'm guessing with ImageMagick) ? If not, how can I go about doing this?
Ruby/Rails - Forum signature images
CC BY-SA 2.5
null
2011-01-12T15:20:21.033
2011-01-12T15:36:29.250
null
null
451,945
[ "ruby-on-rails", "ruby", "imagemagick" ]
4,670,420
1
null
null
3
17,456
I am using which has VBA version 14.0. I am trying to use this code which accesses the , which I know works on Windows: ``` Function qfil_GetDirectory(strDirectoryName As String) Dim objFSO As Variant Dim objDirectory As Variant Set objFSO = CreateObject("Scripting.FileSystemObject") Set objDirectory = objFSO.GetFolder(strDirectoryName) Set qfil_GetDirectory = objDirectory End Function ``` However, when I run it in Excel for Mac 2011, it gives me this : > Run-time error 429 Object creation with ActiveX component not possible To fix this on Windows, I know I have to just reference a specific under tools. However on the Mac, when I go under it gives me these: ![alt text](https://i.stack.imgur.com/BFQmW.png) And none of them allow me to use `Scripting.FileSystemObject`.
How can I install/use "Scripting.FileSystemObject" in Excel 2010 for MAC?
CC BY-SA 2.5
null
2011-01-12T15:20:09.247
2020-07-03T07:16:11.030
2020-07-03T07:16:11.030
100,297
4,639
[ "excel", "vba", "macos" ]
4,670,458
1
4,670,611
null
0
591
I'm rewriting some old cold in my new project and I'm sure I've come across this before, but I can't find the problem. I can't seem to find a tableView outlet, with the lower case t it looks like its specified in code. But it could be using a reserved keyword and I have to use an option in the Ib to use it. Just not sure how to get hold of it ? Heres the old project, with tableView ![alt text](https://i.stack.imgur.com/m8kXT.png) Heres my new project ![alt text](https://i.stack.imgur.com/q2Kuj.png) ``` h file #import <UIKit/UIKit.h> @class OverlayViewController; @interface RootViewController : UITableViewController { NSMutableArray *listOfItems; NSMutableArray *copyListOfItems; IBOutlet UISearchBar *searchBar; BOOL searching; BOOL letUserSelectRow; OverlayViewController *ovController; } - (void) searchTableView; - (void) doneSearching_Clicked:(id)sender; @end ```
iPhone, Missing outlet tableView?
CC BY-SA 2.5
null
2011-01-12T15:23:11.147
2011-01-12T19:31:05.917
2011-01-12T19:31:05.917
450,456
450,456
[ "iphone", "xcode", "uitableview" ]
4,670,528
1
5,011,584
null
13
33,296
Create a new UIViewController: - Xcode -> New File... -> Cocoa Touch Class -> UIViewController - Name: MyViewController Drag and drop a "Navigation Controller" (UINavigationController) from the Library to MyViewController.xib ![alt text](https://i.stack.imgur.com/Wkdt4.jpg) I'm sure, I have to do something to connect the Navigation Controller correctly, isn't it? Try to start the new View Controller as a modal dialog: ``` MyViewController *myViewController = [[MyViewController alloc] initWithNibName:@"MyViewController" bundle:nil]; NSLog(@"navContr: %@", myViewController.navigationController); [self.navigationController presentModalViewController: myViewController animated:YES]; ``` Result: "navContr: nil" You can see the new modal view (MyViewController), but there's no NavigationController and no UINavigationBar. Thank you very much for your help! --- I set a new UIViewController (ViewNavi2) as "Root View Controller": ![alt text](https://i.stack.imgur.com/VbcqC.png) I define a `IBOutlet UINavigationController *navigationController` in the class MyViewController and configure the xib: Navigation Controller -> Connections -> Referencing Outlets But my Navigation Controller is still nil :-( ``` MyViewController *myViewController = [[MyViewController alloc] initWithNibName:@"MyViewController" bundle:nil]; NSLog(@"navContr: %@", myViewController.navigationController); // -> "navContr: nil" ```
How to add a Navigation Controller with Interface Builder?
CC BY-SA 2.5
0
2011-01-12T15:29:48.653
2012-01-13T15:03:59.247
2011-01-13T16:56:06.373
184,060
509,535
[ "iphone", "objective-c", "ios", "interface-builder", "uinavigationcontroller" ]
4,670,579
1
4,674,610
null
5
3,615
How do you remove/reduce the spacing between checkboxes ? ![alt text](https://i.stack.imgur.com/5wFhF.png) ``` import java.util.Arrays; import javax.swing.JCheckBox; import javax.swing.JFrame; import javax.swing.JPanel; import net.miginfocom.swing.MigLayout; public class CheckboxSpacing { public static void main(String[] args) { JFrame frame = new JFrame("checkbox spacing"); JPanel panel = new JPanel(); frame.setContentPane(panel); panel.setLayout(new MigLayout()); for (String verb : Arrays.asList("see","hear","speak")) { JCheckBox cb = new JCheckBox(verb+" no evil"); panel.add(cb, "wrap"); } frame.pack(); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } } ``` --- : I'm wondering maybe if the MigLayout part of this question is a red herring. If I change my program to the following, I get these dialogs: ![alt text](https://i.stack.imgur.com/kFVkk.png) ![alt text](https://i.stack.imgur.com/fPkUo.png) You will note the difference in spacing between labels and checkboxes. How can I get rid of the excess spacing for checkboxes? ``` import java.awt.Component; import java.util.Arrays; import javax.swing.JCheckBox; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import net.miginfocom.swing.MigLayout; public class CheckboxSpacing { enum WhichGUI { LABEL { @Override public Component createComponent(String text) { return new JLabel(text); } }, CHECKBOX { @Override public Component createComponent(String text) { return new JCheckBox(text); } }; abstract public Component createComponent(String text); } public static void main(String[] args) { doit(WhichGUI.LABEL); doit(WhichGUI.CHECKBOX); } private static void doit(WhichGUI which) { JFrame frame = new JFrame("spacing: "+which); JPanel panel = new JPanel(); frame.setContentPane(panel); panel.setLayout(new MigLayout( "", //layout "[]", //column "0" //row )); for (String verb : Arrays.asList("see","hear","speak")) { Component c = which.createComponent( verb+" no evil (Jabberwocky! Çgpq)"); panel.add(c, "wrap 0"); } frame.pack(); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } } ```
Swing: checkbox spacing as compared to labels
CC BY-SA 2.5
0
2011-01-12T15:33:34.443
2011-01-12T22:14:56.147
2011-01-12T16:11:31.447
44,330
44,330
[ "java", "swing", "checkbox", "label", "spacing" ]
4,670,657
1
4,670,688
null
0
195
I need help in determing the data structure for this problem. The data is we have type and sub-type and mostly sub-type is null, but for very few types, sub-type has a value. I need to read the data from source tables which is available in another table. Which data structure I can use on the application to store all this information? The application has no information about the Type_id. its only for the database. So we should save Type, SubType, Source Table in the data structure. ![alt text](https://i.stack.imgur.com/SjNe6.jpg)
Which data structure should I use for this particular problem?
CC BY-SA 2.5
null
2011-01-12T15:39:14.987
2011-01-12T16:34:37.483
null
null
495,188
[ "c#", "oracle", "data-structures" ]
4,670,702
1
4,670,718
null
0
202
I want to add a little html popup that opens a user clicks on a "log in" link. Then a little window should open up where I can put the form fields for logging in. I want it to look like the one in the image, which I have seen on multiple sites. ![alt text](https://i.stack.imgur.com/7bzf0.jpg) How can I do that? Thanks for the help!
How can I create an HTML popup?
CC BY-SA 2.5
null
2011-01-12T15:42:58.803
2011-01-12T15:47:56.567
null
null
487,060
[ "html" ]
4,670,877
1
4,671,083
null
1
167
``` <FrameLayout android:id="@+id/FrameLayout02" android:layout_height="fill_parent" android:layout_width="fill_parent" > <TabHost android:id="@+id/tabhost" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="fill_parent" /> <FrameLayout android:id="@android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingTop="62px"> <EditText android:id="@+id/VisualPane" android:layout_width="fill_parent" android:layout_height="fill_parent" /> <EditText android:id="@+id/HTMLPane" android:layout_width="fill_parent" android:layout_height="fill_parent" /> </FrameLayout> </TabHost> </FrameLayout> ``` How Can I decrease this distance? ![http://s47.radikal.ru/i118/1101/92/6844493547b4.jpg](https://i.stack.imgur.com/l18zn.jpg) I have tried to change the attribute ``` android:paddingTop="62px" ``` But it is useless.
How Can I decrease the distance in the TabHost?
CC BY-SA 2.5
null
2011-01-12T15:58:17.007
2011-01-12T16:17:11.797
null
null
565,447
[ "android", "android-tabhost" ]
4,670,905
1
4,671,027
null
4
2,398
How would you build a Facebook-style input box in GWT? The following picture shows what I mean by Facebook-style input box: ![alt text](https://i.stack.imgur.com/h2g04.jpg) When typing a list of people is displayed, when a person is selected it will be displayed inside of the textbox.
How to build a Facebook-style input box in GWT
CC BY-SA 2.5
0
2011-01-12T16:00:47.693
2011-01-12T19:49:14.247
2011-01-12T16:14:18.540
25,741
25,741
[ "gwt" ]
4,671,238
1
4,671,684
null
26
11,646
I'm trying to use Graphviz dot (but am willing to use something else) to generate a graph with a long "main line" of nodes, and many small branches. I'd like the main line to be straight from left to right, with the small branches above or below it. However, Graphviz "balances" the two branches, so I end up with a crooked graph. To illustrate, here's a sketch similar to what I currently get: ![Current Graph](https://i.stack.imgur.com/Tdz16.png) And this is what I actually want: ![Wanted graph](https://i.stack.imgur.com/iIsqQ.png) Is there any way to force or encourage Graphviz to generate a graph like the second one? I may be able to use "dummy" second branches to have it do a 3-way layout, and then hide/delete the dummies afterward, but if there's a better option that would be preferable.
Forcing "main line" nodes into a straight line in Graphviz (or alternatives)
CC BY-SA 2.5
0
2011-01-12T16:31:47.103
2011-01-12T20:20:46.617
null
null
41,665
[ "graphviz", "dot" ]
4,671,394
1
4,671,452
null
3
10,481
Is there a way to increase the maximum 10 GB size limit of SQL Express? [http://www.microsoft.com/express/Database/](http://www.microsoft.com/express/Database/) [http://www.microsoft.com/sqlserver/2008/en/us/editions-compare.aspx](http://www.microsoft.com/sqlserver/2008/en/us/editions-compare.aspx) ![alt text](https://i.stack.imgur.com/UAWJW.jpg)
Is there a way to increase the maximum 10 GB size limit of SQL Express?
CC BY-SA 3.0
0
2011-01-12T16:44:38.720
2012-06-01T12:10:30.940
2012-06-01T12:10:30.940
76,465
521,066
[ "asp.net", "sql-server-express" ]
4,671,563
1
4,671,793
null
1
4,978
I've been working on my project using a Subversion branch. I've used the branching feature a few times before without any issues, until today. I've come to merge back into the trunk, and noticed that not everything from my branch was there. I go back to my project folder which I've been committing to the branch and look at the log messages using TortoiseSVN (the command line basic log command shows the same). See the attached image. The revision numbers go up incrementally, until revision 303 (the last trunk revision was 299). Then there are numbers missing. The revision number of the latest commit, about half an hour ago was 316, but it doesn't show up in the log for the branch. Trying to commit the files again doesn't do anything. I am the only person committing to this repository at present. The missing revisions do not show up in the log for the trunk project. What's going on here. Is this a bug or am I doing something wrong? [VisualSVN](http://en.wikipedia.org/wiki/VisualSVN)[TortoiseSVN](http://en.wikipedia.org/wiki/TortoiseSVN) ![Alt text](https://i.stack.imgur.com/nfOT8.png)
Has Subversion lost some of my revisions in a branch?
CC BY-SA 3.0
0
2011-01-12T16:58:18.877
2014-10-21T09:10:06.043
2014-10-21T09:10:06.043
761,095
341,062
[ "svn", "tortoisesvn", "visualsvn" ]
4,671,633
1
4,672,195
null
1
226
Here is the code: ``` <Window x:Class="WpfWindow.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" Topmost="True" WindowStyle="None" ResizeMode="NoResize" d:DesignHeight="300" d:DesignWidth="300" SizeToContent="WidthAndHeight" WindowStartupLocation="CenterScreen"> <Label Content="Test label" /> </Window> ``` It produces the following image: ![alt text](https://i.stack.imgur.com/IKgwj.png) It seems to reproduce constantly with as long as the following parameters are set: - - - I hoped it'd disappear if I set a border color for the window, however, it stays there even if I do that... Anyone has an idea of how I can make this line disappear? Thanks!
A strange ghost line appearing in WPF near Label with WindowStyle="None"
CC BY-SA 2.5
0
2011-01-12T17:04:27.573
2011-01-12T18:22:52.527
null
null
126,574
[ ".net", "wpf", "xaml" ]
4,672,551
1
4,752,224
null
2
1,695
I have a Listbox with styles, including Listboxitem with styles. I am trying to create an animation that changes opacity from 0 to 1, to make items show on the list. I've managed to do this with the following code: ``` <Style x:Key="ListBoxStyle1" TargetType="ListBox"> <Setter Property="Foreground" Value="#FF393C3F" /> <Setter Property="OverridesDefaultStyle" Value="true"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="ListBox"> <Border Name="Border" Background="{x:Null}" BorderBrush="Black" BorderThickness="0" Padding="0"> <ItemsPresenter /> </Border> </ControlTemplate> </Setter.Value> </Setter> </Style> <Style x:Key="ListBoxItemStyle1" TargetType="ListBoxItem"> <Setter Property="Opacity" Value="0" /> <Setter Property="Height" Value="16" /> <Setter Property="VerticalContentAlignment" Value="Bottom" /> <Setter Property="VerticalAlignment" Value="Bottom" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="ListBoxItem"> <Border Name="Border" Padding="10,1,0,0" Background="{x:Null}"> <ContentPresenter VerticalAlignment="Center" SnapsToDevicePixels="True" /> </Border> <ControlTemplate.Triggers> <Trigger Property="IsSelected" Value="true"> <Setter TargetName="Border" Property="Background" Value="{StaticResource arrow}" /> </Trigger> <Trigger Property="IsMouseOver" Value="true"> <Setter Property="Foreground" Value="#FF828689" /> </Trigger> <Trigger Property="IsVisible" Value="true"> <Trigger.EnterActions> <BeginStoryboard> <Storyboard> <DoubleAnimation Storyboard.TargetProperty="Opacity" From="0.0" To="1.0" Duration="0:0:0.4" /> </Storyboard> </BeginStoryboard> </Trigger.EnterActions> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> ``` The thing works as it should (apart from that I want more time to pass between current and next item animation start. But it has a problem with opacity. Everything possible is set to transparent, backgrounds and all. And I use transparent .png brush for selected item. The problem is with the opacity animation and is best seen on the bottom picture: ![Screenshot](https://i.stack.imgur.com/RebNO.png) This is a screenshot in the middle of animation (at the time the opacity of the listboxitems is 0.8) and you can clearly see white background around all text. It's even more visible in the first selected item, because it uses transparent .png. This background magically dissapears when animation is finished and the opacity is 1.0. How to fix this problem? Did I forget to set any background perhaps? Thank you for your help! Edit: I am adding my listbox declaration: ``` <ListBox Height="239" HorizontalAlignment="Left" Margin="0,0,0,0" Name="listBox1" VerticalAlignment="Top" Width="145" Background="{x:Null}" FontWeight="Black" FontSize="8" BorderBrush="{x:Null}" SnapsToDevicePixels="True" BorderThickness="0" ItemContainerStyle="{StaticResource ListBoxItemStyle1}" Style="{StaticResource ListBoxStyle1}"> <ListBox.ItemsPanel> <ItemsPanelTemplate> <VirtualizingStackPanel VerticalAlignment="Top" Background="{x:Null}" /> </ItemsPanelTemplate> </ListBox.ItemsPanel> </ListBox> ``` Also another question is: How to delay the animation that each listboxitem would be displayed with a delay of few milliseconds before the next one? Thank you for all your help.
ListBoxItem animation and opacity
CC BY-SA 3.0
0
2011-01-12T18:35:19.893
2012-05-30T20:27:48.597
2012-02-01T23:23:04.923
546,730
573,186
[ "c#", "wpf", "xaml", "animation", "wpf-controls" ]
4,672,584
1
4,683,465
null
2
1,384
In a UIScrollViewDelegate class on iOS 4.2.1 in my iPad app, the `-scrollViewDidEndDecelerating:` method calls another method that does, this: ``` EntryModel *entry = [entries objectAtIndex:index]; self.titleLabel.text = entry.title; ``` `title` is a nonatomic, retained NSString property of EntryModel. `titleLabel` is a nonatomic, retained property with an IBOutlet connecting it to a UILabel defined in a nib. Following bbum's [blog post](http://www.friday.com/bbum/2010/10/17/when-is-a-leak-not-a-leak-using-heapshot-analysis-to-find-undesirable-memory-growth/), I've been using Heapshot analysis and have identified the above code as a leak. Nearly every time I scroll to a new page, `titleLabel` leaks a bit: ![alt text](https://i.stack.imgur.com/v1fBa.png) If I change that second line to: ``` self.titleLabel.text = @"Whatever"; ``` The leaking stops: ![alt text](https://i.stack.imgur.com/OKIdB.png) I'm confused. Is `-[UILabel text]` not releasing old values before assigning new values? I'm assuming not, that I must be doing something wrong. Why does this leak?
Why Does `-[UILabel setText:]` Leak?
CC BY-SA 2.5
null
2011-01-12T18:38:55.807
2011-01-13T18:02:35.693
null
null
79,202
[ "cocoa-touch", "memory-leaks", "uilabel", "uiscrollviewdelegate" ]
4,672,899
1
4,673,045
null
2
2,039
EDIT -- so looked at Cache#15 and MemoryStore#9 in JVisualVM. Turns out it is the query cache. Hopefully dropping a cache configuration in conf that limits the query cache to less than 10k items (the default) will solve this... --- We have a Grails application (v1.2.0) deployed on tomcat 6x. Experienced an OOM crash. Got the heap dump and started analyzing it in JVisualVM. This is what I am seeing ![alt text](https://i.stack.imgur.com/4UGVk.png) and this ![alt text](https://i.stack.imgur.com/siA0d.png) so lots of ehcache stuff, and definitely lots of byte and char arrays. I have tried googling around 'grails memory leak ehcache' but nothing definitive is coming up. Has anyone seen any issues like this or have any insights into what can be causing this? Could it be a misconfigured ehcache? We are using various plugins(acegi, quartz, mail, background-thread), all the the latest versions FOR grails version 1.2.0. EDIT - some more info starting tomcat with the following ``` -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Xms1024m -Xmx2048m -XX:MaxPermSize=256m -d64 -server -XX:+HeapDumpOnOutOfMemoryError -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled -XX:+UseConcMarkSweepGC ``` and the error is ``` java.lang.OutOfMemoryError: Java heap space ``` Interestingly, we used to get perm gen space related errors, but when i updated to the Java configuration shown above, the permgen space errors went away.
analysis of memory issue
CC BY-SA 2.5
null
2011-01-12T19:06:18.270
2011-01-13T18:04:38.637
2011-01-13T18:04:38.637
305,644
305,644
[ "java", "grails", "out-of-memory" ]
4,673,109
1
4,677,236
null
0
443
The problem is: I get a NullReferenceException but I can't seem to find out why. (I just start with C#) and have read the C# for kids from Microsoft. It explained a lot but this I do not understand. But I don't get the piece of code which throw the exception to my head. Code is: ``` using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO.Ports; using PlugwiseLib.BLL.BC; using plugwiseLib.BLL.BPC; using System.Text.RegularExpressions; using System.Threading; using System.IO; using PlugwiseLib.BLL.BPC; using PlugwiseLib.UTIL; namespace PlugwiseLib { public class plugwiseControl { private SerialPort port; private PlugwiseActions currentAction; public delegate void PlugwiseDataReceivedEvent(object sender, System.EventArgs e, List<PlugwiseMessage> data); public event PlugwiseDataReceivedEvent DataReceived; private PlugwiseReader reader; /// <summary> /// Constructor for the Plugwise Control class /// </summary> /// <param name="serialPort">The serial port name that the plugwise stick takes</param> public plugwiseControl(string serialPort) { try { port = new SerialPort(serialPort); port.DataReceived += new SerialDataReceivedEventHandler(port_DataReceived); port.BaudRate = 115200; currentAction = PlugwiseActions.None; reader = new PlugwiseReader(); } catch (Exception e) { throw new Exception("Could not connect to plug."); } } /// <summary> /// This is the method that sends a command to the plugwise plugs. /// </summary> /// <param name="mac">The mac adress of the plug that needs to perform the action</param> /// <param name="action">The action that has to be performed</param> public void Action(string mac,PlugwiseActions action) { try { string message = ""; switch (action) { case PlugwiseActions.On: currentAction = PlugwiseActions.On; message = PlugwiseSerialPortFactory.Create(PlugwiseSerialPortRequest.on,mac); break; case PlugwiseActions.Off: currentAction = PlugwiseActions.Off; message = PlugwiseSerialPortFactory.Create(PlugwiseSerialPortRequest.off, mac); break; case PlugwiseActions.Status: currentAction = PlugwiseActions.Status; message = PlugwiseSerialPortFactory.Create(PlugwiseSerialPortRequest.status, mac); break; case PlugwiseActions.Calibration: currentAction = PlugwiseActions.Calibration; message = PlugwiseSerialPortFactory.Create(PlugwiseSerialPortRequest.calibration, mac); break; case PlugwiseActions.powerinfo: currentAction = PlugwiseActions.powerinfo; message = PlugwiseSerialPortFactory.Create(PlugwiseSerialPortRequest.powerinfo,mac); break; case PlugwiseActions.history: message = ""; break; } if (message.Length > 0) { port.WriteLine(message); Thread.Sleep(10); } } catch (Exception e) { throw e; } } /// <summary> /// This is the method that sends a command to the plugwise plugs that retrieves the history power information /// </summary> /// <param name="mac">The mac adress of the plug that needs to perform the action</param> /// <param name="logId">The id of the history message that has to be retrieved</param> /// <param name="action">The action that has to be performed this MUST be history</param> public void Action(string mac,int logId,PlugwiseActions action) { string message = ""; switch(action) { case PlugwiseActions.history: currentAction = PlugwiseActions.history; message = PlugwiseSerialPortFactory.Create(PlugwiseSerialPortRequest.history, MessageHelper.ConvertIntToPlugwiseLogHex(logId), mac); break; } if (message.Length > 0) { port.WriteLine(message); Thread.Sleep(10); } } private void port_DataReceived(object sender, SerialDataReceivedEventArgs e) {// Event for receiving data string txt = port.ReadExisting(); List<PlugwiseMessage> msg = reader.Read(Regex.Split(txt, "\r\n")); DataReceived(sender, new System.EventArgs(), msg); } /// <summary> /// This method Opens the connection to the serial port /// </summary> public void Open() { try { if (!port.IsOpen) { port.Open(); } } catch (System.IO.IOException ex) { throw ex; } } /// <summary> /// This method closes the connection to the serial port /// </summary> public void Close() { try { if (port.IsOpen) { port.Close(); } Thread.Sleep(5); } catch (IOException ex) { throw ex; } } } } ``` I get the exception at this piece (in Visual C# 2008 express) ``` private void port_DataReceived(object sender, SerialDataReceivedEventArgs e) {// Event for receiving data string txt = port.ReadExisting(); List<PlugwiseMessage> msg = reader.Read(Regex.Split(txt, "\r\n")); DataReceived(sender, new System.EventArgs(), msg); ``` ![alt text](https://i.stack.imgur.com/JTzmL.jpg) I checked 'msg' but this is filled with so far i can see valid data. So I don't know why I get the exception.
NullReferenceException when Firing an Event
CC BY-SA 4.0
null
2011-01-12T19:28:16.467
2018-12-26T06:44:20.493
2018-12-26T06:44:20.493
1,033,581
154,579
[ "c#", "nullreferenceexception" ]
4,673,230
1
null
null
1
335
`KeyValuePair` doesn't implement `INotifyPropertyChanged`, so I've implemented my own `Pair` type, but I want to use it in a dictionary. What's the easiest way to do that? --- So here's the deal. In my code I need a dictionary with key/value pairs. This doesn't really need to be observable. I have an edit window though, that displays this dict in a datagrid. That needs to be observable so that the datagrid can work its magic. So what I've done is make make the edit window accept any enumerable of pairs: ``` public ObservableCollection<Pair<string,object>> Variables { get; private set; } public VariablesWindow(IEnumerable<Pair<string, object>> vars) { Variables = new ObservableCollection<Pair<string, object>>(vars.DeepCopy()); ``` So that it can do its thing. And then in the main code I use a dict like normal, but when I open the edit window I have to convert the dict into something the edit window can use: ``` var window = new VariablesWindow(Dict2Enum(_dict)); ``` So I've added these 2 helper methods: ``` private static IEnumerable<Pair<TKey, TValue>> Dict2Enum<TKey, TValue>(Dictionary<TKey, TValue> dict) { return dict.Select(i => new Pair<TKey, TValue>(i.Key, i.Value)); } private static Dictionary<TKey, TValue> Enum2Dict<TKey, TValue>(IEnumerable<Pair<TKey, TValue>> collection) { return collection.ToDictionary(p => p.Key, p => p.Value); } ``` Seems a bit expensive though. I'm looping over the collection twice now. Once to convert the dictionary to an enumerable, then again to deep copy it so that the variables don't get changed until the user hits save, and then I convert that enumerable into an observable collection. ![](https://i.stack.imgur.com/uwsc7.png)
Need a dict with my own custom Pair type?
CC BY-SA 2.5
null
2011-01-12T19:39:45.197
2011-01-12T21:20:47.017
2011-01-12T21:20:47.017
546,730
65,387
[ "c#", "dictionary" ]
4,673,446
1
4,673,684
null
3
1,268
We manage our inventories in Excel. I know its little old fashioned but we are developing business firm, and we have all our money blocked in business and no money to invest in IT. So I wanted to know can I program in a way that excel automatically completes the product numbers? This is example of one product category ![Example](https://i.stack.imgur.com/CyLPw.png) All our design codes are of 6 digits, What I really want is that when only partial number is added and hit enter it automatically completes the remaining digits by taking the above numbers. So for example in this case what I am expecting is, if I type `5` hit enter it automatically makes it `790705` based on above number.
Excel Programming for auto-complete of partial input (numbers)
CC BY-SA 2.5
null
2011-01-12T20:03:38.707
2011-01-12T23:26:04.560
null
null
107,129
[ "excel", "vba" ]
4,673,973
1
4,674,051
null
0
730
I have been using Ubuntu for a while, and now trying to use OS X's terminal. However, the folder/name spacing in OS X's terminal really bothers the heck out of me because it's uneven, please see: ![alt text](https://i.stack.imgur.com/iqPrg.png) You can tell that the spacing in line 2 and 5 and line 8 are different and uneven. Does any guru know of a fix for this? Thanks.
Mac OS X - Terminal folder/file name spacing fix?
CC BY-SA 2.5
null
2011-01-12T20:56:52.910
2011-01-12T21:04:05.423
null
null
null
[ "macos", "terminal" ]
4,674,238
1
4,674,395
null
1
1,699
I'm having trouble with my ASP.NET MVC 2 form validation and setting my style. Here is an example of my form, with a validation error: ![alt text](https://i.stack.imgur.com/mn1Qt.png) The field uses the following html: ``` <div class="registration-field"> <label>FullName</label><%= Html.TextBoxFor(x => x.FullName) %> <%= Html.ValidationMessageFor(x => x.FullName)%> </div> ``` The problem is, to show the highlight across the entire element, I need to add the CSS class "registration-field-error" to the first div. ``` <div class="registration-field registration-field-error"> <label>FullName</label><%= Html.TextBoxFor(x => x.FullName) %> <%= Html.ValidationMessageFor(x => x.FullName)%> </div> ``` The CSS for registration-field-error is: ``` .registration-field-error { background-image:url(../Content/Images/box-background-error.png); background-repeat:repeat-y; } ``` I can do some complicated logic to check the ViewState for errors, which works fine for server validation errors, but not for client-side validation: ``` <% if (ViewData.ModelState["FullName"] == null) { %> <div class="registration-field"> <% } else { %> <div class="registration-field registration-field-error"> <% } %> ``` My first thought was to make a new Html helper to decide if it should use the registration-field-error class: ``` <%= Html.FormFieldFor(x => x.FullName, ViewData.ModelState) %> ``` And then editing the MicrosoftMvc.Ajax.js script to add the class when it detects clientside validation errors. Or, is there a better way to accomplish this?
ASP.NET MVC 2 Validation Error Styles
CC BY-SA 2.5
null
2011-01-12T21:26:47.857
2011-01-12T23:03:23.883
2011-01-12T21:34:39.890
108,602
108,602
[ "jquery", "asp.net-mvc", "ajax", "model-view-controller" ]