text:
Q: Perf Error While Loading Shared Libraries I was on CentOS 7.3 on x86_64 using perf compiled on the system itself from Kernel 4.13.7 source. It worked without any issue and was able to profile whichever application I wanted to.
For some reason, system crashed and I had to re-configure it. I am back on CentOS 7.3 with same kernel as it was before i.e. 3.10. Now, when I downloaded Kernel 4.13.7 and compiled perf, it gives me following error when I try to profile any benchmark.
error while loading shared libraries: libiomp5.so: cannot open shared object file: No such file or directory

As far as I understand, this library belongs to omp or mkl which I don't need for perf and is not present on my system. As per different forums and search, it also seems that this library should come with Intel MKL, which is already configured on my system, but for sure system doesn't have this specific library.
To debug more, I have another spare system with RHEL 6.9. On this system too compiling perf as I did for system described above and then profiling same benchmarks gives me same library error.
I am clueless as to why this error is coming up now and wasn't there earlier before re-installing the operation system. I have updated the OS with all the latest packages.
I don't get this error when I run benchmark standalone (whether CentOS or RHEL) or with numactl, and benchmarks do run-terminate successfully.
Any suggestion why this may be happening?

A: I solved this issue by re-installing Intel Parallel Studio XE which configures different performance library that I need. New install also configured libiomp5.so library, which wasn't configured with earlier install.
Then adding path to this library in /etc/ld.so.conf and running sudo ldconfig solved the issue.
Hopefully, this helps someone.


text:
Q: Application Insight: Not able to see server responses I configured application insight with my website and have added the instrumentation key as well as added the application pool to the performance counter (both default + application specific) and have even provided application pool security rights on "C:\Windows\system32\config\systemprofile" but I am still not able to see any server responses in application insight.
Also i have created a Url Ping test in application insight and that is responding fine on each attempt

A: There are ways to troubleshoot.

*

*Using fiddler - check traffic going out to https://dc.services.visualstudio.com/v2/track

*You can do from dev tools like

Run your application in debug mode in Visual Studio (F5). Use the application so as to generate some telemetry. Check that you can see events logged in the Visual Studio output window.

More troubleshooting can be found here -
Troubleshooting no data - Application Insights for .NET/.NET Core

A: It seems that you'd like to configure and show the performance counters, this article explained how to configure and collect performance counters, please refer to it.
Please make sure you add specific performance counters correctly, the following is an example.
<Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.PerformanceCollectorModule, Microsoft.AI.PerfCounterCollector">
  <!--
  Use the following syntax here to collect additional performance counters:
  -->
  <DefaultCounters/>
  <Counters>
    <Add PerformanceCounter="\Process(??APP_WIN32_PROC??)\Handle Count" ReportAs="Process handle count" />
  </Counters>
  <!--
  PerformanceCounter must be either \CategoryName(InstanceName)\CounterName or \CategoryName\CounterName

  NOTE: performance counters configuration will be lost upon NuGet upgrade.

  The following placeholders are supported as InstanceName:
    ??APP_WIN32_PROC?? - instance name of the application process  for Win32 counters.
    ??APP_W3SVC_PROC?? - instance name of the application IIS worker process for IIS/ASP.NET counters.
    ??APP_CLR_PROC?? - instance name of the application CLR process for .NET counters.
  -->
</Add>

Search and display performance counter reports in Analytics:

redpajama_set_name: RedPajamaStackExchange


text:
Q: Blocking particular website for specific thinclients on Ubuntu We have server which is connected with more than thin client machine. I have tried to block the websites ( facebook, orkut,twitter ) for all the users. it works fine for me. But , I want to block for particular user  ( thinclient ) or by the way of IP address of machine. How can I do that.

