{"QuestionId": 10852477, "AnswerCount": 1, "Tags": "", "CreationDate": "2012-06-01T14:47:37.910", "AcceptedAnswerId": null, "Title": "How to simulate Full IE cache for ASP.NET or Silverlight app", "Body": "

What is the best approach to similate a browser full cache when debugging a Silverlight or ASP.NET application? There is some intermittent behaviour that I want to make a determination if browser cache or full cookie cache is playing a part in this behaviour I am seeing.

\n\n

Thanks for the help, in advance :)

\n", "Lable": "No"} {"QuestionId": 10865201, "AnswerCount": 2, "Tags": "", "CreationDate": "2012-06-02T19:19:10.847", "AcceptedAnswerId": "10865279", "Title": "Database size bigger after delete from table", "Body": "

After I delete huge amount of data from a SQL Server database table, the database size increased.

\n\n

When I run sp_spaceused it shows me 2625.25 MB. It used to be ~ 1800.00 MB before I deleted from table.

\n\n

Is there any specific reason it keeps growing even if I delete data?

\n", "Lable": "No"} {"QuestionId": 10868406, "AnswerCount": 1, "Tags": "<.net><.net-4.0>", "CreationDate": "2012-06-03T06:35:48.143", "AcceptedAnswerId": null, "Title": "c#.net 4.0 - no pia - is this all I need?", "Body": "

Reference the Microsoft.Office.Interop.Excel and set Embed Interop Type to true?

\n\n

Will doing so ensure my app is backward compatible? (As long as I use safe methods that work on all versions.)

\n\n

Or do I have to use something like late binding and all in order for it to be compatible against multiple versions?

\n", "Lable": "No"} {"QuestionId": 11055976, "AnswerCount": 1, "Tags": "", "CreationDate": "2012-06-15T18:06:48.877", "AcceptedAnswerId": "11056660", "Title": "How to retrieve attachments from child pages of a specific Page in WordPress?", "Body": "

How would I retrieve attachments from all subpages of a specific Page ID?

\n\n

Example:

\n\n

SPECIFIC PAGE

\n\n
    \n
  • Child (with attachments)
  • \n
  • Child (with attachments)
  • \n
  • Child (with attachments)
  • \n
\n\n

I'm currently using this code to retrieve all attachments site-wide, however I would like to limit this to only pull images from all children of a specific Page.

\n\n
<?php\n$args = array( 'post_type' => 'attachment', 'numberposts' => -1, 'post_status' => null, 'post_parent' => null ); \n$attachments = get_posts( $args );\nif ($attachments) {\n    foreach ( $attachments as $post ) {\n        setup_postdata($post);\n        the_title();\n        the_attachment_link($post->ID, false);\n        the_excerpt();\n    }\n}\n?>\n
\n\n

Almost there using this code as per Nick's suggestion below:

\n\n
<?php\n\n$mypages = get_pages('child_of=19');\nforeach ( $mypages as $mypage  ) {\n$attachments = get_children(array('post_parent' => $mypage->ID, 'numberposts' => 1, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'rand'));\n\n\nif ($attachments) {\n\n    foreach ( $attachments as $post ) {\n\n        setup_postdata($post);\n        the_title();\n        the_attachment_link($post->ID, false);\n        the_excerpt();\n    }\n}\n}\n?>\n
\n\n

However, there are two remaining issues:

\n\n
    \n
  1. Limiting the amount of total photos pulled. Using 'numberposts' only limits the amount of images pulled from each post
  2. \n
  3. Randomization. Orderby => rand only randomizes the images within each post. I would like to randomly shuffle the order for everything.
  4. \n
\n", "Lable": "No"} {"QuestionId": 11106123, "AnswerCount": 1, "Tags": "", "CreationDate": "2012-06-19T17:22:42.033", "AcceptedAnswerId": "11207679", "Title": "How do you apply a Weight Factor to an M2M Dimensional Relationship in SSAS?", "Body": "

I have a many-to-many relationship with a weight factor column in the bridge table but I don't know how to make use of this when developing my cube in BIDS. Via Google, I have found many descriptions of what a weight factor is and why you would use one (I understand all this perfectly), but I can't find a practical tutorial of how to configure this in a cube in BIDS.

\n\n

Click-by-click instructions would be ideal but if some one could at least point me at the right window I could probably figure out the rest. Thanks in advance.