A: squid is a proxy that is allow reduce the internet bandwidth and block the websites in linux os
For block a particular website use this command
1. vi /etc/squid/squid.conf  /* for editing this file
2. Enter following command
     acl bad(name of the variable) url_regex [http://www.google.com (if you want to block        Google.com)
    http_access deny  bad(variable name)
    http_access allow all
3. change the port number of the proxy that used in your web browser to 3128

A: iptables is tool that used in Linux for protecting the system from ip or network
if you want to block a particular ip or network just use this command

*

*If u want to block a particular ip like 192.168.0.5 then use this command
iptables -t filter -A INPUT -s 192.168.0.5 -j REJECT

*From a network [network id is 192.168.0.0]
iptables -t filter -A INPUT -s 192.168.0.0 -j REJECT


text:
Q: Attendance and payroll management design I am developing an Android app for the first time. For the database I am using SQLite . I am new to the concept of relational database. I am creating an app for attendance and payroll management. I am planing to add 3 tables:

*

*employee

*attendance

*salary

In the first table, I entered the details of employees where the joining date and end date is defined. How to calculate the attendance based on the specified date? I will be using sysdate/timestamp for each day attendance as column and value will be boolean.
Also I will have a salary table. How to link it with the employee table to get emp_id (foreign key ) and name (how to link name)?
Please help me with the query and understanding concept of relations of the tables and also if any database design you all can recommended would help.


text:
Q: How can you describe this kind of graph? I know for sure that this is a simple directed graph. But I cannot say that this is a ring graph/network, because node 3 has a degree of 4. But as I imagine this, you cannot go to node 7 from node 3 if the preceding node is node 2, and you cannot go to node 4 from node 3 if the preceding node is node 6. That means the only way to traverse this graph is to start from one node and then go to the adjacent node that has a number greater than the current node (except for node 7 to node 1). What kind of graph is this? Thanks in advance!
http://img231.imageshack.us/img231/5492/graphl.jpg

A: Yes, it is a simple directed graph. It is also an Eulerian graph with exactly one Eulerian circuit. That's probably its most interesting property.

A: You could redraw the graph as a standard Eulerian Graph without the addition rules by dividing node 3 into two nodes, node 3 and node 6A, where 2-3-4 and 6-6A-7 are the only valid paths through the two nodes. At this point the graph would look like a figure eight. The nodes could then be rearranged in a circle while maintaining the topology.


text:
Q: Whats wrong with this video embed code? Following embed code is from http://hd.se/landskrona/2010/04/09/kunglig-glans-pa-idrottsgalan/ but it doesn't work in Internet Explorer 8. Firefox no problems.
Any recommendations for improvements?
Thanks for your time!
<object width="480px" height="294px" id="_36313041" data="http://hd.se/static/media/html/flash/video-3/flowplayer.swf" type="application/x-shockwave-flash">
<param name="movie" value="http://hd.se/static/media/html/flash/video-3/flowplayer.swf" />
<param name="allowfullscreen" value="true" />
<param name="allowscriptaccess" value="always" />
<param name="flashvars" value='config={"key":"$3fff7448b28a8cffc85","contextMenu":["hd.se videospelare 1.0"],"plugins":{"rtmp":{"url":"http://hd.se/static/media/html/flash/video-3/flowplayer.rtmp.swf"},"controls":{"height":24,"opacity":1,"all":false,"play":true,"time":true,"scrubber":true,"playlist":false,"mute":true,"volume":true,"fullscreen":true,"backgroundColor":"#222222","backgroundGradient":"none","buttonColor":"#7c7c7c","buttonOverColor":"#36558b","progressColor":"#7c7c7c","bufferColor":"#7c7c7c","timeColor":"#ffffff","durationColor":"#ffffff","timeBgColor":"#222222","scrubberHeightRatio":0.5,"scrubberBarHeightRatio":0.5,"volumeSliderHeightRatio":0.5,"volumeBarHeightRatio":0.5,"autoHide":"fullscreen","hideDelay":1800,"tooltips":{"buttons":true,"play":"Spela","pause":"Paus","next":"Nästa","previous":"Föregående","mute":"Ljud av","unmute":"Ljud på","fullscreen":"Fullskärmsläge","fullscreenExit":"Lämna fullskärmsläge"},"tooltipColor":"#153872","tooltipTextColor":"#ffffff"},"contentIntro":{"url":"http://hd.se/static/media/html/flash/video-3/flowplayer.content.swf","top":0,"width":736,"border":"none","backgroundColor":"#202020","backgroundGradient":"none","borderRadius":"none","opacity":"85pct","display":"none","closeButton":true}},"canvas":{"backgroundColor":"#000000","backgroundGradient":"none"},"play":{"replayLabel":"Spela igen"},"screen":{"bottom":24},"clip":{"scaling":"fit","autoPlay":true},"playlist":[{"provider":"rtmp","netConnectionUrl":"rtmp://fl0.c06062.cdn.qbrick.com/06062","url":"ncode/hdstart","autoPlay":false,"scaling":"fit"},{"url":"http://hd.se/multimedia/archive/00425/_kunligglans_HD_VP6_425359a.flv","scaling":"fit","autoPlay":true},{"provider":"rtmp","netConnectionUrl":"rtmp://fl0.c06062.cdn.qbrick.com/06062","url":"ncode/hdstopp","autoPlay":true,"scaling":"fit"}]}' />
</object>

UPDATE 2010-05-14:
If I'm not mistaken HD.se uses Flowplayer and all those flasvars are for that. Perhaps someone here is good with Flowplayer? I've never used it myself.

A: You cannot have 'px' in the width and height attributes, only a number. Also IDs cannot start with an underscore, they can only start with a letter.
So your code should start <object width="480" height="294" id="f_36313041". However, if the ID is used for anything you may have to change external code somewhere.
Have you double-checked the value of "flashvars" too? It's an incredibly long and complex string so there could easily be an error there somewhere.

A: You should not create object/embed tags directly to embed Flash.  Always use an external JS file to generate the required tags.  SWFObject is the most widely used one.
http://en.wikipedia.org/wiki/SWFObject
Info on why you want to use an external JS file:
http://blog.deconcept.com/2005/12/15/internet-explorer-eolas-changes-and-the-flash-plugin/


text:
Q: What is the type of this kind of declaration? I am trying to learn Android. I have some Java experience but have never seen a code block like this one:
        addNumsButton.setOnClickListener(new View.OnClickListener()
    {
        @Override
        public void onClick(View v)
        {
            EditText firstNumEditText = (EditText) findViewById(R.id.firstNumEditText);
            EditText secNumEditText = (EditText) findViewById(R.id.secNumEditText);
            TextView resultTextView = (TextView) findViewById(R.id.resultTextView);
            resultTextView.setText((Integer.parseInt(firstNumEditText.getText().toString()) + Integer.parseInt(secNumEditText.getText().toString())) + "");
        }
    });

What is getting declared after the View.OnClickListener()? I checked that View.OnClickListener() returns type Interface.
What does the code after that method is used for?

A: That's an anonymous class. It's special syntax for creating an instance of an abstract type by providing implementations right at the point of declaration. It's very common in GUI code (Android, Swing, what have you) to provide GUI action callbacks.
What your snippet is doing is pass an ad-hoc instance of View.OnClickListener to setOnClickListener that executes the code in the innermost brace block when the button is clicked.


text:
Q: ExtentReports Cucumber Report Parallel Execution with TestNG I am running some Selenium tests via SauceLabs and my test framework is generating a report using the ExtentCucumberAdapter4 plugin.
I am running each of my Cucumber scenarios in parallel on separate threads, which are running as expected. However, when the report is generated by ExtentReports, it has each scenario run by a thread as an individual feature, see screenshot below.

Here's my feature file
@FeatureOne
Feature: Feature 1
Example Feature

  Scenario: Attempting to login with invalid user
    Given I am at the login screen
    And I enter invalid user crendtials
    Then I should not be logged in

  Scenario: Logging in with valid user
    Given I am at the login screen
    And I enter valid user credentials
    Then I should be logged in

and my test runner class:
@CucumberOptions(
        features = "features",
        tags = { "@FeatureOne" },
        glue = {"stepdefs"},
        plugin = {
                "com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:"
        }
)
public class TestNGCucumberRunner {

    private TestNGCucumberRunner testNGCucumberRunner;

    @BeforeClass(alwaysRun = true)
    public void setUpClass() {
        testNGCucumberRunner = new TestNGCucumberRunner(this.getClass());
    }

    @DataProvider(parallel = true)
    public Object[][] scenarios() {
        return testNGCucumberRunner.provideScenarios();
    }

    @Test(description = "Cucumber Scenarios", dataProvider = "scenarios")
    public void feature(PickleEventWrapper pickleEvent, CucumberFeatureWrapper cucumberFeature) throws Throwable {
        testNGCucumberRunner.runScenario(pickleEvent.getPickleEvent());
    }

    @AfterClass(alwaysRun = true)
    public void tearDownClass() {
        testNGCucumberRunner.finish();
    }
}

I'm expecting both the scenarios in Feature 1 to be under the same 'Feature 1' title in the report, but they appear as 2 of the same feature.
It seems that each running thread just adds what ever scenario it runs to the list of features. Does ExtentReport have any support for preventing this?


text:
Q: can't handle size of a popover I want to create a popup menu like in foursquare in swift2, x-code 7.3:

I'm using this code
//Create Pop up Menu
func setAnimatedMenu(identifier : String)-> ViewController{

    let storyboard : UIStoryboard = UIStoryboard(
        name: "Main",
        bundle: nil)
    let menuViewController: ViewController = storyboard.instantiateViewControllerWithIdentifier(identifier) as! ViewController//filters

    menuViewController.modalPresentationStyle = .OverFullScreen //played with this and tried every different styles
    menuViewController.preferredContentSize = CGSizeMake(self.view.frame.width, self.view.frame.height/3) //Played with this size, nothing changes

    let popoverMenuViewController = menuViewController.popoverPresentationController
    popoverMenuViewController?.permittedArrowDirections = .Any
    popoverMenuViewController?.delegate = self

    popoverMenuViewController?.sourceView = parentViewController?.view
    popoverMenuViewController?.sourceRect = CGRect(
        x: self.view.frame.size.width,
        y: self.view.frame.size.height/3,
        width: 1,
        height: 1) //played also with this size, nothing changes

    return menuViewController

}

What I would like to accomplish is something like in the picture, a pop up over the current view and tabs but with 1/3 of the upper view visible. I only have managed to do over full screen and I only can see the back view if I do scroll in the pop up and move it to bottom or top.
I try to set its preferredContentSize but the property is unmutable:

These are the storyboard properties:

EDIT: I managed to fix it, I hadn't realized that there were constraints in storyboard setting the window size. I have created an outlet of the height constraint, and just changing it's value from the code it has fixed my problem.

A: The Y position is the position of where its located on a Y axis so you need to set this to:
y: (self.view.frame.size.height/3) * 2.0,


text:
Q: Streaming audio from Google App Engine Is it possible to stream audio-file from BlobStore on AppEngine in general?
And if yes, what about streaming .mp3 file from direct url?

A: Yep!!
This is my implementation:
public class Serve extends HttpServlet {

    private static final long serialVersionUID = 5603629129606331547L;

    public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException {
        BlobKey blobKey = new BlobKey(req.getParameter("blob-key"));
        BlobstoreServiceFactory.getBlobstoreService().serve(blobKey, res);
    }
}

.. and this is the web.xml:
<servlet>
        <servlet-name>Serve</servlet-name>
        <servlet-class><my-package>.Serve</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>Serve</servlet-name>
        <url-pattern>/serve</url-pattern>
    </servlet-mapping>

pay attention that "direct url" (getServingUrl I think you mean) exists only for images:
https://developers.google.com/appengine/docs/java/images/overview#Transforming_Images_from_the_Blobstore

A: In general the answer is no:
https://cloud.google.com/appengine/docs/standard/go/how-requests-are-handled#streaming_responses
As others have indicated you could chunk up your data to limit the "cost" and then have your client control when to get the next chunk.
A better solution
Use Cloud Run instead:
https://cloud.google.com/blog/products/serverless/cloud-run-now-supports-http-grpc-server-streaming


text:
Q: Implement Gaussian sum function in OCaml with lambda expression I have to write a function sum that takes as first argument a value n. The second argument is a function f so that sum calculates the Gaussian sum.
In a second step, I have to implement thesum_gauss (int->int) using sum and a lambda expression.
This is my idea for the function sum:
let rec sum (n:int) (f:int->int) : int =
  if n < 1 then 0
  else sum (n-1) f + f n

And this is sum_gauss which throws an error:
let sum_gauss = sum ((i:int) -> fun (i:int) : int -> i)

The error is:
Line 1, characters 30-32:
Error: Syntax error: ')' expected
Line 1, characters 22-23:
  This '(' might be unmatched

I don't understand why this error is raised because every left bracket is matched by a right bracket.

A: Rewriting with type inference cleaning things up:
let rec sum n f =
  if n < 1 then 0
  else sum (n-1) f + f n

If you wish to add all number from 1 to n. you need to pass the number and the function to sum_gauss as separate arguments.
let sum_gauss n = sum n (fun x -> x)

Of course, fun x -> x is really just Fun.id.
let sum_gauss n = sum n Fun.id

If you feel like being extra clever and you're already using the Fun module you can use Fun.flip to pass Fun.id as the second argument of sum and elide n from the definition entirely. The fact that sum is not polymorphic avoids weak typing issues with partial application.
let gauss_sum = Fun.(flip sum id)


text:
Q: Merge and add duplicate integers from a multidimensional array I have a multidimensional list where the first item is a date and the second is a date time object needing to be added together. For example (leave the second as a integer for simplicity):
[[01/01/2019, 10], [01/01/2019, 3], [02/01/2019, 4], [03/01/2019, 2]]

The resulting array should be:
[[01/01/2019, 13], [02/01/2019, 4], [03/01/2019, 2]]

Does someone have a short way of doing this?
The background to this is vehicle tracking, I have a list of trips performed by vehicle and I want to have a summary by day with a count of total time driven per day.

A: import pandas as pd

# create dataframe out of the given imput
df = pd.DataFrame(data=[['01/01/2019', 10], ['01/01/2019', 3], ['02/01/2019', 4]], columns=['date', 'trip_len'])

# groupby date and sum values for each day
df = df.groupby('date').sum().reset_index()

# output result as list of lists
result = df.values.tolist()

A: You should change your data 01/01/2019 to '01/01/2019'.
@naivepredictor suggested good sample, anyway, if you don't want to import pandas, use this.
my_list = [['01/01/2019', 10], ['01/01/2019', 3], ['02/01/2019', 4], ['03/01/2019', 2]]
result_d = {}

for i in my_list:
    result_d[i[0]] = result_d.get(i[0], 0) + i[1]

print(result_d) #{'01/01/2019': 13, '02/01/2019': 4, '03/01/2019': 2}
print([list(d) for d in result_d.items()]) #[['01/01/2019', 13], ['02/01/2019', 4], ['03/01/2019', 2]]


text:
Q: ms word's images disappears after 10 sec after when I open it I have a ms word document which I'm creating it apache poi with java. This document has a lot of images because of that the word document's size is too big (like 300 mb). When I open the document, it's freezing and the images disappears like this.

I'm putting images in ms word like this
int picturesCount=imgPaths.size();
            int tableRows=(int)Math.round(picturesCount/2d);
            XWPFParagraph parag=document.createParagraph();
            XWPFRun run=parag.createRun();
            InputStream is2 = null;

            XWPFTable imgTable;
            XWPFTableCell cell;
            int TableRows=0;
            for(int f=0;f<imgPaths.size();f++)
            {
                if(!imgPaths.get(f).equals("-"))
                {
                    TableRows++;
                }
            }
            int rows=(int)Math.round(TableRows/2d);
            imgTable=document.createTable(rows,2);
            imgTable.removeBorders();
            int tableRow=0;
            int tableCell=0;
            int des=0;
            for(String pictureURL:imgPaths) {

                if(!"-".equals(pictureURL)) {
                    try {

                        cell=imgTable.getRow(tableRow).getCell(tableCell++);
                        if(tableCell==2) {
                            tableCell=0;
                            tableRow++;
                        }

                        is2 = new FileInputStream(pictureURL);
                        if(cell.getParagraphs().size()>0) parag=cell.getParagraphs().get(0);else parag=cell.addParagraph();
                        if(parag.getRuns().size()>0) run=parag.getRuns().get(0);else run=parag.createRun();
                        run.addPicture(is2, XWPFDocument.PICTURE_TYPE_JPEG, "Images", Units.toEMU(250), Units.toEMU(250));
                        parag=cell.addParagraph();
                        run.setText(des_img.get(des));
                        des++;
                        run.getCTR().getDrawingArray(0).getInlineArray(0).addNewCNvGraphicFramePr().addNewGraphicFrameLocks().setNoChangeAspect(true);

                    }  catch (IOException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    } catch (InvalidFormatException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }

                }
            }

How do I solve this problem any suggestion??


text:
Q: Django regular expression error NoReverseMatch I am getting error use django regular expression like this:

Reverse for 'fleet_member_edit' with arguments '()' and keyword
  arguments '{u'id_fleet_id': ''}' not found. 1 pattern(s) tried:
  ['dashboard/fleet_member_edit/(?P<id_fleet_id>[0-9]+)/$']

I want to call data with "id_fleet_id". this is my example data:
id id_fleet_id id_unit
1   2323        A1
2   2323        A2
3   2343        A8

urls.py
url(r'^dashboard/fleet_member_edit/(?P<id_fleet_id>[0-9]+)/$', 'apps.fleet.views.fleet_member_edit', name='fleet_member_edit'),

views.py
def fleet_member_edit(request, id_fleet_id):
    post = get_object_or_404(Member, id_fleet_id=id_fleet_id)
    if request.method == "POST":
        id_fleet = request.POST['id_fleet']
        units = map(int, request.POST['id_unit'].split(), instance=post)

        for id_unit in units:
            member = Member()
            member.id_fleet_id = id_fleet
            member.id_unit_id = id_unit
            member.save()
        return redirect('apps.setup.views.vehicle_group_view')
    else:
        form = FleetMember(instance=post)
    context_dict = {'form':form, 'post':post}
    return render(request,'fleet_member_edit.html', context_dict, context_instance= RequestContext(request))

template
EDIT

can you help me solve this problem?

A: You are not sending the post object in the template context.
You need to send post object in the context as @cdvv7788 also mentioned. Since, you are not sending the post object in the context, the template is not able to generate the url properly.
You need to do something like:
def my_view(request):
    ...
    context_dict = {'post': post, ..} # pass the 'post' object
    # here 'some_template.html' is the template containing this url
    return render(request, 'some_template.html', context_dict)


text:
Q: Speech Recognition in C# with specific command I was developed a application that can only recognize some word. I've several questions.
1)Can I able to develop something like
if(command == Browser)
{
    //open default browser
}

2) If Yes, how can Recognize System understand the custom word??
Any code sample or tutorial will be appreciated.

A: you can do this with Microsoft Speech API System.Speech.Recognition.
Have a look at this article


text:
Q: shiny datatable editable for reactive data source I just wanted to make the data (displayed in the shiny datatable) selected by user editable and eventually to save the user's updates to a file (e.g. such as an excel file), see the testing code below:
I checked the example/questions below(and a few others), but none of those used the reactive as the data source.
https://yihui.shinyapps.io/DT-edit/
Edit datatable in shiny with dropdown selection (for DT v0.19)
DT: Dynamically change column values based on selectinput from another column in R shiny app
The issue for the code below is: when I try to update the second cell, the updates I made in the first cell disappeared.
library(shiny)
library(DT)
#>
#> Attaching package: 'DT'
#> The following objects are masked from 'package:shiny':
#>
#>     dataTableOutput, renderDataTable

ui <- fluidPage(
  selectInput("data", "Select a dataset:", choices = c("iris", "mtcars")),
  DTOutput("t1"),
  actionButton("save", "Save")
)

server <- function(input, output, session) {
  tempdf <- NULL

  data <- reactive({
    head(get(input$data))
  })

  output$t1 <- renderDT({
    data()
  }, editable = "cell")

  proxyt1 <- dataTableProxy("t1")

  observeEvent(input$t1_cell_edit, {
    info <- input$t1_cell_edit
    str(info)
    tempdf <<- editData(data(), info)
    # tempdf <<- editData(isolate(data()), info)

    replaceData(proxyt1, tempdf, resetPaging = FALSE)
  })

  # observeEvent(input$save, {
  #   writexl::write_xlsx(tempdf, "~/test.xlsx")
  # })
}

shinyApp(ui, server)
#> PhantomJS not found. You can install it with webshot::install_phantomjs(). If it is installed, please make sure the phantomjs executable can be found via the PATH variable.

Shiny applications not supported in static R Markdown documents
Created on 2022-05-23 by the reprex package (v2.0.1)
Thank you very much for your help.


text:
Q: How can I specify T4 (Text Templates) to use C# 4.0, in VS2010? I need to specify my T4 to use C# 4.0, to render my tt files? I tried using
<#@ template language="C#v4.0" debug="true" #>

But when I use a dynamic variable, like this
dynamic x=10;
Write(x.ToString());

I'm getting these errors
Error   2   Compiling transformation: Predefined type 'Microsoft.CSharp.RuntimeBinder.CSharpSetMemberBinder' is not defined or imported e:\projects\DynamicModel\DynamicModel\ModelGenerator.tt 1   1
Error   3   Compiling transformation: Missing compiler required member 'Microsoft.CSharp.RuntimeBinder.CSharpInvokeMemberBinder..ctor'  e:\projects\DynamicModel\DynamicModel\ModelGenerator.tt 1   1
Error   4   Compiling transformation: Missing compiler required member 'System.Runtime.CompilerServices.CallSite.Create'    e:\projects\DynamicModel\DynamicModel\ModelGenerator.tt 1   1
Error   5   Compiling transformation: One or more types required to compile a dynamic expression cannot be found. Are you missing references to Microsoft.CSharp.dll and System.Core.dll?   e:\Projects\DynamicModel\DynamicModel\ModelGenerator.tt 7   8
Error   6   A namespace cannot directly contain members such as fields or methods   e:\projects\DynamicModel\DynamicModel\ModelGenerator.cs 1   1   DynamicModel

Also, please note that I'm using TextTemplatingFileGenerator and Not pre-processor templates

A: Found that you should specify the correct assemblies as well.
Adding this will ensure you are using c# 4.0.
<#@ template language="C#" debug="true" #>
<#@ output extension=".txt" #>
<#@ Assembly Name="System.Core, Version=4.0.0.0, Culture=neutral" #>
<#@ Assembly Name="Microsoft.CSharp, Version=4.0.0.0, Culture=neutral" #>

How ever, for some reason, during the time of t4 transformation, the dynamic dispatching is still not working from T4, wondering why. From T4 it throws a runtime error, the same code does good directly from a cs file.

A: I believe that by default the T4 engine can only use 4.0, although I'd make sure that any DLLs you reference are correct for your error.


text:
Q: Number of binary trees with n unlabeled node I found a proof about the number in this site.
In that site the author says that the number of all possible binary trees with n labeled nodes is equal to the number of ways one can make n-1 edges from n nodes. Since each node can have 2 or less edges, number of all possible edges is 2n. So, the number of ways one can choose n-1 edges from 2n possible edges is 2n×(2n−1)×(2n−2)×....×(2n−(n−2))=(2n)!/(n+1)!. And finally merging all permutation trees into one tree gives the number of binary trees with n unlabeled nodes, (2n)!/((n+1)!n!)=2nCn/(n+1).
But, in the middle of the proof I don't get how one can find 1-1 corrospondence between the number of ways of choosing edges and the number of binary trees with n labeled nodes. For example, if n=3, and each node has name 1, 2 and 3, respectively, and I choose left edge and right edge from node 1 in that order, then there are two possible cases:
1
/\
2 3

1
/\
3 2

So, it seems that choosing 2 edges from 6 edges (3 nodes) does not correspond to a specific binary tree.
Can anyone provide me with the mapping rule between the sequence of chosen edges and the corresponding binary tree?

A: As per my understanding, an edge is defined by combination of nodes.
Like in the example you mentioned (1,2) and (1,3) are two edges
So if you are choosing (1,2) to be the left edge, you cannot switch the nodes.
So it is corresponding to one binary tree only.


text:
Q: AngularJS - How can I know when a promise on a parent controller has been resolved? I have a directive that relies upon data from its parent's controller. This data is returned in a promise. How can I know when the promise, which exists on the parent controller, has been resolved?
Parent Controller
angular.module("UserShoes").controller("UserController", function ($scope) {
  $scope.user = User.get({
    userId: 1
  });

  $scope.shoes = [];

  $scope.user.$promise.then(function (data) {
    data.shoes.forEach(function (shoe, index) {
      if (shoe) {
        $scope.shoes.push(shoe);
      }
    });
  });
});

Directive
angular.module("UserShoes").directive("Shoes", ["", function () {
  return {
    ...

    controller: function ($scope) {
      // When will $scope.parent.shoes be ready? :-(
    }
    ...
  }
}]);

A: You could broadcast an event and listen for that event in your directive.
From your parent controller:
angular.module("UserShoes").controller("UserController", function ($scope) {
      $scope.user = User.get({
        userId: 1
      });

      $scope.shoes = [];

      $scope.user.$promise.then(function (data) {
        data.shoes.forEach(function (shoe, index) {
          if (shoe) {
            $scope.shoes.push(shoe);
          }
        });
        $scope.$broadcast('shoes-ready',$scope.shoes);
      });
    });

From your directive
$scope.$on('shoes-ready',function(evt,shoes){ /*process shoes*/})

A: Importing the $promise into the directive's scope should work well.  Use & to import it as a binding expression:
view:
<div user-shoes shoes-promise="user.$promise" ... ></div>

directive:
angular.module('myModule')
.directive("Shoes", ["", function () {
  return {
    ...
    scope: {
      shoesPromise: '&'
    }
    ...
  }
}])

Then, in directive's link function, you can do something with the resolved promise:
function link(scope) {
  scope.shoesPromise()
    .then(function(){
      ...
    })
    .catch(...)
}

A: Instead of using a $broadcast, which could theoretically become expensive down the road, I would use a $watch and a flag in your controller. Something like:
angular.module("UserShoes").controller("UserController", function ($scope) {
  $scope.user = User.get({
    userId: 1
  });

  $scope.shoes = [];

  $scope.user.$promise.then(function (data) {
    data.shoes.forEach(function (shoe, index) {
      if (shoe) {
        $scope.shoes.push(shoe);
      }
    });
    $scope.shoes_ready = true;
  });
});

then in your directive:
var stop_watch = scope.$watch('shoes_ready', function(new_value) {
  if (new_value === true) {
    // do work son
    stop_watch();  // Optional, if you are done with this watcher
  }
});


text:
Q: facebook share link wont show image from my server I am trying to share a from my site on facebook
and it just wont display the image.
I tried the debug tool
and it says that every thing is ok...
the most wired thing is that when I put the same page on a different server it works fine!!!
and how can I clear the facebook cache ?
thanks alot

A: Check to make sure that there is not a setting on your server preventing Facebook from programmatically scraping the image data.  I have recently run across this issue where the settings on a server were restrictively secure to the extent where Facebook was not able to grab the image data for sharing purposes and make a copy of the image into its CDN.


text:
Q: UIPanGestureRecognizer conflict with constraints animation I have an animation of a contentView of a cell wish have UIPanGestureRecognizer.
the UIPanGestureRecognizer works fine and detect touches but while the animation is happening it doesn't detect touches  until it finish the animation.
is there a workaround for this.
this is the animation block
[self.myContentView layoutIfNeeded];
self.contentViewLeftConstraint.constant = -50;
self.contentViewRightConstraint.constant = 50;

[UIView animateWithDuration:duration delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{
    [self.myContentView layoutIfNeeded];
} completion:completion];

Thanks.

A: If you want to allow user interaction during the animation, you must set the option to allow it:
UIViewAnimationOptions options = UIViewAnimationOptionCurveEaseOut |
    UIViewAnimationOptionAllowUserInteraction;
[UIView animateWithDuration:duration delay:0 options:options animations:^{
    [self.myContentView layoutIfNeeded];
} completion:completion];