\n", "Lable": "No"} {"QuestionId": 11190457, "AnswerCount": 3, "Tags": "", "CreationDate": "2012-06-25T13:42:16.687", "AcceptedAnswerId": "11194037", "Title": "Memory leaks, singleInstance", "Body": "

I've got a couple of activities where I display images with help of this lib. The thing is the app is running out of memory. I tried to gc.clean(), null references, call clear on imageloader object but in vain.

\n\n

In MAT i've found out that I have multiple objects of the same activity and it a default behaviour, if I'm not mistaken. I used singleInstance to suppress multiple instances and it has helped with memory leaks.

\n\n

Right now, due to singleInstance, I'm having troubles with navigation. Do you think I should continue with singleInstance or try to fix memory leak with multiple instances ?

\n\n

Here's ImageView gc roots inspection:\n\"enter

\n\n

UPD:

\n\n
 Bitmap bitmap=null;\n        URL imageUrl = new URL(url);\n        HttpURLConnection conn = (HttpURLConnection)imageUrl.openConnection();\n        conn.setConnectTimeout(30000);\n        conn.setReadTimeout(30000);\n        conn.setInstanceFollowRedirects(true);\n        InputStream is=conn.getInputStream();\n        OutputStream os = new FileOutputStream(f);\n        Utils.CopyStream(is, os);\n        os.close();\n        bitmap = decodeFile(f);\n        return bitmap;\n\n    ImageView imageView = (ImageView) convertView;\n    if(convertView == null){\n        imageView = new ImageView(_currentActivity);\n    }\n
\n\n

UPD2(navigation strategies):

\n\n

I've got a constant header with buttons which start home activity(with gallery) and profile activity; secondly there's a subheader wich also holds 3 buttons which point to another 3 activities with listviews(consisting of imageviews + labels).

\n\n

These header, subheader elements are available on every activity in application; The link-buttons do nothing but:

\n\n
startActivity(new Intent(getActivity(), MainActivity.class));\n
\n\n

or

\n\n
Intent activityIntent = new Intent(getActivity(), SomeActivityWithListViewInside.class);\n// passing some data like list id\nactivityIntent.putExtra(\"list_id\", listId);\nstartActivity(activityIntent);\n
\n\n

So, those activity instances are caused by those startActivity calls - do you think I should play with singleTop or any other intent parameter to avoid this issue ?

\n", "Lable": "No"} {"QuestionId": 11217948, "AnswerCount": 1, "Tags": "", "CreationDate": "2012-06-27T00:52:17.860", "AcceptedAnswerId": "11217985", "Title": "call to sapply() works in interactive mode, not in batch mode", "Body": "