text:
Q: 403 forbidden error - Accessing Amazon S3 bucket using Http GET Request in c# I am writing an c# code that is trying to access the Amazon S3 bucket through REST calls.
The code makes a get request to an xml file created in the s3 bucket.
I am using the secret key and access Id to create a signature that will be used in the authorization header.
The Signature I created is based on Amazon's documentation,
http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html
I have provided permissions for authenticated requests to access the xml file in the s3 bucket.
The Code I am using,
string AccessId = "xyz";
string SecretKey = "xyz";
string bucketName = "bucket";
string filename = "filename.xml";
string httpDate = DateTime.UtcNow.ToString("ddd, dd MMM yyyy HH:mm:ss +0000\n");
string StringtoSign = "GET\n"
                      + "\n"
                      + "\n"
                      + httpDate + "\n"
                      + "/bucketName/filename.xml";

//Creating Signature
     Encoding e_UTF = new UTF8Encoding();
     Encoding e_ASCI = new ASCIIEncoding();
     byte[] key_new= e_ASCI.GetBytes(SecretKey);
     byte[] message_new = e_UTF.GetBytes(StringtoSign);
     HMACSHA1 myhmacsha1 = new HMACSHA1(key_new);
     byte[] final=myhmacsha1.ComputeHash(message_new);
     string AWSSignature = Convert.ToBase64String(final);

// Sending request
HttpWebRequest request =    (HttpWebRequest)HttpWebRequest.Create("http://"+bucketname+".s3-us-west-2.amazonaws.com/"+filename);
request.Method = "GET";
request.Headers.Add("Authorization", "AWS"+ " " + AccessId + ":" + AWSSignature);
try
{
    // Getting response
    HttpWebResponse response = (HttpWebResponse)request.GetResponse();
    Stream stream = response.GetResponseStream();
    StreamReader sr = new StreamReader(stream);
    String ResStr = sr.ReadToEnd();
    Console.WriteLine(ResStr);
}
catch (WebException ex)
{
    var Resp = (HttpWebResponse)ex.Response;
    Stream new_str=Resp.GetResponseStream();
    StreamReader stred = new StreamReader(new_str);
    MessageBox.Show(stred.ReadToEnd().ToString());
}

The Same Code works fine if I set the permissions for the xml file as public. So it has got to do something with the signature.
I am not sure what am doing wrong. It would be great if someone can have a look at it.

A: You need to tell S3 what date/time you used to calculate the signature by sending either a Date or X-Amz-Date header. Your code's signing the request as if you were sending a Date header, so you should ask the HttpWebRequest to send a matching Date header (and be sure to format it the same way the HttpWebRequest will):
DateTime now = DateTime.UtcNow;
string httpDate = now.ToString("r");

...

request.Date = now;

Alternatively, you may want to consider using the AWS SDK for .NET, which will take care of generating a correct signature for you.


text:
Q: For which values does the Matrix system have a unique solution, infinitely many solutions and no solution? Given the system:
$$\begin{align}
 & x+3y-3z=4 \\
 & y+2z=a \\
 & 2x+5y+(a^2-9)z=9
\end{align}$$
For which values of a (if any) does the system have a unique solution, infinitely many solutions, and no solution?

So I am getting that it has:
infinitely many solutions at: (-1)

No solution at (1)

Unique solution at (-1,1)

AM I RIGHT??

A: Note that your system is equivalent to the matrix equation
$$
\begin{bmatrix}
1 & 3 & -3\\ 0 & 1 & 2 \\ 2 & 5 & a^2-9
\end{bmatrix}
\begin{bmatrix}
x\\ y\\ z
\end{bmatrix}
=
\begin{bmatrix}
4\\ a\\9
\end{bmatrix}
$$
Since
$$
\det\begin{bmatrix}
1 & 3 & -3\\ 0 & 1 & 2 \\ 2 & 5 & a^2-9
\end{bmatrix}=a^2-1
$$
this system is guaranteed a unique solution for $a\neq\pm 1$ (do you know why?).
Now the augmented systems for $a=1$ is
$$
\begin{bmatrix}
1&3&-3&4\\ 0&1&2&1\\ 2&5&-8&9
\end{bmatrix}
$$
Row-reducing this matrix gives
$$
\DeclareMathOperator{rref}{rref}\rref\begin{bmatrix}
1&3&-3&4\\ 0&1&2&1\\ 2&5&-8&9
\end{bmatrix}
=
\begin{bmatrix}
1&0&-9&0\\ 0&1&2&0\\ 0&0&0&1
\end{bmatrix}
$$
This system is not consistent (why?) so the original system has no solution for $a=1$.
Can you repeat the process for $a=-1$?
Addendum. You mention in your question that you're having trouble taking determinants. To find the determinant computed above we can expand about the first column:
\begin{align*}
\det\begin{bmatrix}
\color{blue}1 & \color{red}3 & \color{red}{-3}\\ \color{blue}0 & \color{green}1 & \color{green}2 \\ \color{blue}2 & \color{purple}5 & \color{purple}{a^2-9}
\end{bmatrix}
&= (\color{blue}{1})\cdot\det
\begin{bmatrix}\color{green}1&\color{green}2\\\color{purple}5 & \color{purple}{a^2-9} \end{bmatrix}-(\color{blue}0)\det\begin{bmatrix}\color{red}3 & \color{red}{-3}\\ \color{purple}5 & \color{purple}{a^2-9}\end{bmatrix}+(\color{blue}{2})\det\begin{bmatrix}\color{red}3 & \color{red}{-3}\\ \color{green}1 & \color{green}2 \end{bmatrix} \\
&= \left(a^2-9-10\right)-(0)+2\,\left(6+3\right) \\
&= a^2-19+18 \\
&= a^2-1
\end{align*}

A: Simply by Gauss-Jordan elimination you get:
$$\left(\begin{array}{ccc|c}
1 & 3 & -3 & 4\\
0 & 1 & 2 & a\\
2 & 5 & a^2-9 & 9
\end{array}\right)\sim
\left(\begin{array}{ccc|c}
1 & 3 & -3 & 4\\
0 & 1 & 2 & a\\
0 &-1 & a^2-3 & 1
\end{array}\right)\sim
\left(\begin{array}{ccc|c}
1 & 3 & -3 & 4\\
0 & 1 & 2 & a\\
0 & 0 & a^2-1 & a+1
\end{array}\right)\sim
\left(\begin{array}{ccc|c}
1 & 3 & -3 & 4\\
0 & 1 & 2 & a\\
0 & 0 & (a-1)(a+1) & a+1
\end{array}\right)$$
Now we would like to divide by $(a-1)(a+1)$. But we can do this only if this expression is non-zero. So we have to deal with the cases $a=\pm1$ separately.
If $a=1$, the last row is
$\left(\begin{array}{ccc|c}
0 & 0 & 0 & 2
\end{array}\right)$,
which corresponds to the equation $0x+0y+0z=2$. The equation $0=2$ clearly has no solution.
If $a=-1$ you get the system
$$\left(\begin{array}{ccc|c}
1 & 3 &-3 & 4\\
0 & 1 & 2 & -1\\
0 & 0 & 0 & 0
\end{array}\right)$$
which has infinitely many solutions. (You can also compute them if you want.)
In all other cases (i.e., for $a\ne\pm1$) you can continuo and you get
$$
\left(\begin{array}{ccc|c}
1 & 3 & -3 & 4\\
0 & 1 & 2 & a\\
0 & 0 & (a-1)(a+1) & a+1
\end{array}\right)\sim
\left(\begin{array}{ccc|c}
1 & 3 & -3 & 4\\
0 & 1 & 2 & a\\
0 & 0 & 1 & \frac1{a-1}
\end{array}\right)\sim
\left(\begin{array}{ccc|c}
1 & 0 &-9 & 4-3a\\
0 & 1 & 2 & a\\
0 & 0 & 1 & \frac1{a-1}
\end{array}\right)\sim
\left(\begin{array}{ccc|c}
1 & 0 & 0 & \frac{-3a^2+7a+5}{a-1}\\
0 & 1 & 0 & \frac{a^2-a-2}{a-1}\\
0 & 0 & 1 & \frac1{a-1}
\end{array}\right)$$
So in these cases the solution is $x=\frac{-3a^2+7a+5}{a-1}$, $y=\frac{a^2-a-2}{a-1}$, $z=\frac{1}{a-1}$.

A: the determinant of a 3X3 matrix can be calculated by adding the downward cross products and subtracting the upward cross products, to see what I mean ..
$$\det\begin{bmatrix}
1 & 3 & -3\\ 0 & 1 & 2 \\ 2 & 5 & a^2-9
\end{bmatrix} \\$$ $$
 = (1)(1)(a^2-9)+(3)(2)(2)+(-3)(5)(0) \\- (2)(1)(-3)- (5)(2)(1)-(a^2-9)((3)(0)\\$$ $$
=(a^2-9)+12+0-(-6)-(10)-0 $$ $$=a^2-1 $$


text:
Q: Issue with child table - MySql query I am having a trouble with my below query , the sales order item is a child table inside the sales order table , those tables (sales order item) which has more than one row displays only the first item I mean the first row and all the other rows are not getting displayed . Please shed some light guys.
select
 `tabSales Order`.`name` as "Sales Order:Link/Sales Order:120",
`tabSales Order`.`customer` as "Customer:Link/Customer:120",
 `tabSales Order Item`.item_code as "Item:Link/Item:120",
`tabSales Order Item`.item_name as "Des:Link/Item:120",
`tabSales Order Item`.qty as "Qty:Int:100",
 `tabSales Order Item`.delivered_qty as "Delivered Qty:Int:100",
 (`tabSales Order Item`.qty - ifnull(`tabSales Order Item`.delivered_qty, 0)) as "Qty to Deliver:Int:140",
`tabSales Order Item`.date as "Sch date:Date:100",
`tabItem`.thumbnail as "Cut wt:Data:60",
(`tabSales Order Item`.qty * `tabItem`.thumbnail) as "Tonnage:Float:80",
`tabProduct master`.grade as "Grade:Data:100",
`tabProduct master`.dieno as "Die no:Data:100",
`tabProduct master`.hammer as "Hammer:Data:50",
`tabProduct master`.rm_idl_cs as "Idl sec:Data:60",
`tabProduct master`.rm_alt_cs as "Alt sec:Data:60",
ifnull(SUM(CASE WHEN `tabSales Order`.`name` = `tabProduction Order`.`sales_order` and `tabSales Order Item`.`item_code` = `tabProduction Order`.`production_item`
         THEN `tabProduction Order`.`qty`
    END),0) as "Issued:Int:80",
SUM(CASE WHEN `tabSales Order`.`name` = `tabProduction Order`.`sales_order` and `tabSales Order Item`.`item_code` = `tabProduction Order`.`production_item`
         THEN `tabProduction Order`.`produced_qty`
    END) as "Cut:Int:80",
(`tabSales Order Item`.qty - ifnull(SUM(CASE WHEN `tabSales Order`.`name` = `tabProduction Order`.`sales_order` and `tabSales Order Item`.`item_code` = `tabProduction Order`.`production_item`
         THEN `tabProduction Order`.`qty`
    END),0)) as "To be issued:Int:80"

    from  `tabSales Order`
    LEFT JOIN  `tabSales Order Item`  ON ( `tabSales Order Item`.`parent` = `tabSales Order`.`name`
              and  `tabSales Order`.docstatus = 1  )
    LEFT JOIN  `tabItem`  ON `tabItem`.`item_code` = `tabSales Order Item`.`item_code`
    LEFT JOIN  `tabProduct master`  ON `tabProduct master`.`part_no` = `tabSales Order Item`.`item_code`
    LEFT JOIN  `tabProduction Order`
               ON (`tabSales Order Item`.`item_code` = `tabProduction Order`.`production_item`
              and  `tabSales Order`.`name` = `tabProduction Order`.`sales_order` )
    where  `tabSales Order`.status not in ("Stopped", "Closed", "Completed" )
      and  ifnull(`tabSales Order Item`.delivered_qty,0) < ifnull(`tabSales Order Item`.qty,  0 )
    GROUP BY  `tabSales Order`.`name`
    HAVING  (`tabSales Order Item`.qty -
                SUM(CASE WHEN `tabSales Order`.`name` = `tabProduction Order`.`sales_order`
                      and  `tabSales Order Item`.`item_code` = `tabProduction Order`.`production_item`
                         THEN `tabProduction Order`.`qty` END)
            ) > 0
      or  (`tabSales Order Item`.qty -
                SUM(CASE WHEN `tabSales Order`.`name` = `tabProduction Order`.`sales_order`
                      and  `tabSales Order Item`.`item_code` = `tabProduction Order`.`production_item`
                         THEN `tabProduction Order`.`qty` END)
            ) is NULL;

A: First, shorten it to make it more readable:
    FROM  `tabSales Order` AS so
    LEFT JOIN  `tabSales Order Item` AS soi
               ON ( soi.`parent` = so.`name`
              AND  so.docstatus = 1  )
    LEFT JOIN  `tabItem` AS i  ON i.`item_code` = soi.`item_code`
    LEFT JOIN  `tabProduct master` AS pm
               ON pm.`part_no` = soi.`item_code`
    LEFT JOIN  `tabProduction Order` AS po
               ON (soi.`item_code` = po.`production_item`
              AND  so.`name` = po.`sales_order` )
    WHERE  so.status NOT IN ("Stopped", "Closed", "Completed" )
      AND  IFNULL(soi.delivered_qty,0) < IFNULL(soi.qty,  0 )
    GROUP BY  so.`name`
    HAVING  IFNULL(soi.qty -
                SUM(CASE WHEN so.`name` = po.`sales_order`
                   AND  soi.`item_code` = po.`production_item`
                         THEN po.`qty` END), 1) > 0

Then some general analysis, without necessarily solving the problem:

*

*Do you really need LEFT?  That is, is the "right" table optional, and you want the NULLs you might get?

*There is a difference between LEFT JOIN b ON b.x = 1 and LEFT JOIN b WHERE b.x = 1.  The former may include more b rows than the latter.

*Having NULLs is good in many situations, but if you can avoid them, the SQL becomes simpler.

More
Start by running it without "GROUP BY  tabSales Order.name".  You will get your missing lines, but you may get a lot more than you want.  If so, then remove the rest of the joins and let's see if we can add them back in without the 'implosion' of items.
To help with understanding the data, please say whether each of the relationships is 1:1 or 1:many or many:many.


text:
Q: jqgrid - json looping issue with colModel in JSON response This is in continuation of jqgrid - json looping issue with the difference that I have moved the colNames and colModel to JSON.
JSON
{
    "colModel": [
        {
            "name": "linkimg",
            "index": "linkimg",
            "width": 60,
            "align": "left",
            "jsonmap": "cells.0.links"
        }
    ],
    "colNames": [
        "linkimg"
    ],
    "mypage": {
        "outerwrapper": {
            "page": "1",
            "total": "1",
            "records": "1",
            "innerwrapper": {
                "rows": [
                    {
                        "id": "1",
                        "read": true,
                        "cells": [
                            {
                                "label": "linkimg",
                                "value": "Link-A",
                                "links": [
                                    {
                                        "name": "link1"
                                    },
                                    {
                                        "name": "link2"
                                    },
                                    {
                                        "name": "link3"
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "id": "2",
                        "read": false,
                        "cells": [
                            {
                                "label": "linkimg",
                                "value": "Link-B",
                                "links": [
                                    {
                                        "name": "link1"
                                    },
                                    {
                                        "name": "link2"
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "id": "3",
                        "read": false,
                        "cells": [
                            {
                                "label": "linkimg",
                                "value": "Link-C",
                                "links": [
                                    {
                                        "name": "link1"
                                    },
                                    {
                                        "name": "link2"
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "id": "4",
                        "read": false,
                        "cells": [
                            {
                                "label": "linkimg",
                                "value": "Link-D",
                                "links": [
                                    {
                                        "name": "link1"
                                    },
                                    {
                                        "name": "link2"
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "id": "5",
                        "read": false,
                        "cells": [
                            {
                                "label": "linkimg",
                                "value": "Link-E",
                                "links": [
                                    {
                                        "name": "link1"
                                    },
                                    {
                                        "name": "link2"
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "id": "6",
                        "read": false,
                        "cells": [
                            {
                                "label": "linkimg",
                                "value": "Link-F",
                                "links": [
                                    {
                                        "name": "link1"
                                    },
                                    {
                                        "name": "link2"
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "id": "7",
                        "read": false,
                        "cells": [
                            {
                                "label": "linkimg",
                                "value": "Link-G",
                                "links": [
                                    {
                                        "name": "link1"
                                    },
                                    {
                                        "name": "link2"
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "id": "8",
                        "read": false,
                        "cells": [
                            {
                                "label": "linkimg",
                                "value": "Link-H",
                                "links": [
                                    {
                                        "name": "link1"
                                    },
                                    {
                                        "name": "link2"
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "id": "9",
                        "read": false,
                        "cells": [
                            {
                                "label": "linkimg",
                                "value": "Link-I",
                                "links": [
                                    {
                                        "name": "link1"
                                    },
                                    {
                                        "name": "link2"
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "id": "10",
                        "read": false,
                        "cells": [
                            {
                                "label": "linkimg",
                                "value": "Link-J",
                                "links": [
                                    {
                                        "name": "link1"
                                    },
                                    {
                                        "name": "link2"
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "id": "11",
                        "read": false,
                        "cells": [
                            {
                                "label": "linkimg",
                                "value": "Link-K",
                                "links": [
                                    {
                                        "name": "link1"
                                    },
                                    {
                                        "name": "link2"
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "id": "12",
                        "read": false,
                        "cells": [
                            {
                                "label": "linkimg",
                                "value": "Link-L",
                                "links": [
                                    {
                                        "name": "link1"
                                    },
                                    {
                                        "name": "link2"
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "id": "13",
                        "read": false,
                        "cells": [
                            {
                                "label": "linkimg",
                                "value": "Link-M",
                                "links": [
                                    {
                                        "name": "link1"
                                    },
                                    {
                                        "name": "link2"
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "id": "14",
                        "read": false,
                        "cells": [
                            {
                                "label": "linkimg",
                                "value": "Link-N",
                                "links": [
                                    {
                                        "name": "link1"
                                    },
                                    {
                                        "name": "link2"
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "id": "15",
                        "read": true,
                        "cells": [
                            {
                                "label": "linkimg",
                                "value": "Link-O",
                                "links": [
                                    {
                                        "name": "link1"
                                    },
                                    {
                                        "name": "link2"
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        }
    }
}

JQGrid Definition
$(document).ready(function () {
    $.ajax({
        type: "GET",
        url: "myjqgrid.json",
        data: "",
        dataType: "json",
        success: function(response){
            var columnData = response.mypage.outerwrapper,
                columnNames = response.colNames,
                columnModel = response.colModel;

            $("#myjqgrid").jqGrid({
                datatype: 'jsonstring',
                datastr: columnData,
                colNames: columnNames,
                colModel: columnModel,
                jsonReader: {
                    root: "innerwrapper.rows",
                    repeatitems: false
                },
                gridview: true,
                pager: "#Pager",
                rowNum: 2,
                rowList: [2, 4, 6, 8],
                viewrecords: true,
                recordpos: 'left',
                multiboxonly: true,
                multiselect: true,
                sortname: 'id',
                sortorder: "desc",
                sorttype: "text",
                sortable: true,
                caption: "
My JQGrid
",
                width: "1406",
                height: "100%",
                scrolloffset: 0,
                loadonce: true,
                cache: true,
                loadComplete: function(data){

                }
            });
        }
    });
    $("#myjqgrid").jqGrid('navGrid','#Pager');

});

Problem
How do I take formatter: out of the colModel? If I keep it in JSON, the jqgrid does not display.

A: If you don't need unformatter you can extend the list of predefined formatters with your formatter:
$.fn.fmatter.myLinkFormatter = function (val, options, rawObject) {
    ....
};

and then use "formatter": "myLinkFormatter" in the column definition
{
    "colModel": [
        {
            "name": "linkimg",
            "index": "linkimg",
            "width": 60,
            "align": "left",
            "formatter": "myLinkFormatter",
            "jsonmap": "cells.0.links"
        }
    ],
    "colNames": [
        "linkimg"
    ],
    "mypage": {
        "outerwrapper": {
        ...
    }
}

See the demo.
One more remark: you should move $("#myjqgrid").jqGrid('navGrid','#Pager'); inside of success handler like I done in the demo.


text:
Q: Mysql DISTINCT and ORDER BY not working I have this query:
    SELECT
  DISTINCT (entries.guid),
  locales.*,
  locales.guid as locale_guid,
  entries.*,
  node.category_guid,
  node.title as node_title,
  nodelocs.caption as node_caption,
  nodelocs.uri as node_uri,
  nodelocs.url as node_url
FROM entries AS entries
  JOIN entry_locales AS locales ON (locales.entry_guid=entries.guid)
  LEFT JOIN nodes AS node ON (node.guid=entries.node_guid)
  LEFT JOIN node_locales AS nodelocs ON (nodelocs.node_guid=entries.node_guid AND nodelocs.lang_guid=locales.lang_guid)

  LEFT JOIN metrics as metrics_default ON (entries.guid = metrics_default.entry_guid)
WHERE

  metrics_default.customer_guid='453b894967968204'

  AND metrics_default.metrics='entryview'

  AND locales.lang_guid='4b5747548a5bd457'

  AND locales.state='1' AND entries.node_guid IN  (SELECT child_guid FROM node_children WHERE guid IN ('4b084f280caffbef') )  ORDER BY metrics_default._updated DESC LIMIT 0,10

So I want to get items with unique guids and want to order it by '_updated' field from 'metricts_default' table. But nothing happens.
If I delete DISTINCT() - result is fine, but with duplicates.

A: you misunderstand the distinct
keyword distinct here does not mean you will get distinct entries.guid, but different row
what this mean is the row with same guid but different In other fields will not be eliminated by MySQL.


text:
Q: How to switch back from one layout to the parent layout in the same activity I'm creating a quiz app. Users are shown clues and have to guess the answer.
I have an activity with two layouts nested inside the "parent" constraint layout. The reason for this is that I needed a custom layout so I could pull rows from three columns from an SQLite database and display them in the app. These are the clues.
The top part of the activity is therefore this layout and the bottom part of the activity is another constraint layout that contains the buttons (refresh button to refresh the clues and check answer button) and the text view allowing the user to enter their text.
When I enter my activity, everything works fine. Clues are displayed and all buttons work.
When I press the refresh button (to refresh the clues), it refresh's the clue and then stops the buttons in the bottom layout from working, i.e I press them but nothing happens. My theory is that when I run the method that, it switches everything to the top layout and that stays (disabling the buttons in the bottom layout).
The bit of code that refresh's the clues, and therefore is causing the issue is this:
 public void getPlayerHistory() { // Method used to get player history from DatabaseAccess.java,
                                 // assign to list and place in the ListView

    setContentView(R.layout.view_player_history); //the main layout everything is being displayed in

    DatabaseAccess databaseAccess = DatabaseAccess.getInstance(getApplicationContext());
    databaseAccess.open();

    userList = new ArrayList<>();
    Cursor data = databaseAccess.getListContents();

    int numRows = data.getCount();

    while (data.moveToNext()){
        user = new User(data.getString(0), data.getString(1),
                data.getString(2));
        userList.add(user);
    }
    databaseAccess.close();
    com.example.transfergame.ThreeClass adapter =
            new com.example.transfergame.ThreeClass(this, R.layout.list_adapter_view, userList);
    listView = (ListView) findViewById(R.id.listView);
    listView.setAdapter(adapter);
    Log.i("get player history", "playerHistoryFunction Run");

}

I think the issue is coming from this line
        com.example.transfergame.ThreeClass adapter =
            new com.example.transfergame.ThreeClass(this, R.layout.list_adapter_view, userList);

where I switch to my custom layout, but I'm not exactly sure what to code to then switch back to my parent layout.
Can someone point me in the right direction?

A: The issue actually came from
     public void getPlayerHistory() {

    setContentView(R.layout.view_player_history);

For some reason, setting this within this method, and not the onCreate() method was causing the issue. I have taken this out and put it in the onCreate() method and now everything runs fine.


text:
Q: finding the MAX number of characters in the list : Python code i have written the bellow code and i need to get the MAX number of characters from the list it gives.
def ssin(a):
    ASAS = map(lambda y: (chr(ord('A')+y),len(filter(lambda x: ord(x) - ord('A') == y, a))),range(0,26))
    return ASAS

ssin('THE AGES OF THE KINGS')

answer:
[('A', 1), ('B', 0), ('C', 0), ('D', 0), ('E', 3), ('F', 1), ('G', 2),
('H', 2), ('I', 1), ('J', 0), ('K', 1), ('L', 0), ('M', 0), ('N', 1),
('O', 1), ('P', 0), ('Q', 0), ('R', 0), ('S', 2), ('T', 2), ('U', 0),
('V', 0), ('W', 0), ('X', 0), ('Y', 0), ('Z', 0)]

how to find the MAX number of characters in a given string?

A: Counter is your friend:
>>> from collections import Counter
>>> Counter(char.upper() for char in 'THE AGES OF THE KINGS' if char.isalpha()).most_common(1)
[('E', 3)]

A: Your function is painful to the eye, but if you can use this to find the most frequent value:
sorted(ssin('THE AGES OF THE KINGS'), key = itemgetter(1), reverse = True)[0]

That doesn't do anything to check whether or not there are ties for the most frequent.

A: >>> import operator
>>> freqinfo = ssin('THE AGES OF THE KINGS')
>>> max(freqinfo,key=operator.itemgetter(1))
('E',3)

Basically max(freqinfo,key=operator.itemgetter(1)) says "look for the object in freqinfo for which the freqinfo[i][1] is maximum". Because freqinfo[i] is a (letter,frequency) pair.


text:
Q: EXC_BAD_ACCESS on [SCNNode removeFromParentNode] I'm currently working on a small game, in which i'm animating a few clouds in the background. I'd like to remove these clouds afterwards by calling removeFromParentNode on the main SCNNode of the cloud. As I've read in the doc's  this should remove the Node and all it's childnodes, animations, etc.. The problem is that it always fires a EXC_BAD_ACCESS after calling removeFromParentNode..
SCNNode * clusterNode = [self getCloud];
clusterNode.position = SCNVector3Make(baseX, baseY, baseZ);

    CABasicAnimation *moveAnimation = [CABasicAnimation animationWithKeyPath:@"transform.translation.x"];
    moveAnimation.duration = 10.0;
    moveAnimation.repeatCount = 0;
    moveAnimation.fromValue = [NSNumber numberWithFloat: baseX];
    moveAnimation.toValue=[NSNumber numberWithFloat: -80.0];
    moveAnimation.removedOnCompletion = NO;
    moveAnimation.fillMode = kCAFillModeForwards;
    [moveAnimation setValue: clusterNode forKey:@"rootNode"];
    moveAnimation.delegate = self;
    [clusterNode addAnimation: moveAnimation forKey:nil];

[cloudRootNode addChildNode: clusterNode];

I'm then removing the cloud in the in the animation remove delegate.. (I've tried it in other places too, same result..)
- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag {
    NSLog(@"Animation done.");
    SCNNode * rootNode = [anim valueForKey: @"rootNode"];
    [rootNode removeFromParentNode];
    [self generateClouds];
}

Where can I start to debug such a error? Is there anything I'm obviously doing wrong? Thank's for you're help!
EDIT: I've added the err as img.

A: I stored some velocity-data in the physicsBody, which caused the crash. I'm not quite sure why, but after removing these lines, it worked. Maybe it will help someone else too..
clusterNode.physicsBody = [[SCNPhysicsBody alloc] init];
clusterNode.physicsBody.velocity= SCNVector3Make(clusterVelocityX, clusterVelocityY, clusterVelocityZ);


text:
Q: How to keep indent for second line in ordered lists via CSS? I want to have an "inside" list with list bullets or decimal numbers being all flush with superior text blocks. Second lines of list entries have to have the same indent like the first row!
E.g.:
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Aenean commodo ligula eget dolor. Aenean Aenean massa.
Cum sociis natoque penatibus et magnis dis parturient montes,
nascetur ridiculus mus. Donec quam felis,

1. Text
2. Text
3. longer Text, longer Text, longer Text, longer Text, longer Text, longer Text
   second line of longer Text
4. Text

Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Aenean commodo ligula eget dolor.

CSS provides only two values for its "list-style-position" - inside and outside. With "inside" second lines are flush with the list points not with the superior line:
3. longer Text, longer Text, longer Text, longer Text, longer Text, longer Text
second line of longer Text
4. Text

Width "outside" my list is not flush with superior text blocks anymore.
Experiments width text-indent, padding-left and margin-left work for unordered lists but they fail for ordered lists because it depends on the list-decimal's number of characters:
 Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
 Aenean commodo ligula eget dolor.

 3. longer Text, longer Text, longer Text, longer Text, longer Text, longer Text
    second line of longer Text
 4. Text
11. Text
12. Text

"11." and "12." aren't flush with the superior text block compared to "3." and "4.".
So where's the secret about ordered lists and the second-line-indent? Thank's for your effort!

A: The following CSS did the trick:
ul {
  margin-left: 1em;
}

li {
  list-style-position: outside;
  padding-left: 0.5em;
}

A: You can use CSS to select a range; in this case, you want list items 1-9:
ol li:nth-child(n+1):nth-child(-n+9)

Then adjust margins on those first items appropriately:
ol li:nth-child(n+1):nth-child(-n+9) { margin-left: .55em; }
ol li:nth-child(n+1):nth-child(-n+9) em,
ol li:nth-child(n+1):nth-child(-n+9) span { margin-left: 19px; }

See it in action here: http://www.wortfm.org/wort-madison-charts-for-the-week-beginning-11192012/

A: My solution is quite the same as Pumbaa80's one, but I suggest to use display: table instead of display:table-row for li element.
So it will be something like this:
ol {
  counter-reset: foo; /* default display:list-item */
}

ol > li {
  counter-increment: foo;
  display: table; /* instead of table-row */
}

ol > li::before {
  content: counter(foo) ".";
  display: table-cell;
  text-align: right;
}

So now we can use margins for spacing between li's

A: I believe you just need to put the list 'bullet' outside of the padding.
li {
  list-style-position: outside;
  padding-left: 1em;
}

A: The easiest and cleanest way, without any hacks, is to just to indent the ul (or ol), like so:
ol {
  padding-left: 40px; // Or whatever padding your font size needs
}

This gives the same result as the accepted answer: https://jsfiddle.net/5wxf2ayu/
Screenshot:

A: Update
This answer is outdated. You can do this a lot more simply, as pointed out in another answer below:
ul {
  list-style-position: outside;
}

See https://www.w3schools.com/cssref/pr_list-style-position.asp
Original Answer
I'm surprised to see this hasn't been solved yet. You can make use of the browser's table layout algorithm (without using tables) like this:
ol {
    counter-reset: foo;
    display: table;
}

ol > li {
    counter-increment: foo;
    display: table-row;
}

ol > li::before {
    content: counter(foo) ".";
    display: table-cell; /* aha! */
    text-align: right;
}

Demo: http://jsfiddle.net/4rnNK/1/

To make it work in IE8, use the legacy :before notation with one colon.

A: Check this fiddle:
http://jsfiddle.net/K6bLp/
It shows how to manually indent ul and ol using CSS.
HTML

    <title>Lines</title>

Text

Text

longer Text, longer Text, longer Text, longer Text    second line of longer Text

Text

Text

longer Text, longer Text, longer Text, longer Text    second line of longer Text

CSS
ol
{
    margin:0px;
    padding-left:15px;
}

ol li
{
    margin: 0px;
    padding: 0px;
    text-indent: -1em;
    margin-left: 1em;
}

ul
{
    margin:0;
    padding-left:30px;
}

ul li
{
    margin: 0px;
    padding: 0px;
    text-indent: 0.5em;
    margin-left: -0.5em;
}

Also I edited your fiddle:
http://jsfiddle.net/j7MEd/3/
Make a note of it.

A: I believe this will do what you are looking for.
.cssClass li {
  list-style-type: disc;
  list-style-position: inside;
  text-indent: -1em;
  padding-left: 1em;
}

JSFiddle: https://jsfiddle.net/dzbos70f/

A: I'm quite fond of this solution myself:
ul {
  list-style-position: inside;
  list-style-type: disc;
  font-size: 12px;
  line-height: 1.4em;
  padding: 0 1em;
}

ul li {
  margin: 0 0 0 1em;
  padding: 0 0 0 1em;
  text-indent: -2em;
}

A: You can set the margin and padding of either an ol or ul in CSS:
ol {
  margin-left: 0;
  padding-left: 3em;
  list-style-position: outside;
}

A: The ol, ul lists will work if you want you can also use a table with border: none in the css.

A: CSS provides only two values for its "list-style-position" - inside and outside. With "inside" second lines are flush with the list points not with the superior line:
In ordered lists, without intervention, if you give "list-style-position" the value "inside", the second line of a long list item will have no indent, but will go back to the left edge of the list (i.e. it will left-align with the number of the item). This is peculiar to ordered lists and doesn't happen in unordered lists.
If you instead give "list-style-position" the value "outside", the second line will have the same indent as the first line.
I had a list with a border and had this problem. With "list-style-position" set to "inside", my list didn't look like I wanted it to. But with "list-style-position" set to "outside", the numbers of the list items fell outside the box.
I solved this by simply setting a wider left margin for the whole list, which pushed the whole list toward the right, back into the position it was in before.
CSS:
ol.classname {margin:0;padding:0;}
ol.classname li {margin:0.5em 0 0 0;padding-left:0;list-style-position:outside;}
HTML:

A: Ok, I've gone back and figured some things out. This is a ROUGH SOLUTION to what I was proposing, but it seems to be functional.
First, I made the numbers a series of unordered lists. An unordered list will normally have a disc at the beginning of each list item (
*) so you have to set the CSS to list-style: none;
Then, I made the whole list display: table-row. Here, why don't I just paste you the code instead of gabbing about it?

<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
    <title>Result</title>

1.

2.

10.

110.

1000.

Some author

Another author

Author #10

Author #110

The one thousandth author today will win a free i-Pod!!!! This line also wraps around so that we can see how hanging indents look.

'

CSS:
ul li{
list-style: none;
display: table-row;
text-align: right;

}
div {
float: left;
display: inline-block;
margin: 0.2em;

}
This seems to align the text in the 2nd div with the numbers in the ordered list in the first div. I've surrounded both the list and the text with a  tag so that I can just tell all divs to display as inline-blocks. This lined them up nicely.
The margin is there to put a space between the period and the start of the text. Otherwise, they run right up against one another and it looks like an eyesore.
My employer wanted wrapped-around text (for longer bibliograhical entries) to line up with the start of the first line, not the left-hand margin. Originally I was fidgeting with a positive margin and a negative text indent, but then I realized that when I switched to two different divs, this had the effect of making it so that the text all lined up because the left-hand margin of the div was the margin where text naturally began. Thus, all I needed was a 0.2em margin to add some space, and everything else lined up swimmingly.
I hope this helps if OP was having a similar issue...I had a hard time understanding him/her.

A: I had this same issue and started using user123444555621's answer.  However, I also needed to add padding and a border to each li, which that solution doesn't allow because each li is a table-row.
First, we use a counter to replicate the ol's numbers.
We then set display: table; on each li and display: table-cell on the :before to give us the indentation.
Finally, the tricky part.  Since we aren't using a table layout for the whole ol we need to ensure each :before is the same width. We can use the ch unit to roughly keep the width equal to the number of characters. In order to keep the widths uniform when the number of digits for the :before's differ, we can implement quantity queries. Assuming you know your lists won't be 100 items or more, you only need one quantity query rule to tell :before to change its width, but you can easily add more.

ol {
  counter-reset: ol-num;
  margin: 0;
  padding: 0;
}

ol li {
  counter-increment: ol-num;
  display: table;
  padding: 0.2em 0.4em;
  border-bottom: solid 1px gray;
}

ol li:before {
  content: counter(ol-num) ".";
  display: table-cell;
  width: 2ch; /* approximately two characters wide */
  padding-right: 0.4em;
  text-align: right;
}

/* two digits */
ol li:nth-last-child(n+10):before,
ol li:nth-last-child(n+10) ~ li:before {
  width: 3ch;
}

/* three digits */
ol li:nth-last-child(n+100):before,
ol li:nth-last-child(n+100) ~ li:before {
  width: 4ch;
}

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequuntur facere veniam saepe vel cumque, nobis quisquam! Velit maiores blanditiis cum in mollitia quas facere sint harum, officia laborum, amet vero!

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequuntur facere veniam saepe vel cumque, nobis quisquam! Velit maiores blanditiis cum in mollitia quas facere sint harum, officia laborum, amet vero!

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequuntur facere veniam saepe vel cumque, nobis quisquam! Velit maiores blanditiis cum in mollitia quas facere sint harum, officia laborum, amet vero!

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequuntur facere veniam saepe vel cumque, nobis quisquam! Velit maiores blanditiis cum in mollitia quas facere sint harum, officia laborum, amet vero!

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequuntur facere veniam saepe vel cumque, nobis quisquam! Velit maiores blanditiis cum in mollitia quas facere sint harum, officia laborum, amet vero!

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequuntur facere veniam saepe vel cumque, nobis quisquam! Velit maiores blanditiis cum in mollitia quas facere sint harum, officia laborum, amet vero!

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequuntur facere veniam saepe vel cumque, nobis quisquam! Velit maiores blanditiis cum in mollitia quas facere sint harum, officia laborum, amet vero!

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequuntur facere veniam saepe vel cumque, nobis quisquam! Velit maiores blanditiis cum in mollitia quas facere sint harum, officia laborum, amet vero!

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequuntur facere veniam saepe vel cumque, nobis quisquam! Velit maiores blanditiis cum in mollitia quas facere sint harum, officia laborum, amet vero!

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequuntur facere veniam saepe vel cumque, nobis quisquam! Velit maiores blanditiis cum in mollitia quas facere sint harum, officia laborum, amet vero!


text:
Q: Deploying a WebApp using Glassfish and IntelliJ I'm starting out learning to build a Java EE Web App and following a tutorial which uses Eclipse though I use IntelliJ.
I've build the basic structure and can run the Glassfish server successfully so I see the welcome page at localhost:8080
I'm having some trouble seeing my servlet output displayed however as I get a 404.
When I go to http://localhost:8080/web1_war_exploded/ then I see the output from the index.jsp file
What I want to see is the HTML output from my AddPassenger class when I visit:
http://localhost:8080/web1/AddPassenger.  Instead I get a 404:

I think I've configured everything as per IntelliJ's own instructions and have created a .war and a Manifest.  I'm just unclear how to deploy and see my AddPassenger servlet which is simply:
@WebServlet(name = "/AddPassenger")
public class AddPassenger extends HttpServlet {
private static final long serialVersionUID = 1L;

public AddPassenger(){
    super();
}

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    PrintWriter out = response.getWriter();

    response.setContentType("text/html");

    out.println("");
    out.println("");
    out.println("
Welcome to World Adventures Airlines!
");
    out.println("");
}

protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

}

}
This is my project structure:

A: Change @WebServlet(name = "/AddPassenger") to @WebServlet(value = "/AddPassenger"). In this case it should work on  http://localhost:8080/web1_war_exploded/AddPassenger.
Also using annotations no need to declare servlets in web.xml. And make sure that your glassfish version supports servlet 3.0.
To change path of url from /web1_war_exploded/ to /web1/ go to the File->Project Structure and change output dir:


text:
Q: error: failed to open stream: No such file or directory in file I have a sample code using laravel

error: failed to open stream: No such file or directory in file

$test = 'sample_remote_tempfile.txt';
$content = Storage::get('upload/'.$test);
foreach (file($content) as $line) {
     explode(" , ", trim($content),"\n");
     die($content);
}

A: (   IF USE LARAVEL   )
use command, to clear autoload files, and update routes to load new names of clases.
> composer dumpautoload

Check your routes file, to verify that all class names are spelled correctly
routes\web.php


text:
Q: Survey Monkey user responses over 100 on free trial I am creating this survey to track exit interviews for my job. I am wondering, and could not find anywhere, if i fill up my 100 responses for one survey then what happens? Will I not be able to ever view the next ones over 100? Can I just delete old survey responses and view new ones? Will these new ones be recorded in the data of the surveys? Do I have to make another identical survey to record more responses?
Thanks

A: Pretty clearly described on their pricing page.

With a free plan, you can collect more than 100 responses, but you can only view the first 100 responses. Upgrade at any time to access additional responses. Our STANDARD Monthly plan includes 1000 responses per monthly billing cycle across all your surveys with a $0.15 charge per additional response. All annual plans include an unlimited number of responses.

If you need more than their free trial offers, pay for the service.


text:
Q: Assembly instruction for setting, clearing OF & TF flags Are there any assembly instructions to let us directly "set" or "clear" the "OF" and "TF" flags in Intel's 8086  16-bit Flags register ? If not, what pseudo code should we use?

A: http://en.wikipedia.org/wiki/Trap_flag

The 8086 has no instruction to directly set or reset the trap flag. These operations are done by pushing the flag register on the stack, changing the trap flag bit to what the programmer wants it to be, and then popping the flag register back off the stack. The instructions to set the trap flag are:

PUSHF ; Push flags on stack
MOV BP,SP  ; Copy SP to BP for use as index
OR WORD PTR[BP+0],0100H ; Set TF flag
POPF  ; Restore flag Register

To reset the trap flag, simply replace the OR instruction in the preceding sequence with the instruction:

AND WORD PTR[BP+0],0FEFFH

To set and clear the overflow flag, you can do the same, replacing 0100H with 0800H and 0FEFFh with 0F7FFh.
Be sure to know what TF does before you set it. It's a trap.


text:
Q: Default Command not work Hej i have some problem with my log in form.
In form i have 2 action:
<p:commandButton id="newUserButton" action="newUser" immediate="true" icon="ui->icon-plus" value="Zarejestruj się" />
<p:commandButton id="submitButton" action="confirmSignIn" update="logPanelGrid,messages" icon="ui-icon-check" value="Zaloguj się" />

and when i press enter on my keyboard i want to select automaticly second action "confirmSignIn"
When i hit enter application execute action "newUser"
i tryed use Default Command.
and i add some class:
package org.primefaces.examples.view;

public class DefaultCommandBean
{

    private String btn;

public DefaultCommandBean(String btn) {
        this.btn = btn;
    }

public String getBtn() {
    return btn;
}

public void setBtn(String btn) {
    this.btn = btn;
}

}

and i add some line to xhtml:
<p:defaultCommand target="#{defaultCommandBean.btn}" />

when i restart tomcat i get:
SEVERE: Error Rendering View[/WEB-INF/flows/main/welcome.xhtml]
java.lang.IllegalArgumentException: ""

can anyone knows where can be a problem ? i have no clue;/

A: First: Your action attribute needs an EL expression. Instead of
<p:commandButton ... action="newUser" ... />
<p:commandButton ... action="confirmSignIn" ... />

<p:commandButton ... action="#{yourBean.newUser}" ... />
<p:commandButton ... action="#{yourBean.confirmSignIn}" ... />

whereas yourBean needs the methods newUser and confirmSignIn.
Secondly: Check the values of the String btn in DefaultCommandBean, are the values newUserButton and submitButton?


text:
Q: Debian package available for ia64 but not for x86_64? I want to download aptitude to build it from source on my 64bit machine.
It is a Thinkpad with a normal x86_64 CPU, nothing special.
The download page only has:

*

*alpha

*amd64

*armel

*armhf

*hppa

*hurd-i386

*i386

*ia64

*kfreebsd-amd64

*kfreebsd-i386

*m68k

*mips

*mipsel

*powerpc

*powerpcspe

*ppc64

*s390

*s390x

*sh4

*sparc

*sparc64

*x32

I find it hard to believe x86_64 is not available.
Am I missing something?
Note: I believe ia64 is for Itanium, so not for me.

A: What you're looking for is called "amd64".
"ia64" it's Itanium, "i386" is 32bit Intel 386.
The 64bit architecture was originally developed by AMD, and then adopted by Intel.


text:
Q: c++ delete [] always hangs I have implemented my own simple vector, all functions seems fine except on alloc_new(), when it tries to create new memory and copy the contents their and delete the old memory allocation.
My programs always hangs and never execute after that.
                class myvector{
            private:
                int vsize, maxsize;
                int* arr;
                void alloc_new();
            public:
                myvector();
                myvector(int);
                myvector(const myvector&);
                ~myvector();

                void push_back(int);
                int size();
                int operator[](int);
                int at(int);
                void display();
            };

            myvector::myvector(){
                maxsize = 20;
                vsize = 0;
                arr = new int[maxsize];
            }

            void myvector::alloc_new(){
                // Allocate new space, double of current size
                maxsize = maxsize*2;
                int* arr_new = new int[maxsize];
                //copy the elements from the base location to new location
                for(int i=0; i < vsize ; i++)
                    arr_new[i] = arr[i];
                delete[] arr;  // MY PROGRAM ALWAYS HANGS HERE
                arr = arr_new;
            }

            void myvector::push_back(int val){
                if((vsize+1) > maxsize)
                    alloc_new();
                arr[++vsize] = val;
            }

            int main(){
                myvector vect;
                for(int i=0;i<25;i++){
                    vect.push_back(rand()%100+1);
                }
                getch();
            }

A: The problem is that your "have we reached max size" is wrong. You are comparing vsize + 1 > maxsize. This means that you are writing to arr[++vsize] when vsize + 1 == maxsize. This writes one element PAST your allocation [in other words, index 20 were 0..19 are valid indices], and thus goes wrong.
Fix the code like this:
void myvector::push_back(int val){
    if((vsize+1) >= maxsize)
    alloc_new();
    arr[++vsize] = val;
}

Using valgrind will tell you:
$ valgrind ./a.out
==20918== Memcheck, a memory error detector
==20918== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==20918== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==20918== Command: ./a.out
==20918==
==20918== Invalid write of size 4
==20918==    at 0x4009E9: myvector::push_back(int) (in /home/MatsP/src/junk/a.out)
==20918==    by 0x400AA1: main (in /home/MatsP/src/junk/a.out)
==20918==  Address 0x5a20090 is 0 bytes after a block of size 80 alloc'd
==20918==    at 0x4C2A77C: operator new[](unsigned long) (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==20918==    by 0x4008B4: myvector::myvector() (in /home/MatsP/src/junk/a.out)
==20918==    by 0x400A57: main (in /home/MatsP/src/junk/a.out)
==20918==
==20918==
==20918== HEAP SUMMARY:
==20918==     in use at exit: 0 bytes in 0 blocks
==20918==   total heap usage: 2 allocs, 2 frees, 240 bytes allocated
==20918==
==20918== All heap blocks were freed -- no leaks are possible
==20918==
==20918== For counts of detected and suppressed errors, rerun with: -v
==20918== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)


text:
Q: DynamicLinks iOS: await dynamicLinks().getInitialLink() works on debug, but doesn't work on release mode await dynamicLinks().getInitialLink() works in debug mode, but doesn't work in release mode on iOS.
await dynamicLinks().getInitialLink() work fine for android debug and release mode but  when i use dynamic link in debug mode it work fine but when i create release mode for app this will return always null. not getting after sometimes of wait because i research on that issue somebody getting link after some wait of times but in my case it will not return any link after wait of sometimes.
I spent a day for finding the solution for that but nothing work for me. I tried all most the solution which mention in #2660  #4548 #3450 but not work any solution for me.
Project Files
export const getInitialLink = async ()=> {
  const link = await dynamicLinks().getInitialLink();
  const id = onHandleDynamicLink(link);
  return id;
};

export const onHandleDynamicLink = link => {
  if (link) {
    const linkUrl = url.parse(link.url, true);
    const VideoId = linkUrl.path.split('/')[2];
    return VideoId;
  }
  return null;
};

import {getInitialLink} from '../../helpers/dynamicLinksHelper';
const Id = await getInitialLink();`

package.json:
"@react-native-firebase/app": "^16.4.6",
"@react-native-firebase/dynamic-links": "^16.4.6",
 "react-native": "0.64.2",

iOS
source 'https://github.com/CocoaPods/Specs.git
target 'project' do
  config = use_native_modules!

  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => false
  )
  pod 'Firebase', :modular_headers => true
  pod 'FirebaseCoreInternal', :modular_headers => true
  pod 'GoogleUtilities', :modular_headers => true
  pod 'FirebaseCore', :modular_headers => true
  # add the Firebase pod for Google Analytics
  # pod 'Firebase/Analytics'

  # pod 'react-native-webview', :path => '../node_modules/react-native-webview'

  # pod 'RNAWSCognito', :path => '../node_modules/amazon-cognito-identity-js'

  # pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"

  # pod 'RNDeviceInfo', :path => '../node_modules/react-native-device-info'

  target 'newslineisitanywayTests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable the next line.
  use_flipper!()

  post_install do |installer|
    react_native_post_install(installer)
  end
end

AppDelegate.m:
#import "AppDelegate.h"
#import <React/RCTLinkingManager.h>
#import <RNFBDynamicLinksAppDelegateInterceptor.h>
#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <UserNotifications/UserNotifications.h>
#import <RNCPushNotificationIOS.h>
@import Firebase;
#import "RNFBMessagingModule.h"
#ifdef FB_SONARKIT_ENABLED
#import <FlipperKit/FlipperClient.h>
#import <FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.h>
#import <FlipperKitUserDefaultsPlugin/FKUserDefaultsPlugin.h>
#import <FlipperKitNetworkPlugin/FlipperKitNetworkPlugin.h>
#import <SKIOSNetworkPlugin/SKIOSNetworkAdapter.h>
#import <FlipperKitReactPlugin/FlipperKitReactPlugin.h>

static void InitializeFlipper(UIApplication *application) {
  FlipperClient *client = [FlipperClient sharedClient];
  SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults];
  [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]];
  [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]];
  [client addPlugin:[FlipperKitReactPlugin new]];
  [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];
  [client start];
}
#endif

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  [RNFBDynamicLinksAppDelegateInterceptor sharedInstance];
#ifdef FB_SONARKIT_ENABLED
  InitializeFlipper(application);
#endif`your text`

  UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
  center.delegate = self;

  NSDictionary *appProperties = [RNFBMessagingModule addCustomPropsToUserProps:nil withLaunchOptions:launchOptions];

  RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
  RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
                                                   moduleName:@"newslineisitanyway"
                                            initialProperties:appProperties];

  if (@available(iOS 13.0, *)) {
      rootView.backgroundColor = [UIColor systemBackgroundColor];
  } else {
      rootView.backgroundColor = [UIColor whiteColor];
  }

  [[FBSDKApplicationDelegate sharedInstance] application:application
                             didFinishLaunchingWithOptions:launchOptions];

  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  UIViewController *rootViewController = [UIViewController new];
  rootViewController.view = rootView;
  self.window.rootViewController = rootViewController;
  [self.window makeKeyAndVisible];
  [FIRApp configure];
  return YES;
}

- (BOOL)application:(UIApplication *)application
            openURL:(NSURL *)url
  sourceApplication:(NSString *)sourceApplication
         annotation:(id)annotation {
  return [[FBSDKApplicationDelegate sharedInstance] application:application
                                                         openURL:url
                                               sourceApplication:sourceApplication
                                                      annotation:annotation];
}

- (void)applicationDidBecomeActive:(UIApplication *)application {
  [FBSDKAppEvents activateApp];
}

// Required for the register event.
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{
// [RNCPushNotificationIOS didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
}
// Required for the notification event. You must call the completion handler after handling the remote notification.
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
{
//  [RNCPushNotificationIOS didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
}
// Required for the registrationError event.
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
{
// [RNCPushNotificationIOS didFailToRegisterForRemoteNotificationsWithError:error];
}
// Required for localNotification event
- (void)userNotificationCenter:(UNUserNotificationCenter *)center
didReceiveNotificationResponse:(UNNotificationResponse *)response
         withCompletionHandler:(void (^)(void))completionHandler
{
//  [RNCPushNotificationIOS didReceiveNotificationResponse:response];
}

-(void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler
{
  completionHandler(UNNotificationPresentationOptionSound | UNNotificationPresentationOptionAlert | UNNotificationPresentationOptionBadge);
}
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
  return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
  return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}
- (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity
 restorationHandler:(nonnull void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler
{
 return [RCTLinkingManager application:application
                  continueUserActivity:userActivity
                    restorationHandler:restorationHandler];
}
- (BOOL)application:(UIApplication *)application
   openURL:(NSURL *)url
   options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
  RNFBDynamicLinksAppDelegateInterceptor *interceptor = [RNFBDynamicLinksAppDelegateInterceptor sharedInstance];
      if (url && !interceptor.initialLinkUrl)
      {
          FIRDynamicLink *dynamicLink = [[FIRDynamicLinks dynamicLinks] dynamicLinkFromCustomSchemeURL:url];
          if (dynamicLink.url)
          {
              interceptor.initialLinkUrl = dynamicLink.url.absoluteString;
              interceptor.initialLinkMinimumAppVersion = dynamicLink.minimumAppVersion == nil ? [NSNull null] : dynamicLink.minimumAppVersion;
          }
      }
      return [RCTLinkingManager application:application openURL:url options:options];
      return YES;

}

@end`

Environment
react-native info output:

*

*Platform that you're experiencing the issue on:

*

*[x] iOSyour text

*Are you using TypeScript?

*

*NO