I need to execute some commands in batch mode (e.g., via Rscript). They work in interactive mode, but not in batch mode. Here is a minimal example: sapply(1:3, is, \"numeric\"). Why does this work in interactive mode but return an error in batch mode? Is there a way to make a command like this work in batch mode?

\n\n

More specifically, I need to write scripts and to run them in batch mode. They need to call a function (which I didn't write and can't edit) that looks like this:

\n\n
testfun <- function (...)\n{\n  args <- list(...)\n  if (any(!sapply(args, is, \"numeric\")))\n    stop(\"All arguments must be numeric.\")\n  else\n    writeLines(\"All arguments look OK.\")\n}\n
\n\n

I need to pass a list to this function. A command like testfun(list(1, 2, 3)) works in interactive mode. But in batch mode, it produces an error: Error in match.fun(FUN) : object 'is' not found. I tried debugger() to get a handle on the problem, but it didn't give me any insight. I also looked through r-help, the R FAQ, R Inferno, but I couldn't find anything that spoke to this problem.

\n", "Lable": "No"} {"QuestionId": 11241318, "AnswerCount": 1, "Tags": "", "CreationDate": "2012-06-28T09:05:15.183", "AcceptedAnswerId": "11465419", "Title": "I can ping my centOS virtual machine but I cant access its shared folders", "Body": "

so this is the setup:

\n\n

I have a Windows XP installed, VirtualBox and a centOS 6.2 virtual machine.\nI installed Samba, and currently, my VM and host Windows are in the same subnet.\nI can ping my VM from Windows and vice versa. \nI have a created a shared folder via Samba like this:

\n\n
[Share]\n   path = /home/share\n   writable = yes\n   guest ok = yes\n   guest only = yes\n   create mode = 0777\n   directory mode = 0777\n   share modes = yes\n
\n\n

*I followed a full tutorial here

\n\n

My problem now is that, when I try to access such folder like this \\192.xx.xxx.xxx\\home\\share (192.xx.xxx.xxx is the IP address of my VM) from Windows \"Run\",\nWindows can't find it.

\n\n

P.S. I've turned off my Windows Firewall (although Trend Micro personal firewall is still on)

\n", "Lable": "No"} {"QuestionId": 11486900, "AnswerCount": 2, "Tags": "", "CreationDate": "2012-07-14T19:46:38.080", "AcceptedAnswerId": "11488910", "Title": "NSOperationQueue designated thread", "Body": "

I want to use an NSOperationQueue to dispatch CoreData operations. However, operation queue behavior is not always the same (e.g. it dispatches using libdispatch on iOS 4.0/OS 10.6 which uses thread pools) and a queue might not always use the same thread (as NSManagedObjectContext requires).

\n\n

Can I force a serial NSOperationQueue to execute on a single thread?\nOr do I have to create my own simple queuing mechanism for that?

\n", "Lable": "No"} {"QuestionId": 11489151, "AnswerCount": 1, "Tags": "", "CreationDate": "2012-07-15T03:24:14.687", "AcceptedAnswerId": null, "Title": "Saving nested objects and NSArrays in Objective C using NSCoding", "Body": "

I'm attempting to save an object that has an NSMutableArray of nested objects. I want to use the NSCoding Protocol to save the file under the documents directory. Do I need to encode every object (including the nested ones) or just the super class itself? Right now I'm only encoding the super class' objects.

\n\n

To better illustrate what my object hierarchy looks like:

\n\n
Main Object\n  -NSString\n  -int\n  -NSMutableArray\n    -int\n    -double\n    -char\n
\n", "Lable": "No"} {"QuestionId": 11494105, "AnswerCount": 3, "Tags": "", "CreationDate": "2012-07-15T17:32:47.137", "AcceptedAnswerId": null, "Title": "C# - Using Awesomium to Interact with Gmail", "Body": "

I'm able to navigate to gmail, but then I want to do something as simple as enter the credientials and click the login button.

\n\n
private void btnSubmit_Click(object sender, EventArgs e)\n{       \n    btnSubmit.Enabled = false;        \n    webGmail.LoadURL(\"http://www.gmail.com\");\n\n    webGmail.LoadCompleted += ExecuteSomething;\n}\n\nprivate void ExecuteSomething(object sender, EventArgs eventArgs)\n{\n    webGmail.ExecuteJavascript(@\"<script src = 'http://code.jquery.com/jquery-latest.min.js' type = 'text/javascript'></script>\");\n    webGmail.ExecuteJavascript(@\"$('#Email').val('foo');\");\n    webGmail.ExecuteJavascript(@\"$('#Passwd').val('bar');\");\n    webGmail.ExecuteJavascript(@\"$('#signIn').click();\");\n}\n
\n\n

Nothing happens. I know using developer tools with Chrome that you cant modify anything on the page. But is there a way of filling in forms?

\n\n

Are there any other better headless browsers? I actually need one that supports a web control that I can put into my form so that I can see what is going on. This is mandatory

\n", "Lable": "No"} {"QuestionId": 11562215, "AnswerCount": 2, "Tags": "", "CreationDate": "2012-07-19T13:43:48.553", "AcceptedAnswerId": "11564125", "Title": "Getting compile error using getThreadAllocatedBytes() in ecplise", "Body": "

I am trying to monitor my threads in the Quartz scheduler. I need to come up with an estimation of how much memory needed for executing my jobs.

\n\n

I am trying to use the method:

\n\n
    import java.lang.management.ManagementFactory;\n\n    ManagementFactory.getThreadMXBean().getThreadAllocationBytes();\n
\n\n

However, in Eclipse I am getting an error:

\n\n
The method getThreadAllocationBytes() is undefined for the type ThreadMXBean\n
\n\n

I searched and found out that the method was introduced in JDK6u25 and since Eclipse is using its own compiler I cannot fix the problem.

\n\n

Compiling the class without Eclipse seems to be a weak solution since I need to be able to compile the project using Eclipse.

\n\n

Can you give me some advice on how to fix this problem?

\n", "Lable": "No"}