text:
Q: Creating an ICNS programmatically: "Unsupported Image Size" I'm trying to create an ICNS (including a 1024x1024 image) programmatically. Currently I'm creating an NSImage, then I create CGImageRef objects with the appropriate resolution, finally I'm adding them to an icon by using CGImageDestinationAddImage(). Peter Hosey has helped me create '@2x' images already, but the sizes of the images don't wanna be set.
This is the code (still a bit messy, sourcefile represents the path to the image):
NSSize sizes[10];
sizes[0] = NSMakeSize(1024,1024);
sizes[1] = NSMakeSize(512,512);
sizes[2] = NSMakeSize(512,512);
sizes[3] = NSMakeSize(256,256);
sizes[4] = NSMakeSize(256,256);
sizes[5] = NSMakeSize(128,128);
sizes[6] = NSMakeSize(64,64);
sizes[7] = NSMakeSize(32,32);
sizes[8] = NSMakeSize(32,32);
sizes[9] = NSMakeSize(16,16);
int count = 0;
for (int i=0 ; i<10 ; i++) {
    if ([[NSUserDefaults standardUserDefaults] boolForKey:[NSString stringWithFormat:@"Size%i",i+1]]) count++;
}
NSURL *fileURL = [NSURL fileURLWithPath:aPath];

// Create icns
CGImageDestinationRef dr = CGImageDestinationCreateWithURL((CFURLRef)fileURL, kUTTypeAppleICNS , count, NULL);
NSImage *img = [[NSImage alloc] initWithContentsOfFile:sourcefile];
for (int i=0 ; i<10 ; i++) {
    if ([[NSUserDefaults standardUserDefaults] boolForKey:[NSString stringWithFormat:@"Size%i",i+1]]) {

        // Create dictionary
        BOOL is2X = true;
        if (i == 1 || i == 3 || i == 5 || i == 7 || i == 9) is2X = false;
        int dpi = 144, size = (int)(sizes[i].width/2);
        if (!is2X) {dpi = 72;size = sizes[i].width;}
        [img setSize:NSMakeSize(size,size)];
        for (NSImageRep *rep in [img representations])[rep setSize:NSMakeSize(size,size)];
        const void *keys[2] = {kCGImagePropertyDPIWidth, kCGImagePropertyDPIHeight};
        const void *values[2] = {CFNumberCreate(0, kCFNumberSInt32Type, &dpi), CFNumberCreate(0, kCFNumberSInt32Type, &dpi)};
        CFDictionaryRef imgprops = CFDictionaryCreate(NULL, keys, values, 2, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);

        // Add image
        NSRect prect = NSMakeRect(0,0,size,size);
        CGImageRef i1 = [img CGImageForProposedRect:&prect context:nil hints:nil];
        CGImageDestinationAddImage(dr, i1, imgprops);
    }
}
CGImageDestinationFinalize(dr);
CFRelease(dr);

size is the width or height that the current image should be. dpi is 144 if we're making an '@2x' image, otherwise it's 72. These values have been checked with NSLog.
The images in the resulting ICNS file are all the same size as the input image. If the size of the input image is 1024x1024, ImageIO complains:

ImageIO:   _CGImagePluginWriteICNS unsupported image size (1024 x 1024) - scaling factor: 1

The above error is displayed every time the dpi is 72 and the size is 1024x1024.
I need to know how to set the size of the CGImage that is to be added to the ICNS file.

EDIT: I logged the images:

2012-12-31 12:48:51.281 Eicon[912:680f] |NSImage 0x101b4caf0
  Size={512, 512} Reps=(
"NSBitmapImageRep 0x10380b900 Size={512, 512} ColorSpace=(not yet loaded) BPS=8 BPP=(not yet loaded) Pixels=1024x1024 Alpha=YES

Planar=NO Format=(not yet loaded) CurrentBacking=nil (faulting)
  CGImageSource=0x10380ae70"
)|
2012-12-31 12:48:52.058 Eicon[912:680f] |NSImage 0x101b4caf0
  Size={512, 512} Reps=(
"NSBitmapImageRep 0x10380b900 Size={512, 512} ColorSpace=Generic RGB colorspace BPS=8 BPP=32 Pixels=1024x1024 Alpha=YES Planar=NO

Format=2 CurrentBacking=|CGImageRef: 0x101c14630|
  CGImageSource=0x10380ae70"
)|
2012-12-31 12:48:52.111 Eicon[912:680f] |NSImage 0x101b4caf0
  Size={256, 256} Reps=(
"NSBitmapImageRep 0x10380b900 Size={256, 256} ColorSpace=Generic RGB colorspace BPS=8 BPP=32 Pixels=1024x1024 Alpha=YES Planar=NO

Format=2 CurrentBacking=|CGImageRef: 0x101c14630|
  CGImageSource=0x10380ae70"
)|
2012-12-31 12:48:52.238 Eicon[912:680f] |NSImage 0x101b4caf0
  Size={256, 256} Reps=(
"NSBitmapImageRep 0x10380b900 Size={256, 256} ColorSpace=Generic RGB colorspace BPS=8 BPP=32 Pixels=1024x1024 Alpha=YES Planar=NO

Format=2 CurrentBacking=|CGImageRef: 0x101c14630|
  CGImageSource=0x10380ae70"
)|
2012-12-31 12:48:52.309 Eicon[912:680f] |NSImage 0x101b4caf0
  Size={128, 128} Reps=(
"NSBitmapImageRep 0x10380b900 Size={128, 128} ColorSpace=Generic RGB colorspace BPS=8 BPP=32 Pixels=1024x1024 Alpha=YES Planar=NO

Format=2 CurrentBacking=|CGImageRef: 0x101c14630|
  CGImageSource=0x10380ae70"
)|
2012-12-31 12:48:52.409 Eicon[912:680f] |NSImage 0x101b4caf0
  Size={128, 128} Reps=(
"NSBitmapImageRep 0x10380b900 Size={128, 128} ColorSpace=Generic RGB colorspace BPS=8 BPP=32 Pixels=1024x1024 Alpha=YES Planar=NO

Format=2 CurrentBacking=|CGImageRef: 0x101c14630|
  CGImageSource=0x10380ae70"
)|
2012-12-31 12:48:52.534 Eicon[912:680f] |NSImage 0x101b4caf0 Size={32,
  32} Reps=(
"NSBitmapImageRep 0x10380b900 Size={32, 32} ColorSpace=Generic RGB colorspace BPS=8 BPP=32 Pixels=1024x1024 Alpha=YES Planar=NO Format=2

CurrentBacking=|CGImageRef: 0x101c14630| CGImageSource=0x10380ae70"
)|
2012-12-31 12:48:52.616 Eicon[912:680f] |NSImage 0x101b4caf0 Size={32,
  32} Reps=(
"NSBitmapImageRep 0x10380b900 Size={32, 32} ColorSpace=Generic RGB colorspace BPS=8 BPP=32 Pixels=1024x1024 Alpha=YES Planar=NO Format=2

CurrentBacking=|CGImageRef: 0x101c14630| CGImageSource=0x10380ae70"
)|
2012-12-31 12:48:52.729 Eicon[912:680f] |NSImage 0x101b4caf0 Size={16,
  16} Reps=(
"NSBitmapImageRep 0x10380b900 Size={16, 16} ColorSpace=Generic RGB colorspace BPS=8 BPP=32 Pixels=1024x1024 Alpha=YES Planar=NO Format=2

CurrentBacking=|CGImageRef: 0x101c14630| CGImageSource=0x10380ae70"
)|
2012-12-31 12:48:52.864 Eicon[912:680f] |NSImage 0x101b4caf0 Size={16,
  16} Reps=(
"NSBitmapImageRep 0x10380b900 Size={16, 16} ColorSpace=Generic RGB colorspace BPS=8 BPP=32 Pixels=1024x1024 Alpha=YES Planar=NO Format=2

CurrentBacking=|CGImageRef: 0x101c14630| CGImageSource=0x10380ae70"
)|

A: The error message is correct. You're putting in images of a size that is not supported by the IconFamily format. Specifically, from your output:

2012-12-26 13:48:57.682 Eicon[1131:1b0f] |NSImage 0x1025233b0 Size={11.52, 11.52} Reps=( "NSBitmapImageRep 0x10421fc30 Size={11.52, 11.52} ColorSpace=(not yet loaded) BPS=8 BPP=(not yet loaded) Pixels=1024x1024 Alpha=NO Planar=NO Format=(not yet loaded) CurrentBacking=nil (faulting) CGImageSource=0x104221170"

11.52 points is not a valid size for any element of an IconFamily. You need to find out why this image and rep have that size.
A couple of other things:

*

*As I told you on that other answer, you don't need to change the pixel size of the representation. Leave the pixel size alone. Set the size (point size) of the rep and image (preferably to something valid).

*The -[NSImage initWithSize:] documentation says:

It is permissible to initialize the receiver by passing a size of (0.0, 0.0); however, the receiver's size must be set to a non-zero value before the NSImage object is used or an exception will be raised.

You are not setting either object's size, which is what you need to do. (I'm surprised you're not getting an exception about this like the documentation promises.)
As I mentioned on your other question, there is no 1024-point element anymore; the correct specification for a 1024-by-1024-pixel element is as 512 points @ 2x. That's a size (of both image and rep) of (NSSize){ 512.0, 512.0 } (points), with the rep being 1024 pixelsWide and 1024 pixelsHigh.

Looks like I was missing one key ingredient before. Here it is.
The CGImage that you give to the CGImageDestination doesn't have a point size associated with it—only NSImages and NSImageReps have that. The CGImage only has a pixel size; nothing to indicate the image's physical size or resolution.
To tell the CGImageDestination whether a given CGImage is meant to be @ 1x or @ 2x, you need to create a dictionary that gives the image's DPI:
NSDictionary *imageProps1x = @{
    (__bridge NSString *)kCGImagePropertyDPIWidth: @72.0,
    (__bridge NSString *)kCGImagePropertyDPIHeight: @72.0,
};
NSDictionary *imageProps2x = @{
    (__bridge NSString *)kCGImagePropertyDPIWidth: @144.0,
    (__bridge NSString *)kCGImagePropertyDPIHeight: @144.0,
};

Pass the correct dictionary as the last argument to CGImageDestinationAddImage.


text:
Q: Redirecting to another page without sending any value in query string I'm trying to perform user verification when the user logs in for the first time. If the user is not verified already then i send its userid from  the code  to call back method
and in the callback I redirect it to another page using
(window.location.href = "/verifyuser?id=" + response.userId)

however i do not want it this way. instead i would like to do an ajax call to the url with the value. i don't want the userId to be visible in the url.
I tried using
$.ajax({

     type:"POST"
     url:"/verifyuser",
     data:{id:response.userId},
     async:false
});

but it didn't work. My server side code is below(i am using mvc 4)
    [HttpGet]
    public ActionResult VerifyUser(string id)
    {
        ViewBag.Id = id;
        return View("~/Views/User/VerifyUser.cshtml");
    }

and my js code is below:
var postObj = {

            url: "Home/Login",
            data: {},
            callback: function (status, response) {
                if (response.status === 400) {
                    var errors = response.errors;
                    var serverValidate = new PS.Validate(userObj);
                    var isvalid = serverValidate.showErrors(errors);
                }
                else {

                    if (response.userId !== null && response.userId !== undefined) {

                        window.location.href = "/verifyuser?id=" + response.userId;
                    }
                    else {
                        window.location.href = "/user-dashboard";
                    }
                }
            }
        };
me.fm.post(postObj);

Is there any way to do this with or without Ajax? Thanks.

A: If you don't want to do an ajax call you can return a RedirectToAction ActionResult in your controller but you will have to make sure the page does a actual form post not use ajax

A: If you change your AJAX request to POST, you will also have to allow your controller action to respond to POST requests.
[HttpPost]
public ActionResult VerifyUser(string id)
{
    ViewBag.Id = id;
    return View("~/Views/User/VerifyUser.cshtml");
}

redpajama_set_name: RedPajamaStackExchange


text:
Q: percentage table with missing categories I am trying to calculate the percentage of 0,1,2,3 of each column in r using a combination of prop.table & do.call.
tblpercent <- function(x){
  round(prop.table(table(x)),4)
}

do.call(cbind,lapply(A,tblpercent))

However, some of the columns do not contain the full set of 0-3, for example, the data looks like A:
A <- data.frame(matrix(
  c(0,1,2,1,2,3,2,2,2,3,3,3,1,1,0,3,3,3),
  nrow=6, ncol=3,  byrow = TRUE))

And it will return error like this:
      X1     X2     X3
0 0.1667 0.3333 0.1667
1 0.3333 0.3333 0.3333
2 0.1667 0.3333 0.5000
3 0.3333 0.3333 0.1667

I understand the error is due to missing 0 in X2, 1 in X3 so the percentage returned contain only 3 fields -- Is it possible to fix this easily, or I should rewrite the entire function?
The correct output should be like this:
      X1     X2     X3
0 0.1667 0.0000 0.1667
1 0.3333 0.3333 0.0000
2 0.1667 0.3333 0.3333
3 0.3333 0.3333 0.5000

A: We can fix this by making it a factor with levels specified in the tblpercent function
 tblpercent <- function(x, Un){
     round(prop.table(table(factor(x, levels = Un))),4)
 }

 Un1 <- sort(unique(unlist(A)))
 do.call(cbind, lapply(A, tblpercent, Un= Un1))
 #   X1     X2     X3
 #0 0.1667 0.0000 0.1667
 #1 0.3333 0.3333 0.0000
 #2 0.1667 0.3333 0.3333
 #3 0.3333 0.3333 0.5000

Using the OP's function, the output generated with lapply can have some missing levels leading to difference in length between each of the list elements.  So, the cbind will not work well.


text:
Q: Calendário com slide nos dias do mês
pessoal sou aprendiz, imaginei um projeto e queria muito realizar, preciso conseguir dar vida a este calendário, se bem que só posso chamar de ideia de calendário.
Onde no meio fica o dia atual há principio, na esquerda o dia anterior, e na direita o dia posterior. com setas de next e previous tipo slide nos dias do mês, onde no  meio é o dia selecionado que fica em destaque tipo um zoom, ano, dia da semana e mês neste estilo.
Talvez seja até fácil fazer, mas já estou a 3 semanas procurando tutoriais e nada, fico pulando de JavaScripit para PHP e o que consegui ate agora foi muito poco ou quase nada.

body{
    color: #333;

}

.product-tabs {
    position: relative;
}

.nav-tabs {
    text-align: center;
    margin-top: 40px;
    border-bottom: 3px solid #ddd;
}

.nav-tabs > li {
    float: none;
    display: inline-block;
    margin-bottom: -3px;
}

.nav-tabs>li>a:hover {
    border-color: #eee #eee #ddd;
    border-color: transparent;
    background-color: transparent;
}

.nav-tabs>li.active>a, .nav-tabs>li.active>a:focus, .nav-tabs>li.active>a:hover {
    border: 1px solid transparent;
    border-bottom-color: #d51335;
    border-bottom-width: 3px;
}

.tab-pane{
    padding: 10px;
}

.tab-control .previous-button, .tab-control .next-button{
    position: absolute;
    top: 25%;
}

.tab-control .previous-button{
    left: 10%;
}

 .tab-control .next-button{
     right: 10%;
 }

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Previous & Next button</title>

    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">

    <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">

Calendário
2017

Quarta

Quinta

Sexta

13

14

15

Dezembro

Meio com vergonha de por o que fiz mais é o jeito, coloquei apenas 3 dias de exemplo no código, porque não faço ideia de como associar o calendário real,mas a ideia é que os outros dias fiquem ocultos, acho que deu para entender. se alguem poder pelo menos dizer qual caminho seguir agradeço.

A: Sugiro que você entenda como outros plugins de calendário funcionam e tente aplicar ao seu projeto, como exemplo, sugiro o datepickerbootstrap. No entanto você tem que saber bastante de javascript, sugiro começar estudando do básico ao avançado antes de prosseguir.
(Tive que publicar uma resposta pois não tenho acesso a comentários)


text:
Q: ASP.net: GridView trouble getting updated values I am using *GridView1_RowUpdating* event which is called after clicking "Update" link. In the method I handle updating of the GridView.
I want to get the values from textboxes (i.e. new values):
string title= ((TextBox)GridView1.Rows[e.RowIndex].Cells[1].Controls[0]).Text;

But strangely I get old value. I've debugged but couldn't find where the error is.
Also, e.NewValues.Count is 0.

A: The problem was I was doing GridView.DataBind() everytime in page_load. Solved now.

A: you need to bind data to the gridView control


text:
Q: Modify record using stored procedure I am new with the stored procedure.
I have 4 million records so that manually cannot do that so use stored procedure.
I have a table like:
Id   Name
-----------------
1    abc
2    xyz
3    abc
4    pqr
5    abc
6    pqr

And in that table one filed is called Name. In Name column, some are record are same name so I want to modify records and want like:
Id   Name
---------------------
1    abc
2    xyz
3    abc-1
4    pqr
5    abc-2
6    pqr-1

& Insert it into another table which have same schema.

A: You can do this using an updatable CTE:
with toupdate as (
      select t.*, row_number() over (partition by name order by id) as seqnum
      from onetable t
     )
update toupdate
    set name = name + '-' + cast(seqnum - 1 as varchar(255))
    where seqnum > 1;

Actually, that updates it in place.  To put this into another table:
with toinsert as (
      select t.*, row_number() over (partition by name order by id) as seqnum
      from onetable t
    )
select id,
       (case when seqnum = 1 then name
             else name + '-' + cast(seqnum - 1 as varchar(255))
        end) as name
into newtable
from toinsert;

A: This will update the table
;WITH cte AS
(
  SELECT id,
      ROW_NUMBER() OVER(PARTITION BY Name ORDER BY Id) AS rno,

  FROM table1
)

update t.Name = t.Name + '-'+ c.rno
from table1 t
join cte c on c.id = t.id
where c.rno >1

To insert simply use select with charindex
select * into Table2 from table1
where CHARINDEX('-',name) > 1


text:
Q: tabcontroller does not change when scrolling the screen(like its waiting 1 sec). tabtext is changing I have a tabbar below like Tab (text: '') and _tabcontroller,
if i use tab.text for body its working good (body:Text(tab.text)) but if i create a list for index's and use exampleList[_tabcontroller.index] its chancing slow like i am swiping screen and it wait 1 sec. My code is larger than i posted but its my core problem i think.
n: i wanna use Tab's like Tab(child:Row()) so i cant use tab.text if it have alternative i will be ok too(idk tab.listener or tab.id? )
    TabController _tabController;
    final List<Tab> tabs = <Tab>[
new Tab(text: "hello1",),
new Tab(text:"hello2"),

  ];
...
@override
void initState() {
super.initState();
_tabController = new TabController(
    vsync: this, length: tabs.length, initialIndex: cDate);
    _tabController.addListener(_handleSelected);

}
void _handleSelected() {
setState(() {
  _tabController.index;
});
}
@override
void dispose() {
_tabController.dispose();
super.dispose();
 }
...
    body: new TabBarView(
    controller: _tabController,
    children: tabs.map((Tab tab) {
     //ITS FAST BUT I DONT WANNA USE LIKE THAT:
      return Center(Text(tab.text));
    //ITS SLOW BUT I WANNA USE LIKE THAT:
      return Center(Text(etcList[_tabcontroller.index] );
    }).toList(),
  ),

tried to explain but my english is not good sorry

A: It's happening because of TabBarView is animating between the tabs and _tabController.index value is only changed once the animation is complete.
Here I am using _tabController.index value to get the object of Choice form list choices and showing that as the title in AppBar.
  appBar: AppBar(
          title: Text(choices[_tabController.index].title),
          centerTitle: true,
        ),

ISSUE

SOLUTION

As TabBarView is animating the between tabs,One can add a listener to _tabController's animation.
_tabController.animation
  ..addListener(() {
    setState(() {
      _currentIndex = (_tabController.animation.value).round(); //_tabController.animation.value returns double
      print('_tabController.animation.value: ${_tabController.animation.value}');
      print('_currentIndex: $_currentIndex');
    });
  });

Here is full code:
import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: SampleTabScreen(),
    );
  }
}

class SampleTabScreen extends StatefulWidget {
  @override
  _SampleTabScreenState createState() => _SampleTabScreenState();
}

class _SampleTabScreenState extends State<SampleTabScreen> with SingleTickerProviderStateMixin {
  TabController _tabController;
  int _currentIndex = 0;

  @override
  void initState() {
    super.initState();
    _tabController = TabController(vsync: this, length: choices.length);
    _tabController.animation
      ..addListener(() {
        setState(() {
          _currentIndex = (_tabController.animation.value).round(); //_tabController.animation.value returns double
          print('_tabController.animation.value: ${_tabController.animation.value}');
          print('_currentIndex: $_currentIndex');
        });
      });
  }

  @override
  void dispose() {
    _tabController.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text(choices[_currentIndex].title),
          centerTitle: true,
        ),
        body: TabBarView(
          controller: _tabController,
          children: choices.map((Choice choice) {
            return Padding(
              padding: const EdgeInsets.all(16.0),
              child: ChoiceCard(choice: choice),
            );
          }).toList(),
        ),
      ),
    );
  }
}

class Choice {
  const Choice({this.title, this.icon});

  final String title;
  final IconData icon;
}

const List<Choice> choices = const <Choice>[
  const Choice(title: 'CAR', icon: Icons.directions_car),
  const Choice(title: 'BICYCLE', icon: Icons.directions_bike),
  const Choice(title: 'BOAT', icon: Icons.directions_boat),
  const Choice(title: 'BUS', icon: Icons.directions_bus),
  const Choice(title: 'TRAIN', icon: Icons.directions_railway),
  const Choice(title: 'WALK', icon: Icons.directions_walk),
];

class ChoiceCard extends StatelessWidget {
  const ChoiceCard({Key key, this.choice}) : super(key: key);

  final Choice choice;

  @override
  Widget build(BuildContext context) {
    final TextStyle textStyle = Theme.of(context).textTheme.display1;
    return Card(
      color: Colors.white,
      child: Center(
        child: Column(
          mainAxisSize: MainAxisSize.min,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: <Widget>[
            Icon(choice.icon, size: 128.0, color: textStyle.color),
            Text(choice.title, style: textStyle),
          ],
        ),
      ),
    );
  }
}


text:
Q: Dagger2: Field injection in ViewModel which has compile time and run time dependencies I have a list of Students which is displayed in RecyclerView and for each Student, I have StudentViewModel. As the StudentViewModel needs Student object which is retrieved runtime from database, I am not sure how can I setup constructor injection for StudentViewModel so I didn't attempt DI here. However, now I need another dependency in the viewmodel which can be resolved compile time and which is my NavUtil class.
I managed to get it injected in my StudentViewModel with following lines:
DaggerAppComponent.builder()
                .application(MyApp.INSTANCE)
                .build()
                .inject(this)

But I don't think this is the correct way as I am referring Application class from my ViewModel just for the sake of DI. I read it might be possible with ViewModelFactory, but I am not able to find any solid example or reference to this. I am already using it for the ViewModels which has compile-time dependencies though, but not able to figure out the way for ViewModel(s) which has compile time and rumtime dependencies. Would be great if someone could point me in right direction.
BTW here's my overall implementation for DI:
App Component
@Component(modules = [AndroidInjectionModule::class, AndroidSupportInjectionModule::class,
    AppModule::class, AppProvider::class,StudentProvider::class])

@Singleton
interface AppComponent {

    @Component.Builder
    interface Builder {

        @BindsInstance
        fun application(application: Application): Builder

        fun build(): AppComponent
    }

    fun inject(app: MyApp)
    fun inject(studentViewModel: StudentViewModel)

StudentProvider
@Module
abstract class StudentProvider {

    @ContributesAndroidInjector(modules = [(ViewModelModule::class)])
    abstract fun bindHomeActivity(): HomeActivity
}

ViewModelModules
@Module
class ViewModelModule {

    @ActivityContext
    @Provides
    fun provideNavUtils(activity: Activity): NavUtil = NavUtil(activity)
}

StudentViewModel
class StudentViewModel(student: Student) : BaseViewModel() {

    @Inject
    lateinit var navUtils: NavUtil

    init {
        DaggerAppComponent.builder()
                .application(MyApp.INSTANCE)
                .build()
                .inject(this)
    }

    fun onSettingsTapped() {
        navUtils.navigateToSettings()
    }
}

NavUtil
class NavUtil @Inject constructor(@ActivityContext private val context: Context) {

    fun navigateToSettings() {
        context.startActivity(Intent(context, SettingsActivity::class.java))
    }
}

EDIT: It looks like activity context is not getting inject and instead, Application context is inject.


text:
Q: "while" loops in Chameleon? I'm working on a Pyramid project and am considering something which will come later. My particular use case is ascending the resource tree to construct a breadcrumb, but I'm curious about the general implementation, too.
In Python code, I'd be wanting this:
while resource is not None:
    pass  # do something with resource
    resource = resource.__parent__

But in Chameleon, you only get tal:repeat, which is a for loop. I can perceive that you could write a function which would be provided to the template:
def ascend(resource):
    while resource is not None:
        yield resource
        resource = resource.__parent__

This could then be used as tal:repeat="item ascend(resource)".
This might be generalised to a while loop thusly:
def while_(value, condition, suite):
    while condition(value):
        yield value
        value = suite(value)

Usage: tal:repeat="item while_(resource, lambda resource: resource is not None, lambda resource: resource.__parent__)". Ugly. I think you'd fairly quickly go to specialising!
Similarly, if break were supported, an infinite for loop would do. But it isn't. (Nor would it be wise to support it, I think.
Is there any nicer or easier way of achieving this? (The general case or my specific case.)

A: No, there isn't.
Chameleon templates are not meant to implement complex logic; the original Zope Page Template philosophy is to leave all the business logic up to Python code, and the template has just enough power to turn the information generated into a presentation, and nothing more.
This is why Chameleon doesn't give you anything more than a for loop; it's not the responsibility of the template to traverse complex structures, its responsibility is limited to creating a representation of already-processed data.


text:
Q: How to change the text of the equation from input box? How can I change the values for a,b,c in the equation when the users enter input digits from the text-box? Also, after that, is it possible to directly copy the equation to the function to plot box for the graphing part so that user don't have to type the whole equation into the text-box in order to graph a quadratic equation?

var parameters = {
  target: '#myFunction',
  data: [{
    fn: 'sin(x)',
    color: 'red'
  }],
  grid: true,
  yAxis: {domain: [-1, 1]},
  xAxis: {domain: [0, 2*Math.PI]}
  };

  function plot() {
  var f = document.querySelector("#function").value;
  var xMin = document.querySelector("#xMin").value;
  var xMax = document.querySelector("#xMax").value;
  var yMin = document.querySelector("#yMin").value;
  var yMax = document.querySelector("#yMax").value;
  var color = document.querySelector("#color").value;

  parameters.data[0].fn = f;
  parameters.xAxis.domain = [xMin, xMax];
  parameters.yAxis.domain = [yMin, yMax];
  parameters.data[0].color = color;

  functionPlot(parameters);
  }
body {
  font-family: 'Raleway', sans-serif;
  background-color: white;
 text-align: center;

}
h2{
text-align: center;
}
.layer{
width: 70%;
margin-right: auto;
margin-left: auto;
}

section {
border:4px solid grey;
border-radius:15px;
box-shadow: 5px 5px 5px grey;
float:left;
height:360px;
padding: 20px;
margin:10px;
}

#plotSettings {
width:160px;
}

#plot {
width:550px;
}
#extra{

}
<!DOCTYPE html>

 <meta charset="utf-8">
 <title>Quadratic calculator</title>

    <var class="displayLetters" id="displayA">a</var>x2 + <var id="displayB" class="displayLetters">b</var>x + <var class="displayLetters" id="displayC">c</var>

A: <input oninput="updateText('inputA','displayA','a')" class="numberInputs" type="number" id="inputA">

B: <input oninput="updateText('inputB','displayB','b')" class="numberInputs" type="number" id="inputB">

C: <input oninput="updateText('inputC','displayC','c')" class="numberInputs" type="number" id="inputC">

     xMin:  value: <input type=number id="xMin" value=-5 step=5 oninput="plot();">

     xMax:  value: <input type=number id="xMax" value=5 step=5 oninput="plot();">

     yMin:  value: <input type=number id="yMin" value=-5 step=5 oninput="plot();">

     yMax:  value: <input type=number id="yMax" value=5 step=5 oninput="plot();">

     Color:  value: <input type=color id="color" onchange="plot();">

     Function to plot:
     <input id="function" type="text" value="sin(x)" onchange="plot();">

     <button onclick="plot();">GRAPH!</button>

A: First of all, HTML has only one body tag and you have used two body tags.
After that do this-
<var class="displayLetters" id="displayA">a</var>x2 + <var id="displayB" class="displayLetters">b</var>x +
<var class="displayLetters" id="displayC">c</var>

A: <input   class="numberInputs" type="number" id="inputA" >

B:   <input  class="numberInputs" type="number" id="inputB">

C:   <input   class="numberInputs" type="number" id="inputC">

in JS
     $("#inputA").blur(function a(){
 var e=$("#inputA").val();

$("#displayA").html(e);
 });

     $("#inputB").blur(function a(){
 var e=$("#inputB").val();

$("#displayB").html(e);
 });

 $("#inputC").blur(function a(){
 var e=$("#inputC").val();

$("#displayC").html(e);
 });

Check here


text:
Q: Programmable GHz signals I would like to generate custom waves in the gigahertz range. With beginner FPGAs like the DE0-Nano or microcontrollers like the Arduino, I can only generate waves up to the kilohertz range.
What tools or boards should I look into to start generating at this frequency?


text:
Q: Tooltipster appear on right side I would like to get my tool tip to appear on the right of the origin but I seem to be having trouble to get this to do so!.
Here is the code that I am using:
<img src="/img/info-gray-26.png" id="shiftclick">
<script>$("#shiftclick").tooltipster({contentAsHTML: true, plugins: ["sideTip"], side:"right", content: "Pro-tip: Shift-click events to create email reminders!"});</script>

Any Ideas? I have read the GitHub page but no success!


text:
Q: ASP.NET MVC 2: SPROC resturn result? I can't figure out how to get the returned data from the SPROC that I call:
public string LoginParty(string UserName, string LoginPin)
{
    var result = db.spPartyLogin(UserName, LoginPin);

    return result.ToString; // I wish
}

I'd like to know how to retrieve the result of any SPROC that I call. In this case, I'm only getting one result, an email address or a 0 if the credentials are incorrect ... and result.ToString doesn't work.
SPROC:
ALTER PROCEDURE [dbo].[spPartyLogin]
    -- Add the parameters for the stored procedure here
    @UserName varchar(50),
    @LoginPin varchar(50)
AS
BEGIN
    DECLARE @value varchar(50)
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
    SET NOCOUNT ON;

    -- Select statements for procedure here
    SELECT @value = EmailAddress FROM Party
    WHERE UserName = @UserName AND LoginPin = @LoginPin;

    SELECT ISNULL(@value,0)

END

As you can see, in this case, I'm returning the EmailAddress or 0. I want to capture that returned result. I don't know how many other ways I can describe what I'm trying to do...

A: Usually Libq2Sql would create a new type and return an IEnumerable of that type.  Since your single result row has a column without a name, I'm not sure what it will do.  Examine your result in the debugger to see what you have.  If EmailAddress isn't an integer then you shouldn't use the integer 0 as a replacement if it is null.  You could use a bkank string or even allow it to return null.
If you can't see the address when watching result in the debugger, try declaring it as an out parameter or assigning a column name in the result:
SELECT ISNULL(@value,'') AS EmailAddress

ALTER PROCEDURE spPartyLogin
    @Username VARCHAR(50),
    @LoginPin VARCHAR(50),
    @EmailAddress VARCHAR(50) out

You'll need to delete and add back the proc to get Linq2Sql to see the changes and regenerate the code either way.


text:
Q: Where to put the file and how to compile and run it? I want to learn how to write a C program under Linux. Now I have installed Centos, and I'm using vim to write a 'hello world' program in the C language. But I don't know where to put it, or how to compile it? I have installed gcc. I am sorry. I am a newbie. Thank you. Could you make me an example how to write a simple program in C then test and compile it.?

A: Save it anywhere, then in a terminal run
gcc path/to/file.c
That's all it takes. The default output will be a file called a.out which you can run directly from the terminal.
If you're uncomfortable with the terminal (though since you're using vim I'll assume you're not), there are many IDEs that make it even easier for beginners.

A: type this in your terminal:
$ mkdir ~/learnC
$ cd ~/learnC
$ cat > hello.c

   #include <stdio.h>
   int main () {
      printf("Hello World\n");
   }

/* Press Ctrl+D */

$ gcc hello.c -o hello
$ ./hello


text:
Q: How can I find the location on the Z axis where two skew lines pass closest to each other on the XY plane? I'm given one point $\overrightarrow{P}$ and the slopes $\frac{dX}{dZ}$ and  $\frac{dY}{dZ}$  for each of my two lines. I'm trying to figure out where on the Z axis my lines pass closest to each other.
I would think that the parameterization for each line would be $  \overrightarrow{L_1} =   \overrightarrow{P_1} + s(\frac{dX}{dZ}, \frac{dY}{dZ}, 1)$, where the 1 comes from $\frac{dZ}{dZ} $
I've tried doing this with an algorithm that populates points along the lines by incrementing $s$, and then compares the distance between the points on the $XY$ plane. I determine whether or not the points are coplanar on the $XY$ plane by checking if the $Z$ values for each point on each line are nearly equal.
Unfortunately the length of time this takes is exponentially related to how many points I choose to populate the lines with, so I'm looking for a way to directly calculate the location on the Z axis where the lines pass closest to each other.
I've looked over some other stack exchange questions, but so far all I've been able to find are methods that tell me the minimum distance between the lines, or the locations of the points that are closest to each other.
Is there a way to directly calculate the $Z$ value where the distance between the lines is the smallest in the same $XY$ plane?
I can post my iterative code if it would be helpful.

A: For lines parameterization:
$$\begin{align}
Q &= P_1 + s[a_1, b_1, 1] \\
R &= P_2 + t[a_2, b_2, 1]
\end{align}$$
where $a$ and $b$ are your given slopes, the $z$ coordinate of both points is, respectively:
$$\begin{align}
z_Q &= z_{P_1} + s \\
z_R &= z_{P_2} + t
\end{align}$$
so to find points $Q$ and $R$ at a given $z$ we need
$$\begin{align}
s &= z - z_{P_1} \\
t &= z - z_{P_2}
\end{align}$$
Then
$$\begin{align}
Q &= P_1 + (z - z_{P_1})[a_1, b_1, 1] \\
R &= P_2 + (z - z_{P_2})[a_2, b_2, 1]
\end{align}$$
which is
$$\begin{align}
Q &= [x_{P_1} + (z - z_{P_1})a_1, y_{P_1} + (z - z_{P_1})b_1, z] \\
R &= [x_{P_2} + (z - z_{P_2})a_2, y_{P_2} + (z - z_{P_2})b_2, z]
\end{align}$$
and their distance, which you need to minimize, is
$$d(Q,R) = \sqrt{(x_Q-x_R)^2+(y_Q-y_R)^2}$$
You can minimize its square to make calculations easier:
$$(d(Q,R))^2 = (x_Q-x_R)^2+(y_Q-y_R)^2$$
If you substitute those four expressions and reduce them carefully you'll see it is a square function of $z$. Finding its minimum shouldn't be a big problem.


text:
Q: Optimal way to pull the most recent goal value for each unique goal with this table structure? So I have a table structured similarly to this:

GoalID
GoalName
GoalType
UsedTimeframe
ChangedTimeframe
GoalUpperBound
GoalLowerBound
GoalValue
EffectiveDate
EndDate

1
Sales
Single Target
Annually
Annually
NULL
NULL
5,000,000
01-01-2021
12-31-2021

2
Unique Purchasers
Range
Monthly
Monthly
22,000
20,000
NULL
9-01-2021
9-30-2021

3
Sales
Single Target
Monthly
Annually
NULL
NULL
500,000
10-01-2021
10-31-2021

4
Unique Purchasers
Range
Monthly
Monthly
24,000
21,000
NULL
10-01-2021
10-31-2021

5
New Customers
Single Target
Monthly
Annually
NULL
NULL
5,000
01-01-2021
12-31-2021

6
Products Sold
Range
Monthly
Monthly
10,000
9,000
NULL
10-01-2021
10-31-2021

7
Products Sold
Range
Monthly
Monthly
12,000
10,000
NULL
10-15-2021
10-31-2021

8
Sales
Single Target
Annually
Annually
NULL
NULL
4,750,000
01-01-2020
12-31-2020

9
Referrals
Single Target
Monthly
Annually
NULL
NULL
1,000
01-01-2021
12-31-2021

What is the most optimal way to pull each unique GoalName and their corresponding GoalUpperBound/GoalLowerBound or GoalValue? So in this example, if I wanted to pull all goals that change Monthly, I'd want to see GoalIDs (3, 4, 5, 7, 9) and if I was pulling goals that change Annually, I'd see GoalID (1). I was thinking pulling the MAX(GoalID) for each DISTINCT GoalName and UsedTimeframe and then joining back the GoalID to this table or maybe the MAX(EffectiveDate)?

A: You can use the windowing functions, specifically ROW_NUMBER() to number the groups my GoalID DESC - then you just want the groups with a ROW_NUMBER() = 1. Since you can't use windowing functions in a WHERE clause, you have to write it as a subquery.
To test this out, I created a table variable and put your data into it:
DECLARE @Goals AS TABLE (
    GoalID INT NOT NULL,
    GoalName VARCHAR(20) NOT NULL,
    GoalType VARCHAR(20) NOT NULL,
    UsedTimeframe VARCHAR(20) NOT NULL,
    ChangedTimeframe VARCHAR(20) NOT NULL,
    GoalUpperBound INT NULL,
    GoalLowerBound INT NULL,
    GoalValue INT NULL,
    EffectiveDate DATE NOT NULL,
    EndDate DATE NOT NULL
);

INSERT INTO @Goals(GoalID,GoalName,GoalType,UsedTimeframe,ChangedTimeframe,GoalUpperBound,GoalLowerBound,GoalValue,EffectiveDate,EndDate)
VALUES
(1,'Sales','Single Target','Annually','Annually',NULL,NULL,5000000,'01-01-2021','12-31-2021'),
(2,'Unique Purchasers','Range','Monthly','Monthly',22000,20000,NULL,'9-01-2021','9-30-2021'),
(3,'Sales','Single Target','Monthly','Annually',NULL,NULL,500000,'10-01-2021','10-31-2021'),
(4,'Unique Purchasers','Range','Monthly','Monthly',24000,21000,NULL,'10-01-2021','10-31-2021'),
(5,'New Customers','Single Target','Monthly','Annually',NULL,NULL,5000,'01-01-2021','12-31-2021'),
(6,'Products Sold','Range','Monthly','Monthly',10000,9000,NULL,'10-01-2021','10-31-2021'),
(7,'Products Sold','Range','Monthly','Monthly',12000,10000,NULL,'10-15-2021','10-31-2021'),
(8,'Sales','Single Target','Annually','Annually',NULL,NULL,4750000,'01-01-2020','12-31-2020'),
(9,'Referrals','Single Target','Monthly','Annually',NULL,NULL,1000,'01-01-2021','12-31-2021');

The query is then:
SELECT GoalID,GoalName,GoalType,UsedTimeframe,ChangedTimeframe,GoalUpperBound,GoalLowerBound,GoalValue,EffectiveDate,EndDate
FROM
(
    SELECT *, ROW_NUMBER() OVER(PARTITION BY GoalName ORDER BY GoalID DESC) AS rn
    FROM @Goals
    WHERE UsedTimeframe = 'Monthly'
) AS orderedSubQuery
WHERE rn = 1
ORDER BY GoalID

This returns Goals 3, 4, 5, 7, 9 as you requested.


text:
Q: How to keep images in Mail for offline reading? For example:I subscribe emails to Huffington Post,and they send daily mails.How can I keep images in those mails so I can read them offline?

A: Under Mail / Preferences / Accounts and selecting your account and then Advanced, you'll find an option to Keep copies of message for offline viewing.
Just choose All messages and their attachments.


text:
Q: A partial of the text background didn't appear after adding new a and span in the same div I have a minor or a glitch problem. Anyone can tell me the reason why "Log Out" from imgA turn to imgB. This happen when I put new lines which has been commented as "// New!!" in the HTML codes given. The problem occur on the "right" div. I provide the whole codes for the header.
CSS codes for left and mid div
.header {
    background: #FFF;
    display: flex;
    flex: 0 1 50px;
    flex-flow: row;
    line-height: 50px;
}
.header > #left {
    background: transparent;
    color: #535659;
    cursor: pointer;
    flex: 0 1 auto;
    font-size: 30px;
    padding: 0 10px 0 70px;
}
.header > #left:after,
.header > #left:before {
    background: rgba(0, 173, 181, 0.6);
    border-bottom-right-radius: 50%;
    border-top-right-radius: 50%;
    content: "";
    left: 10px;
    height: 30px;
    position: absolute;
    top: 10px;
    width: 30px;
}
.header > #left:before {
    background: rgba(250, 85, 85, 0.8);
    border-bottom-left-radius: 50%;
    border-bottom-right-radius: 0%;
    border-top-left-radius: 50%;
    border-top-right-radius: 0%;
    left: 30px;
}
.header > #mid {
    background-color: teal;
    flex: 1 1 auto;
}

CSS codes for right div
.header > #right {
    background: transparent;
    flex: 0 1 auto;
    font-size: 20px;
    padding: 0 10px;
    text-decoration: none;
}
.header > #right > .logout {
    background: #FA5555;
    border: 2px solid #FA5555;
    border-radius: 30px;
    color: #FFF;
    cursor: pointer;
    padding: 3px 10px 3px 10px;
    -webkit-border-radius: 30px;
    -moz-border-radius: 30px;
 }
.header > #right > .option {
    background: #FFF;
    color: #000;
    cursor: pointer;
}

HTML codes (imgA when there is no "// New!!", imgB after adding ""// New!!". NOTES: "// New!!" is just a deco I put here to highlight the lines that affecting the problem. In the real HTML files, I didn't put it.)

SPAPr

        Register // New!!
        Settings // New!!
        Log Out

Thank you.

A: Welcome to Stack Overflow 53iky0,

a double slash "//" is used to comment things out in JavaScript if you would like to comment something out in HTML you will need to use "" so just change
// New!!

to

Hope this helps


text:
Q: ghostscript annotation conversion I'm trying to convert from pdf to pdf/a using version 9.19 on win server 2012r2.
commandline:
"D:\Program Files\gs\gs9.19\bin\gswin64c" -dPDFA -dNOOUTERSAVE -dColorConversionStrategy=/sRGB -dProcessColorModel=/DeviceRGB -sDEVICE=pdfwrite -o target.pdf -dPDFACompatibilityPolicy=2 "PDFA_def.ps" source.pdf
For a lot of files I get
"Annotation set to non-printing, not permitted in PDF/A, aborting conversion"
Using Acrobat Pro conversion, it converts non printing annotations without problems.
What may I need to look for in PDFA_def.ps?

A: There is nothing to look for in pdfa_def.ps, since that is just a template for the additional information required to produce a PDF/A file.
Your problem is that your annotation is not valid for inclusion in a PDF/A file, non-printing annotations are not permitted in PDF/A. To create a PDF/A file from such an input, either the annotation must be removed, or it must be set to print. Ghostscript's pdfwrite device cannot know which one you want.
However, you can change the PDFACompatibilityPolicy; the default value is 0 which will include the offending feature, and produce a non-PDF/A file. You can try changing it to 1 instead which will ignore the feature. I'm not in a position to test this right now (I'm heading for an airport) but it ought to work.
Obviously I don't know what Acrobat does in this case, but it must do something similar, or produce an invalid file. At least Ghostscript gives you the choice.


text:
Q: What is wrong with this bifurcation plot? I am trying to plot the bifurcation diagram based on the steady-state values of the following ODE:
$$\frac{dx}{dt}=x(1-x)-rx$$
I take the right hand side $f(x) = x(1-x)-rx$ and I find the fixed points of $g(x) = f(x)+x$ which will give me the zeros of $f(x)$ hence the steady state points of the ODE.
I find the fixed points of $g(x)$ using the method introduce in here and by the recursive relationship $x_{n+1}=g(x_n)$.
I get the following diagram:

As you can see I am getting negative values. But this is a population growth model and shouldn't be negative. In fact, I give values of r>3 to the ODE and the dynamics go to zero but never negative. I very much appreciate it if you can help me with this.


text:
Q: Linux shell: Changing decimal (float) separator from dot to comma This is an output example I get in some programs:
$ reportspeed
Speed.GPU.#*...:   254.4 kH/s

And this another example:
$ reportspeed
Speed.GPU.#*...:   254.43 kH/s

As long as, in both cases it is obvious that those one or two numbers behind the . dot is the decimal part, I would like to change that output to:
$ reportspeed | decimalcomma
Speed.GPU.#*...:   254,4 kH/s
$ reportspeed | decimalcomma
Speed.GPU.#*...:   254,43 kH/s

This is: using comma , instead of . if there are one or two decimal characters behind it.
This supposes that, when some program uses . dots for thousands separator, it will not be changed, like in:
$ anotherprogram
Speed.Other.Thing....:   33.112 H/s
$ anotherprogram | decimalcomma
Speed.Other.Thing....:   33.112 H/s

I think this can be done by using sed, awk, perl or maybe even shell expansion, but I am not very experienced on it.
Could someone give me some help, please?
EDIT-1: Even when this question requests solutions for "one or two numbers behind the dot" as a method to distinguish between comma for thousands, for those arriving here interested in not such limitation (and as long as the title could suggests it does not exist), here is the method firstly proposed by @almas shaikh (thanks you, boy):
sed 's/\([0-9]\)\.\([0-9]\)/\1,\2/g'

A: You can use this sed:
sed -r 's/\.([0-9]{1,2})\b/,\1/g'

Testing:
cat file
Speed.GPU.#*...:   254.4 kH/s
Speed.GPU.#*...:   254.43 kH/s
Speed.Other.Thing....:   33.112 H/s

sed -r 's/\.([0-9]{1,2})\b/,\1/g' f
Speed.GPU.#*...:   254,4 kH/s
Speed.GPU.#*...:   254,43 kH/s
Speed.Other.Thing....:   33.112 H/s

PS: On OSX use:
sed -E 's/\.([0-9]{1,2})[[:>:]]/,\1/g'

A: try this
$ echo "Speed.GPU.#*...:   254.4 kH/s" |sed 's/\.\([0-9]\{1,2\}\)\b/,\1/g'
Speed.GPU.#*...:   254,4 kH/s
$ echo "Speed.GPU.#*...:   254.44 kH/s" |sed 's/\.\([0-9]\{1,2\}\)\b/,\1/g'
Speed.GPU.#*...:   254,44 kH/s
$ echo "Speed.GPU.#*...:   254.444 kH/s" |sed 's/\.\([0-9]\{1,2\}\)\b/,\1/g'
Speed.GPU.#*...:   254.444 kH/s

A: What you ask is impossible. How is the poor program supposed to know whether a number like 33.112 is European notation for "thirty-three thousand one hundred and twelve" or Anglophone notation for "thirty-three point one one two"?

A: Try something like:
sed 's/\([0-9]\)\.\([0-9]{1,2}\)/\1,\2/g' myfile.txt


text:
Q: Jboss Deployment issue Hi guys am kinda new to the whole jboss world and i dont have a problem with jboss server its starts and stops fine but my problem is am trying to deploy 2 applications one called beaver which is connected to the other web application which is called twine-lab ,beaver is not web application but is needed for the twinelab application and i have to deploy beaver 1st before twine and i failed it send me error message with messing dependences  am working on ubuntu environment i had this task to deploy them
        Starting JBoss AS7...
``root@neuwo:/# =========================================================================
JBoss Bootstrap Environment
JBOSS_HOME: /usr/local/jboss.7.1.1/jboss-as-7.1.1.Final
JAVA: java
JAVA_OPTS:  -server -XX:+UseCompressedOops -XX:+TieredCompilation -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Djboss.server.default.config=standalone.xml

=========================================================================

10:38:18,120 INFO  [org.jboss.modules] JBoss Modules version 1.1.1.GA
10:38:19,166 INFO  [org.jboss.msc] JBoss MSC version 1.0.2.GA
10:38:19,214 INFO  [org.jboss.as] JBAS015899: JBoss AS 7.1.1.Final "Brontes" starting
10:38:21,077 INFO  [org.xnio] XNIO Version 3.0.3.GA
10:38:21,077 INFO  [org.jboss.as.server] JBAS015888: Creating http management service using socket-binding (management-http)
10:38:21,089 INFO  [org.xnio.nio] XNIO NIO Implementation Version 3.0.3.GA
10:38:21,097 INFO  [org.jboss.remoting] JBoss Remoting version 3.2.3.GA
10:38:21,170 INFO  [org.jboss.as.logging] JBAS011502: Removing bootstrap log handlers
10:38:21,173 INFO  [org.jboss.as.configadmin] (ServerService Thread Pool -- 30) JBAS016200: Activating ConfigAdmin Subsystem
10:38:21,175 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 35) JBAS010280: Activating Infinispan subsystem.
10:38:21,262 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 45) JBAS011800: Activating Naming Subsystem
10:38:21,262 INFO  [org.jboss.as.jacorb] (ServerService Thread Pool -- 36) JBAS016300: Activating JacORB Subsystem
10:38:21,264 INFO  [org.jboss.as.osgi] (ServerService Thread Pool -- 47) JBAS011940: Activating OSGi Subsystem
10:38:21,266 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 51) JBAS013101: Activating Security Subsystem
10:38:21,387 INFO  [org.jboss.as.security] (MSC service thread 1-8) JBAS013100: Current PicketBox version=4.0.7.Final
10:38:21,388 INFO  [org.jboss.as.connector] (MSC service thread 1-3) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.9.Final)
10:38:21,615 INFO  [org.jboss.as.naming] (MSC service thread 1-5) JBAS011802: Starting Naming Service
10:38:21,657 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-6) JBAS015400: Bound mail session [java:jboss/mail/Default]
root@neuwo:/# 10:38:22,284 INFO  [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-8) live server is starting with configuration HornetQ Configuration (clustered=false,backup=false,sharedStore=true,journalDirectory=/usr/local/jboss.7.1.1/jboss-as-7.1.1.Final/standalone/data/messagingjournal,bindingsDirectory=/usr/local/jboss.7.1.1/jboss-as-7.1.1.Final/standalone/data/messagingbindings,largeMessagesDirectory=/usr/local/jboss.7.1.1/jboss-as-7.1.1.Final/standalone/data/messaginglargemessages,pagingDirectory=/usr/local/jboss.7.1.1/jboss-as-7.1.1.Final/standalone/data/messagingpaging)
10:38:22,358 INFO  [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-8) Waiting to obtain live lock
10:38:22,364 ERROR [org.apache.coyote.http11.Http11AprProtocol] (MSC service thread 1-5) Error initializing endpoint: java.lang.Exception: Socket bind failed: [98] Address already in use
    at org.apache.tomcat.util.net.AprEndpoint.init(AprEndpoint.java:584) [jbossweb-7.0.13.Final.jar:]
    at org.apache.coyote.http11.Http11AprProtocol.init(Http11AprProtocol.java:121) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.connector.Connector.init(Connector.java:983) [jbossweb-7.0.13.Final.jar:]
    at org.jboss.as.web.WebConnectorService.start(WebConnectorService.java:267) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_05]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_05]
    at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_05]

10:38:22,460 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC00001: Failed to start service jboss.web.connector.http: org.jboss.msc.service.StartException in service jboss.web.connector.http: JBAS018007: Error starting web connector
    at org.jboss.as.web.WebConnectorService.start(WebConnectorService.java:271)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_05]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_05]
    at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_05]
Caused by: LifecycleException:  Protocol handler initialization failed: java.lang.Exception: Socket bind failed: [98] Address already in use
    at org.apache.catalina.connector.Connector.init(Connector.java:985)
    at org.jboss.as.web.WebConnectorService.start(WebConnectorService.java:267)
    ... 5 more

10:38:22,572 INFO  [org.hornetq.core.persistence.impl.journal.JournalStorageManager] (MSC service thread 1-8) Using NIO Journal
10:38:22,987 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-6) JBAS015012: Started FileSystemDeploymentService for directory /usr/local/jboss.7.1.1/jboss-as-7.1.1.Final/standalone/deployments
10:38:22,988 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015014: Re-attempting failed deployment mysql-connector-java-5.1.21-bin.jar
10:38:22,991 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015014: Re-attempting failed deployment beaver.ear
10:38:22,992 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015014: Re-attempting failed deployment twine.ear
10:38:23,063 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC00001: Failed to start service jboss.serverManagement.controller.management.http: org.jboss.msc.service.StartException in service jboss.serverManagement.controller.management.http: Address already in use /84.234.78.173:9990
    at org.jboss.as.server.mgmt.HttpManagementService.start(HttpManagementService.java:210) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_05]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_05]
    at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_05]
Caused by: java.net.BindException: Address already in use
    at sun.nio.ch.Net.bind0(Native Method) [rt.jar:1.7.0_05]
    at sun.nio.ch.Net.bind(Net.java:344) [rt.jar:1.7.0_05]
    at sun.nio.ch.Net.bind(Net.java:336) [rt.jar:1.7.0_05]
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:199) [rt.jar:1.7.0_05]
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) [rt.jar:1.7.0_05]
    at org.jboss.sun.net.httpserver.ServerImpl.<init>(ServerImpl.java:144)
    at org.jboss.sun.net.httpserver.HttpServerImpl.<init>(HttpServerImpl.java:54)
    at org.jboss.sun.net.httpserver.DefaultHttpServerProvider.createHttpServer(DefaultHttpServerProvider.java:38)
    at org.jboss.com.sun.net.httpserver.HttpServer.create(HttpServer.java:147)
    at org.jboss.as.domain.http.server.ManagementHttpServer.create(ManagementHttpServer.java:145) [jboss-as-domain-http-interface-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.as.server.mgmt.HttpManagementService.start(HttpManagementService.java:177) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
    ... 5 more

10:38:23,065 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.remoting.server.management: org.jboss.msc.service.StartException in service jboss.remoting.server.management: JBAS017112: Address already in use /84.234.78.173:9999
    at org.jboss.as.remoting.AbstractStreamServerService.start(AbstractStreamServerService.java:109)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_05]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_05]
    at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_05]
Caused by: java.net.BindException: Address already in use
    at sun.nio.ch.Net.bind0(Native Method) [rt.jar:1.7.0_05]
    at sun.nio.ch.Net.bind(Net.java:344) [rt.jar:1.7.0_05]
    at sun.nio.ch.Net.bind(Net.java:336) [rt.jar:1.7.0_05]
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:199) [rt.jar:1.7.0_05]
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) [rt.jar:1.7.0_05]
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:67) [rt.jar:1.7.0_05]
    at org.xnio.nio.NioXnioWorker.createTcpServer(NioXnioWorker.java:287)
    at org.xnio.XnioWorker.createStreamServer(XnioWorker.java:135)
    at org.jboss.remoting3.remote.RemoteConnectionProvider$ProviderInterface.createServer(RemoteConnectionProvider.java:209)
    at org.jboss.as.remoting.AbstractStreamServerService.start(AbstractStreamServerService.java:101)
    ... 5 more

10:38:23,064 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.remoting.server.remoting-connector: org.jboss.msc.service.StartException in service jboss.remoting.server.remoting-connector: JBAS017112: Address already in use neuwo.info/84.234.78.173:4447
    at org.jboss.as.remoting.AbstractStreamServerService.start(AbstractStreamServerService.java:109)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_05]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_05]
    at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_05]
Caused by: java.net.BindException: Address already in use
    at sun.nio.ch.Net.bind0(Native Method) [rt.jar:1.7.0_05]
    at sun.nio.ch.Net.bind(Net.java:344) [rt.jar:1.7.0_05]
    at sun.nio.ch.Net.bind(Net.java:336) [rt.jar:1.7.0_05]
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:199) [rt.jar:1.7.0_05]
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) [rt.jar:1.7.0_05]
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:67) [rt.jar:1.7.0_05]
    at org.xnio.nio.NioXnioWorker.createTcpServer(NioXnioWorker.java:287)
    at org.xnio.XnioWorker.createStreamServer(XnioWorker.java:135)
    at org.jboss.remoting3.remote.RemoteConnectionProvider$ProviderInterface.createServer(RemoteConnectionProvider.java:209)
    at org.jboss.as.remoting.AbstractStreamServerService.start(AbstractStreamServerService.java:101)
    ... 5 more

root@neuwo:/# 10:38:27,973 INFO  [org.hornetq.core.server.impl.FileLockNodeManager] (MSC service thread 1-8) Waiting to obtain live lock
10:39:23,066 ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 2) Operation ("add") failed - address: ([("deployment" => "mysql-connector-java-5.1.21-bin.jar")]) - failure description: "Operation cancelled asynchronously"
10:39:23,067 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015052: Did not receive a response to the deployment operation within the allowed timeout period [60 seconds]. Check the server configuration file and the server logs to find more about the status of the deployment.
10:39:23,069 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015052: Did not receive a response to the deployment operation within the allowed timeout period [60 seconds]. Check the server configuration file and the server logs to find more about the status of the deployment.
10:39:23,074 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015052: Did not receive a response to the deployment operation within the allowed timeout period [60 seconds]. Check the server configuration file and the server logs to find more about the status of the deployment.
^C
root@neuwo:/# etc/init.d/jboss stop
Stopping JBoss AS7...
{"outcome" => "success"}
root@neuwo:/# 10:40:49,521 INFO  [org.hornetq.core.server.impl.FileLockNodeManager] (MSC service thread 1-8) Live Server Obtained live lock
10:40:49,613 WARNING [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-8) Critical IO Error, shutting down the server. code=6, message=/usr/local/jboss.7.1.1/jboss-as-7.1.1.Final/standalone/data/messagingbindings/hornetq-bindings-1.bindings (Permission denied)
10:40:49,615 SEVERE [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-8) Failure in initialisation: java.io.FileNotFoundException: /usr/local/jboss.7.1.1/jboss-as-7.1.1.Final/standalone/data/messagingbindings/hornetq-bindings-1.bindings (Permission denied)
    at java.io.RandomAccessFile.open(Native Method) [rt.jar:1.7.0_05]
    at java.io.RandomAccessFile.<init>(RandomAccessFile.java:233) [rt.jar:1.7.0_05]
    at org.hornetq.core.journal.impl.NIOSequentialFile.open(NIOSequentialFile.java:99) [hornetq-core-2.2.13.Final.jar:]
    at org.hornetq.core.journal.impl.JournalImpl.orderFiles(JournalImpl.java:394) [hornetq-core-2.2.13.Final.jar:]
    at org.hornetq.core.journal.impl.JournalImpl.load(JournalImpl.java:1884) [hornetq-core-2.2.13.Final.jar:]
    at org.hornetq.core.journal.impl.JournalImpl.load(JournalImpl.java:1496) [hornetq-core-2.2.13.Final.jar:]
    at org.hornetq.core.journal.impl.JournalImpl.load(JournalImpl.java:1480) [hornetq-core-2.2.13.Final.jar:]
    at org.hornetq.core.persistence.impl.journal.JournalStorageManager.loadBindingJournal(JournalStorageManager.java:1500) [hornetq-core-2.2.13.Final.jar:]
    at org.hornetq.core.server.impl.HornetQServerImpl.loadJournals(HornetQServerImpl.java:1548) [hornetq-core-2.2.13.Final.jar:]
    at org.hornetq.core.server.impl.HornetQServerImpl.initialisePart2(HornetQServerImpl.java:1445) [hornetq-core-2.2.13.Final.jar:]
    at org.hornetq.core.server.impl.HornetQServerImpl.access$1200(HornetQServerImpl.java:138) [hornetq-core-2.2.13.Final.jar:]
    at org.hornetq.core.server.impl.HornetQServerImpl$SharedStoreLiveActivation.run(HornetQServerImpl.java:1919) [hornetq-core-2.2.13.Final.jar:]
    at org.hornetq.core.server.impl.HornetQServerImpl.start(HornetQServerImpl.java:366) [hornetq-core-2.2.13.Final.jar:]
    at org.hornetq.jms.server.impl.JMSServerManagerImpl.start(JMSServerManagerImpl.java:269) [hornetq-jms-2.2.13.Final.jar:]
    at org.jboss.as.messaging.jms.JMSService.start(JMSService.java:73) [jboss-as-messaging-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_05]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_05]
    at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_05]

10:40:49,622 INFO  [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-8) HornetQ Server version 2.2.13.Final (HQ_2_2_13_FINAL_AS7, 122) [6d4a8cda-0180-11e2-8893-d710ffcfa3d4]) started
10:40:49,625 INFO  [org.hornetq.jms.server.impl.JMSServerManagerImpl] (MSC service thread 1-3) Caching command for createTopic for testTopic since the JMS Server is not active yet
10:40:49,626 INFO  [org.hornetq.jms.server.impl.JMSServerManagerImpl] (MSC service thread 1-1) Caching command for createConnectionFactory for RemoteConnectionFactory since the JMS Server is not active yet
10:40:49,628 INFO  [org.hornetq.jms.server.impl.JMSServerManagerImpl] (MSC service thread 1-6) Caching command for createConnectionFactory for InVmConnectionFactory since the JMS Server is not active yet
10:40:49,629 INFO  [org.hornetq.jms.server.impl.JMSServerManagerImpl] (MSC service thread 1-2) Caching command for createQueue for testQueue since the JMS Server is not active yet
10:40:49,723 INFO  [org.jboss.as.deployment.connector] (MSC service thread 1-6) JBAS010406: Registered connection factory java:/JmsXA
10:40:49,764 INFO  [org.hornetq.ra.HornetQResourceAdapter] (MSC service thread 1-6) HornetQ resource adaptor started
10:40:49,765 INFO  [org.jboss.as.connector.services.ResourceAdapterActivatorService$ResourceAdapterActivator] (MSC service thread 1-6) IJ020002: Deployed: file://RaActivatorhornetq-ra
10:40:49,770 INFO  [org.jboss.as.deployment.connector] (MSC service thread 1-5) JBAS010401: Bound JCA ConnectionFactory [java:/JmsXA]
10:40:50,984 INFO  [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report
JBAS014775:    New missing/unsatisfied dependencies:
      service jboss.binding.jacorb (missing) dependents: [service jboss.jacorb.orb-service]
      service jboss.binding.jacorb-ssl (missing) dependents: [service jboss.jacorb.orb-service]
      service jboss.jdbc-driver.mysql (missing) dependents: [service jboss.data-source.java:jboss/datasources/BeaverDS, service jboss.data-source.java:jboss/datasources/TwineDS, service jboss.data-source.java:jboss/datasources/TwineMetricsDS]
JBAS014777:   Services which failed to start:      service jboss.web.connector.http: org.jboss.msc.service.StartException in service jboss.web.connector.http: JBAS018007: Error starting web connector
      service jboss.serverManagement.controller.management.http: org.jboss.msc.service.StartException in service jboss.serverManagement.controller.management.http: Address already in use /84.234.78.173:9990
      service jboss.remoting.server.management: org.jboss.msc.service.StartException in service jboss.remoting.server.management: JBAS017112: Address already in use /84.234.78.173:9999
      service jboss.remoting.server.remoting-connector: org.jboss.msc.service.StartException in service jboss.remoting.server.remoting-connector: JBAS017112: Address already in use neuwo.info/84.234.78.173:4447

10:40:51,038 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015954: Admin console is not enabled
10:40:51,039 ERROR [org.jboss.as] (Controller Boot Thread) JBAS015875: JBoss AS 7.1.1.Final "Brontes" started (with errors) in 153496ms - Started 142 of 237 services (18 services failed or missing dependencies, 74 services are passive or on-demand)
root@neuwo:/# cd local/usr/
-bash: cd: local/usr/: No such file or directory
root@neuwo:/# ls
aquota.group  aquota.user  bin  boot  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  sbin  selinux  srv  sys  tmp  usr  var
root@neuwo:/#
root@neuwo:/# ls
aquota.group  aquota.user  bin  boot  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  sbin  selinux  srv  sys  tmp  usr  var
root@neuwo:/# cd usr
root@neuwo:/usr# ls
bin  games  include  lib  lib64  local  sbin  share  src
root@neuwo:/usr# cd local
root@neuwo:/usr/local# ls
ant  bin  etc  games  gwt  gxt  include  jboss  jboss.7.1.1  jdk  jdk1.7.0_05  lib  man  sbin  share  skypekit  src
root@neuwo:/usr/local# cd jboss.7.1.1/jboss-as-7.1.1.Final/
root@neuwo:/usr/local/jboss.7.1.1/jboss-as-7.1.1.Final# ls
LICENSE.txt  README.txt  appclient  bin  bundles  copyright.txt  docs  domain  jboss-modules.jar  jdbc  modules  standalone  welcome-content
root@neuwo:/usr/local/jboss.7.1.1/jboss-as-7.1.1.Final# cd standalone/
root@neuwo:/usr/local/jboss.7.1.1/jboss-as-7.1.1.Final/standalone# ls
configuration  data  deployments  deploymentsls  lib  log  tmp  twine-1.0.0.jar
root@neuwo:/usr/local/jboss.7.1.1/jboss-as-7.1.1.Final/standalone# cd deployments
root@neuwo:/usr/local/jboss.7.1.1/jboss-as-7.1.1.Final/standalone/deployments# ls
README.txt  beaver.ear.failed    mysql-connector-java-5.1.21-bin.jar         mysql-connector-java-5.1.21-bin.jar.redeploy  twine.ear.failed
beaver.ear  beaver.ear.redeploy  mysql-connector-java-5.1.21-bin.jar.failed  twine.ear
root@neuwo:/usr/local/jboss.7.1.1/jboss-as-7.1.1.Final/standalone/deployments# cd ..
root@neuwo:/usr/local/jboss.7.1.1/jboss-as-7.1.1.Final/standalone# cd deploymentsls
-bash: cd: deploymentsls: Not a directory
root@neuwo:/usr/local/jboss.7.1.1/jboss-as-7.1.1.Final/standalone# etc/init.d/jboss start
-bash: etc/init.d/jboss: No such file or directory
root@neuwo:/usr/local/jboss.7.1.1/jboss-as-7.1.1.Final/standalone# /etc/init.d/jboss start
Starting JBoss AS7...
root@neuwo:/usr/local/jboss.7.1.1/jboss-as-7.1.1.Final/standalone# =========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: /usr/local/jboss.7.1.1/jboss-as-7.1.1.Final

  JAVA: java

  JAVA_OPTS:  -server -XX:+UseCompressedOops -XX:+TieredCompilation -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Djboss.server.default.config=standalone.xml

=========================================================================

10:42:48,697 INFO  [org.jboss.modules] JBoss Modules version 1.1.1.GA
10:42:48,903 INFO  [org.jboss.msc] JBoss MSC version 1.0.2.GA
10:42:48,964 INFO  [org.jboss.as] JBAS015899: JBoss AS 7.1.1.Final "Brontes" starting
10:42:50,475 INFO  [org.xnio] XNIO Version 3.0.3.GA
10:42:50,476 INFO  [org.jboss.as.server] JBAS015888: Creating http management service using socket-binding (management-http)
10:42:50,484 INFO  [org.xnio.nio] XNIO NIO Implementation Version 3.0.3.GA
10:42:50,491 INFO  [org.jboss.remoting] JBoss Remoting version 3.2.3.GA
10:42:50,571 INFO  [org.jboss.as.logging] JBAS011502: Removing bootstrap log handlers
10:42:50,575 INFO  [org.jboss.as.configadmin] (ServerService Thread Pool -- 30) JBAS016200: Activating ConfigAdmin Subsystem
10:42:50,579 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 35) JBAS010280: Activating Infinispan subsystem.
10:42:50,660 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 45) JBAS011800: Activating Naming Subsystem
10:42:50,662 INFO  [org.jboss.as.jacorb] (ServerService Thread Pool -- 36) JBAS016300: Activating JacORB Subsystem
10:42:50,665 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 51) JBAS013101: Activating Security Subsystem
10:42:50,665 INFO  [org.jboss.as.osgi] (ServerService Thread Pool -- 47) JBAS011940: Activating OSGi Subsystem
10:42:50,672 INFO  [org.jboss.as.security] (MSC service thread 1-7) JBAS013100: Current PicketBox version=4.0.7.Final
10:42:50,796 INFO  [org.jboss.as.connector] (MSC service thread 1-5) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.9.Final)
10:42:51,090 INFO  [org.jboss.as.naming] (MSC service thread 1-5) JBAS011802: Starting Naming Service
10:42:51,157 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-6) JBAS015400: Bound mail session [java:jboss/mail/Default]
10:42:51,863 INFO  [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-3) live server is starting with configuration HornetQ Configuration (clustered=false,backup=false,sharedStore=true,journalDirectory=/usr/local/jboss.7.1.1/jboss-as-7.1.1.Final/standalone/data/messagingjournal,bindingsDirectory=/usr/local/jboss.7.1.1/jboss-as-7.1.1.Final/standalone/data/messagingbindings,largeMessagesDirectory=/usr/local/jboss.7.1.1/jboss-as-7.1.1.Final/standalone/data/messaginglargemessages,pagingDirectory=/usr/local/jboss.7.1.1/jboss-as-7.1.1.Final/standalone/data/messagingpaging)
10:42:51,866 INFO  [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-3) Waiting to obtain live lock
10:42:51,961 INFO  [org.apache.coyote.http11.Http11AprProtocol] (MSC service thread 1-4) Starting Coyote HTTP/1.1 on http-neuwo.info-84.234.78.173-8080
10:42:51,976 INFO  [org.hornetq.core.persistence.impl.journal.JournalStorageManager] (MSC service thread 1-3) Using NIO Journal
10:42:52,268 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-8) JBAS015012: Started FileSystemDeploymentService for directory /usr/local/jboss.7.1.1/jboss-as-7.1.1.Final/standalone/deployments
10:42:52,270 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015014: Re-attempting failed deployment mysql-connector-java-5.1.21-bin.jar
10:42:52,272 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015014: Re-attempting failed deployment beaver.ear
10:42:52,476 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015014: Re-attempting failed deployment twine.ear
10:42:52,479 INFO  [org.jboss.as.remoting] (MSC service thread 1-6) JBAS017100: Listening on neuwo.info/84.234.78.173:4447
10:42:52,479 INFO  [org.jboss.as.remoting] (MSC service thread 1-5) JBAS017100: Listening on /84.234.78.173:9999
10:42:52,789 WARN  [org.hornetq.jms.server.recovery.HornetQXAResourceWrapper] (Periodic Recovery) Can't connect to any hornetq server on recovery [XARecoveryConfig [hornetQConnectionFactory=HornetQConnectionFactory [serverLocator=ServerLocatorImpl [initialConnectors=[org-hornetq-core-remoting-impl-invm-InVMConnectorFactory?server-id=0], discoveryGroupConfiguration=null], clientID=null, dupsOKBatchSize=1048576, transactionBatchSize=1048576, readOnly=false], username=null, password=null]]
10:42:52,791 WARN  [com.arjuna.ats.jta] (Periodic Recovery) ARJUNA016027: Local XARecoveryModule.xaRecovery got XA exception XAException.XAER_RMERR: javax.transaction.xa.XAException: Error trying to connect to any providers for xa recovery
    at org.hornetq.jms.server.recovery.HornetQXAResourceWrapper.getDelegate(HornetQXAResourceWrapper.java:275) [hornetq-jms-2.2.13.Final.jar:]
    at org.hornetq.jms.server.recovery.HornetQXAResourceWrapper.recover(HornetQXAResourceWrapper.java:77) [hornetq-jms-2.2.13.Final.jar:]
    at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.xaRecovery(XARecoveryModule.java:503) [jbossjts-4.16.2.Final.jar:]
    at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.resourceInitiatedRecoveryForRecoveryHelpers(XARecoveryModule.java:471) [jbossjts-4.16.2.Final.jar:]
    at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.bottomUpRecovery(XARecoveryModule.java:385) [jbossjts-4.16.2.Final.jar:]
    at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.periodicWorkSecondPass(XARecoveryModule.java:166) [jbossjts-4.16.2.Final.jar:]
    at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.doWorkInternal(PeriodicRecovery.java:789) [jbossjts-4.16.2.Final.jar:]
    at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.run(PeriodicRecovery.java:371) [jbossjts-4.16.2.Final.jar:]
Caused by: HornetQException[errorCode=2 message=null]
    at org.hornetq.jms.server.recovery.HornetQXAResourceWrapper.connect(HornetQXAResourceWrapper.java:351) [hornetq-jms-2.2.13.Final.jar:]
    at org.hornetq.jms.server.recovery.HornetQXAResourceWrapper.getDelegate(HornetQXAResourceWrapper.java:251) [hornetq-jms-2.2.13.Final.jar:]
... 7 more

A: The key line in your console log is:
10:38:22,364 ERROR [org.apache.coyote.http11.Http11AprProtocol] (MSC service thread 1-5) Error initializing endpoint: java.lang.Exception: Socket bind failed: [98] Address already in use

and
10:38:23,063 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC00001: Failed to start service jboss.serverManagement.controller.management.http: org.jboss.msc.service.StartException in service jboss.serverManagement.controller.management.http: Address already in use /84.234.78.173:9990

and
10:38:23,065 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.remoting.server.management: org.jboss.msc.service.StartException in service jboss.remoting.server.management: JBAS017112: Address already in use /84.234.78.173:9999

ETC...
Check to make sure that you aren't running more then one instance of JBoss and that you don't have other services already running on the ports listed.

A: Maybe this post could help you:
http://www.kevinhooke.com/2012/07/25/deploymentscanner-timeouts-on-openshift-jboss-as7/
Regards,


text:
Q: Evaluate the integral $\int_{0}^{+\infty}\frac{\arctan \pi x-\arctan x}{x}dx$ Compute improper integral : $\displaystyle I=\int\limits_{0}^{+\infty}\dfrac{\arctan \pi x-\arctan x}{x}dx$.

A: We have
$$\int_a^b \dfrac{\arctan \pi x-\arctan x}{x}dx=\int_{\pi a}^{\pi b}\dfrac{\arctan x}{x}dx-\int_{ a}^{ b}\dfrac{\arctan x}{x}dx\\=\int_{ b}^{\pi b}\dfrac{\arctan x}{x}dx-\int_{ a}^{ \pi a}\dfrac{\arctan x}{x}dx$$
and since the function $\arctan$ is increasing so
$$\arctan( b)\log\pi=\arctan( b)\int_b^{\pi b}\frac{dx}{x}\leq\int_{ b}^{\pi b}\dfrac{\arctan x}{x}dx\\ \leq\arctan(\pi b)\int_b^{\pi b}\frac{dx}{x}=\arctan(\pi b)\log\pi$$
so if $b\to\infty$ we have
$$\int_{ b}^{\pi b}\dfrac{\arctan x}{x}dx\to\frac{1}{2}\pi\log\pi$$
and by a similar method we prove that
$$\int_{ a}^{ \pi a}\dfrac{\arctan x}{x}dx\to 0,\quad a\to0$$
hence we conclude
$$\displaystyle I=\int\limits_{0}^{+\infty}\dfrac{\arctan \pi x-\arctan x}{x}dx=\frac{1}{2}\pi\log\pi$$

A: With
\begin{eqnarray*}
\lim_{x \to \infty}\left\lbrack\arctan\left(\pi x\right) - \arctan\left(x\right)\right\rbrack
\ln\left(x\right)
& = &
\lim_{x \to \infty}
\left\lbrack\arctan\left(1 \over x\right) - \arctan\left(1 \over \pi x\right)\right\rbrack
\ln\left(x\right)
\\
& = &
\left(1 - {1 \over \pi}\right)\lim_{x \to \infty}{\ln\left(x\right) \over x}
\\
& = &
\left(1 - {1 \over \pi}\right)\lim_{x \to \infty}{1/x \over 1} = 0
\end{eqnarray*}
and
\begin{eqnarray*}
\lim_{x \to 0}\left\lbrack\arctan\left(\pi x\right) - \arctan\left(x\right)\right\rbrack
\ln\left(x\right)
& = &
\left(\pi - 1\right)\lim_{x \to 0}
\left\lbrack x\ln\left(x\right)\right\rbrack
\\
& = &
\left(\pi - 1\right)\lim_{x \to 0}{\ln\left(x\right) \over 1/x}
\\
& = &
\left(\pi - 1\right)\lim_{x \to 0}{1/x \over -1/x^{2}} = 0
\end{eqnarray*}
we have
\begin{eqnarray*}\color{#66f}{\large\int_{0}^{\infty}%
{\arctan\left(\pi x\right) - \arctan\left(x\right) \over x}\,{\rm d}x}
& = &
-\int_{0}^{\infty}\ln\left(x\right)\left\lbrack
{\pi \over \left(\pi x\right)^{2} + 1}
-
{1 \over x^{2} + 1}
\right\rbrack\,{\rm d}x
\\
& = &
-\int_{0}^{\infty}\left\lbrack\ln\left(x \over \pi\right) - \ln\left(x\right)\right\rbrack
{1 \over x^{2} + 1}\,{\rm d}x
\\
& = &
\ln\left(\pi\right)
\underbrace{\quad\int_{0}^{\infty}
{1 \over x^{2} + 1}\,{\rm d}x\quad}_{=\ \pi/2}
=
\color{#66f}{\large{\pi \over 2}\,\ln\left(\pi\right)} \approx {\tt 1.7981}
\end{eqnarray*}

A: Let $D=\{(x,y)\in \mathbb R^2:x\le y \le \pi x\}$. Let $f(x,y):=\frac{1}{x(1+y^2)}$. Since $f\ge 0$ is almost everywhere continuous on $D$ and hence is measurable, Tonelli's theorem states that
$$\iint_D f(x,y)\mathrm dx\mathrm dy=\int_0^{\infty}\left (\frac{1}{x}\int_x^{\pi x} \frac{1}{1+y^2}\mathrm dy \right )\mathrm dx=\int_0^\infty \left (\frac{1}{1+y^2} \int_{\frac{y}{\pi}}^y \frac{1}{x}\mathrm dx \right )\mathrm dy$$
The second integral is exactly $I$. The rightmost integral evaluates to
$$\int_0^\infty \left (\frac{1}{1+y^2} \int_{\frac{y}{\pi}}^y \frac{1}{x}\mathrm dx \right )\mathrm dy=\int_0^{\infty}\frac{\log y-\log (\frac{y}{\pi})}{1+y^2}\mathrm dy=\log \pi \int \frac{1}{1+y^2}\mathrm dy=\color{red}{\frac{\pi}{2}\log\pi}$$
You could also notice that $I$ is a Frullani integral. Generally speaking,
if $f'$ is continuous and the integral converges,
$$\int_0^{\infty}\frac{f(bx)-f(ax)}{x}\mathrm dx=\left (f(0)-f(\infty)\right )\log \left(\frac{b}{a}\right )$$

A: $$I(a)=\int\limits_{0}^{+\infty}\dfrac{\arctan (a x)-\arctan x}{x}dx$$
$$I'(a) = \int^{\infty}_0 \frac{1}{1+a^2x^2}\, dx$$
$$I'(a) =\frac{\pi}{2 a}\, $$
Hence by integrating
$$I(a) =\frac{\pi}{2} \log(a) +C $$
by $a=1$ we have $C=0$
$$I(a) = \frac{\pi}{2} \log(a)  $$
$$I(\pi)=\int\limits_{0}^{+\infty}\dfrac{\arctan (\pi x)-\arctan x}{x}dx = \frac{\pi}{2} \log(\pi) $$

A: You can write
$$I=\int_0^\infty dx\int_1^\pi dy\ \frac{1}{1+x^2y^2}.$$
Change the order of integration:
$$I=\int_1^\pi dy\int_0^\infty dx\ \frac{1}{1+x^2y^2}=\int_1^\pi dy\ \frac{\pi}{2y}=\frac{\pi}{2}\ln\pi.$$
If memory serves, this is an old Putnam problem.
Addendum:
Eric Auld correctly points out that the change in the order of integration should be justified. By thm. 6.3 of these notes, we can change the order of integration if
$$\int_0^\infty dx\ \frac{1}{1+x^2y^2}$$
converges uniformly for $y\in[1,\pi]$. That is, we want to show that for any $\epsilon>0$ there exists $x_0\in[0,\infty)$ with
$$\epsilon>\left|\int_0^\infty dx\ \frac{1}{1+x^2y^2}-\int_0^\xi dx\ \frac{1}{1+x^2y^2}\right|=\left|\int_\xi^\infty dx\ \frac{1}{1+x^2y^2}\right|$$
("convergence") for all $\xi\ge x_0$ and $y\in[1,\pi]$ ("uniform"). In other words, the unbounded region of the integral can be made arbitrarily small for all values of $y$ simultaneously.
In this case,
$$\int_\xi^\infty dx\ \frac{1}{1+x^2y^2}\le\int_\xi^\infty dx\ \frac{1}{1+x^2}=\frac{\pi}{2}-\tan^{-1}\xi$$
so if we choose
$$x_0>\tan\left(\frac{\pi}{2}-\epsilon\right)$$
then we are done.


text: Q: How to insert jsdoc @param programmatically in node.js Is there a way to paste jsdoc descriptions programmatically? I mean I have some similar functions, but with slightly different arguments. Depending on the function I would like to have a different doc description. I can not find help in the jsdoc documentation. Any suggestions?


text:
Q: Parse.com PFUser signUpInBackgroundWithBlock: block not being called on first tap i am developing an iOS-App with Swift and the parse.com framework and have a big problem with registering new users.
The block of "signUpInBackgroundWithBlock" is not being called on the first tap, although the new user is getting registered. When i am tapping the button a second time, the block gets finally called and i get an error, that the username is already registered.
var newUser = PFUser()
newUser.username = registerView.nicknameTextField.text.trim()
newUser.email = registerView.emailTextField.text
newUser.password = registerView.passwordTextField.text

newUser.signUpInBackgroundWithBlock {
        (succeeded: Bool, error: NSError!) -> Void in
            self.registerCompletionBlock(succeeded, error: error)
    }

Is someone having the same problem and knows a solution for this strange behaviour?
Thanks!
Edit:
The completion block should call the "registerCompletionBlock()" function:
func registerCompletionBlock(succeeded: Bool, error: NSError!) {
    if error == nil {
        let subscriptionStoryboard = UIStoryboard(name: "Subscription", bundle: nil)
        let viewcontroller: UIViewController = subscriptionStoryboard.instantiateInitialViewController() as UIViewController
        self.presentViewController(viewcontroller, animated: true, completion: nil)
    } else {
        if let errorString = error.userInfo?["error"] as? NSString {
            println(errorString)
            if error.userInfo?["code"] as Float == 202{
                let alert = UIAlertView(title: "vergeben", message: "name vergeben", delegate: nil, cancelButtonTitle: "abbrechen")
                alert.show()
            }
        }
    }
}

A: I tried the solution posted previously (eliminating PFUser.enableAutomaticUser()), and the issue persisted.
In case anyone else is still looking for a solution to this issue, try changing the if error == nil to if succeeded == true in the block of signUpInBackground. This worked for me and all is functional in backend.

A: Its calling at first time, but its taking a little time for calling this .. because its sending data on server in asynchronous. Asynchronous never block the main thread..
Because : -

*

*Asynchronous never block the main thread waiting for a network response.

*Asynchronous can be either synchronous on a separate thread, or scheduled in the run loop of any thread.

*Asynchronous can be either synchronous on a separate thread, or scheduled in the run loop of any thread.

*Synchronous blocks main thread until they complete request.

A: Because you call the method asynchronous, it takes some time to do it and your main thread doesn't wait for the method to finish. So you should, if you want to show a message or perform a segue, after the registration, put it inside the completion-block:
newUser.signUpInBackgroundWithBlock {
    (succeeded: Bool!, error: NSError!) -> Void in
    if error == nil {
      // Perform a segue, show a message or whatever you want

    } else {
      let errorString = error.userInfo["error"] as NSString
      // Show the errorString somewhere and let the user try again.
    }
  }

Also if you don't want to do it asynchronous, you can call the signUp() method(without the inBackgroundWithBlock. That way the application waits for the signup to finish until it continues.

A: i figured it out. Problem was, that i used PFUser.enableAutomaticUser() in the AppDelegate. I removed that line and the signup-block works flawlessly now!


text:
Q: android touchevent for listActivity I have created ListActivity of images I want touchevent just like onItemClickListner, how can I do it? I'm not finding any onItemTochListener.

A: It's on the list view
getListView().setOnItemClickListener( ... )

A: You don't need to set a new OnClickListener. The ListActivity class has a method called onListItemClicked which registers click and touch events for the items in the list view. Simply override this method with the code you want executed when a list item is pressed.


text:
Q: UIScrollView with custom horizontal scrolling I need to create an horizontal list with a scroll, this list is made of 10 images, in the screen only fits 1 and a half of these images, so when the user scroll i need to set at the center of the screen an image and besides it a portion on the forward image and backward image. So far what i have is this:
scroll = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 150, 1024, 520)];
scroll.delegate = self;
scroll.pagingEnabled = NO;
int numberOfViews = 10;
float xOrigin = 0;
for (int i = 0; i < numberOfViews; i++) {
    xOrigin = i * 600;
    FigureImage *tape = [[FigureImage alloc] initCustom];
    [scroll addSubview:tape];
    FigureImage *pictureFigure = [[FigureImage alloc] initCustom];
    [scroll addSubview:pictureFigure];
}
scroll.contentSize = CGSizeMake(numberOfViews*10, 500);
pageWidth = (numberOfViews*10)/numberOfViews;

[self.view addSubview:scroll];

With this code i am able to scroll the images, but the scroll doesnt stop at any particular image, how can i able the last x position to stop the scrolling?

A: See the delegate method -scrollViewWillEndDragging:withVelocity:targetContentOffset:.
Its last parameter is an in-out CGPoint whose value you can change so that the scroll comes to rest with an image centered exactly.


text:
Q: assign user and group to site log files When in a site apache conf file, is there a way to set the user and group for the CustomLog and ErrorLog?
Right now, these 2 records create the error and access log with root:root permissions, but I would like them to be flewis:admin
CustomLog /var/log/httpd/domain.com-access.log combined
ErrorLog /var/log/httpd/domain.com-error.log

If I change the user:group of the files, when the logs rotate, the new logs are root:root

A: You might:
chgrp admin /var/log/httpd
chmod g+s /var/log/httpd     # propagates group to new files (& g+s to new subdirs)

This may be enough. My logfiles default to rw-r----- (octal 640), so I wouldn't need more.  I'd probably point the logs domain.com log into a subdirectory of httpd so I could stamp a domain.com-specific group on it.
If your webserver's defaults are more restrictive, say rw------- (octal 600), you may need find the script that starts your webserver and add "umask 027" to it (before the webserver is spawned), or see if your system uses /etc/sysconfig/httpd or the like that allows the line there.  A 022 blocks only write access for group/other (allow read to everyone), and a 027 only blocks permission for users other than the owner (probably root) and your group "admin" (thus allowing read for owner and group "admin" and nothing for anyone else).
Other alternatives are to reconfigure the logs to go to syslog or to another program.


text:
Q: d3.axis.ticks() will be ignored I can't skip x-axis labels with this code:
    // define x-axis data
var x = d3.scaleBand().range([0, this.width]).padding(0.2)
    .domain(data.map(function(d) { return d.timestamp; }));

// store the x-axis element
var xAxis = this.svg.append("g")
    .attr("transform", "translate(0," + this.height + ")")
    .call(d3.axisBottom(x).ticks(d3.timeDay.every(10)).tickFormat(d3.timeFormat("%d-%m-%Y %H:%M:%S")));

ticks(d3.timeDay.every(10) seems to be ignored. I got always the whole bunch of labels specified by the data.


text:
Q: How to setup TypeLite to build types in other projects I'm working in MS Dynamics CRM, and I have a WebResources project that contains all of my TypeScript.  I have Plugin .net library dll that contains some POCO objects that will be returned via Rest to my javascript in my WebResources project.  How do I setup TypeLite to build my Typescript files?
This is my assumption.

*

*Install Typescript NuGet Package in my Plugin project

*Decorate the POCO classes I need Typescript files for, with the [TsClass] attribute

*Upon build, it will generate the Typescript Files to the Scripts folder that it will create in the Plugin project

*I create a postbuild event that copies the Typescript files over to my WebResources Project

Is there an easier way?
Did I make an incorrect assumption?
Update
From Lukas's answer, I've updated my TypeLite.Net4.tt file to look like this:
<#@ template debug="false" hostspecific="True" language="C#" #>
<#@ assembly name="$(TargetDir)TypeLite.dll" #>
<#@ assembly name="$(TargetDir)TypeLite.Net4.dll" #>
<#@ assembly name="$(TargetDir)Xrm.Plugins.dll" #>
<#@ assembly name="$(TargetDir)$(TargetFileName)" #>

<#@ import namespace="TypeLite" #>
<#@ import namespace="TypeLite.Net4" #>
<#@output extension=".d.ts"#>
<#@include file="Manager.ttinclude"#>
<# var manager = Manager.Create(Host, GenerationEnvironment); #>

<# var ts = TypeScript.Definitions()
        .WithReference("Enums.ts")
        .For<Xrm.Plugins.Rest.Poco.AccountLookupResponse>();
#>

<#= ts.Generate(TsGeneratorOutput.Properties) #>

<# manager.StartNewFile("Enums.ts"); #>
<#= ts.Generate(TsGeneratorOutput.Enums) #>
<# manager.EndBlock(); #>
<# manager.Process(true); #>

This generates the correct definition in the TypeLite.Net4.d.ts file.  I'm not currently using any enums in my class, so the Enums.ts is not necessary currently, but it doesn't hurt to have it.

A: There is another way, but I am not sure, whether it is better.

*

*install TypeLITE.Lib package to your Plugin project (you need reference TypeLITE library there, because you want to use the [TsClass] attribute)

*install TypeLITE package to your WebResources project and modify TypeLite.tt file to include a reference to your plugin.dll
<#@ assembly name="$(TargetDir)plugin.dll" #>
alternatively you can skip the first step and use fluent configuration TypeScript.Definitions().For<YourClass>() to include specific classes in the output file


text:
Q: Can the Windows Indexing Service restart an app pool if it doesn't index the Web.Config? I am having a slight debate with a colleague of mine on this subject.
Scenario:
A web site has a sub directory that is indexed using the Windows Indexing Service.  There is not a web.config in this directory and the indexing service is not indexing the parent directory which is the site root.  Something is causing the app pool to restart at supposedly random times.
From what I am finding online, the only time the Windows Indexing service would cause an app pool restart is if it's indexing the web.config (or machine.config).  My colleague is saying that the indexing service is causing the restarts just because it's in a child folder of the root.
So...does anyone have any information or experience on this?  If the indexing service is indexing a child folder of the root but not the root directory itself, can it cause IIS to restart the site's app pool?
EDIT:
The sub directory in question is NOT the bin directory.  I know it would cause such as well; however, the bin directory is not the target of the indexing service.

A: Ran some tests on this and it would appear that the indexing service does not touch any directory above the directory it's pointed at.


text:
Q: Why this error in Three Level nested attributes in Rails 3? this error not display on creation of record
only come when update

please help..

A: Your code in edit template seems to be the source of this problem.  You must have defined member's last_name without using the fields_for object.
<%= f.fields_for :member do |member| %>
  <%= member.text_field :first_name %>
  ... # Other attributes
  <%= member.text_field :last_name %> # make sure you are using the fields_for instance (member in this example) here.
<% end %>

A: add attribute to attr_accessible list like
attr_accessible attr1, attr2

this is rails 3 technique to avoid unwanted attribute assignments like sensitive data from form.
Is applicable while using object.update_attributes function and note with object.save.


text:
Q: $R ≅ R/I$ prove that for any two-sided ideals $A$ and $B$ we have $A⊆B $ or $B⊆A$
Assume that $R$ is a ring such that for any two-sided ideal $I$ of $R$ we have $R ≅ R/I$. Prove that for any two-sided ideals $A$ and $B$ we have $A⊆B$ or $B⊆A$ .

I try to solve with proof by contradiction and this property that $A∩B$ is also an ideal but i could not find any thing useful.

A: Let me state a more general problem and then explain the solution.
Problem. Show that if $A$ is a nontrivial algebraic structure that
is isomorphic to each of its nontrivial quotients, then the lattice
of congruences on $A$ is a well order.
[Here $A$ is nontrivial means $|A|>1$. A congruence on $A$ is a
kernel of a homomorphism.]
[Before giving the solution, here is the terminology: an algebraic structure is simple if its lattice of congruences is a 2-element chain. It is pseudosimple if it is not simple, but it is isomorphic to each of its nontrivial quotients. So the problem is to show that if an algebra is simple or pseudosimple, then its lattice of congruences is a well order.]
Solution. Choose $a\neq b$ in $A$ and let $\alpha$ be a congruence
on $A$ maximal for separating these elements. Then $A/\alpha$ is a nontrivial
quotient of $A$, since it contains the distinct elements $a/\alpha$ and
$b/\alpha$, hence $A\cong A/\alpha$. By the maximality of $\alpha$, $A/\alpha$ has a smallest nonzero
congruence, namely the one that identifies $a/\alpha$ and $b/\alpha$.
This implies that the zero congruence of $A/\alpha$ is completely meet irreducible.
Since $A\cong A/\alpha$,
the zero congruence of $A$ is also completely meet irreducible.
Since $A\cong A/\theta$ whenever $|A/\theta|>1$, it follows that
the zero congruence on any
nontrivial quotient of $A$ is completely meet irreducible.
By the Correspondence Theorem, every proper congruence $\theta$ on $A$ is completely
meet irreducible.
This already implies that the lattice of congruences of $A$ is a well order.
First, it must be a linear order, since if it had incomparable elements
$\beta$ and $\gamma$, then $\theta=\beta\cap\gamma$ would be a congruence that
is not completely meet reducible. Next, it has DCC, since
if $(\delta_n)_{n\in\omega}$ is a strictly decreasing $\omega$-chain
in the lattice of congruences, then
$\theta=\bigcap_{n\in\omega} \delta_n$ is not completely meet irreducible.

Let me respond to the questions of Batominovski:

*

*(Would $A\cap B$ be the maximal congruence $C$ that separates $A$ and $B$?) No, we are separating elements of $R$, not congruences/ideals of $R$. In ring notation, choose $a\neq 0$ in $R$, and then let $A$ be an ideal of $R$ that is maximal for the property that $a\notin A$. Such $A$ exists by Zorn's Lemma.
[Now I am taking $R$ for my algebra, $a$ and $0$ for my two elements to be separated, and congruence modulo $A$ for the separating congruence.]

*(How do we show that the zero congruence of $R$ is completely meet irreducible?) It suffices to show that $R$ has a nontrivial quotient that has completely meet irreducible zero congruence, since $R$ is isomorphic to any such ring. So take a subdirectly irreducible quotient. This is what is being described in the first 2-3 sentences of the Solution. If $a\neq 0$ in $R$ and $A$ is maximal in $R$ for the property $a\notin A$, then $R/A$ is nontrivial,
since $\bar{a}\neq \bar{0}$ in this quotient, yet any nonzero ideal of $R/A$ contains $\bar{a}$ by the maximality of $A$. Thus the complete meet of nonzero ideals of $R/A$ also contains $\bar{a}$, which means this complete meet is not zero. This shows that the zero ideal of $R/A$ is completely meet irreducible.

*(Do you know any ring $R$ with the required property?) As Tsemo Aristide pointed out, if $R$ has a maximal ideal and the required property, then $R$ must be simple, not pseudosimple. This will happen if $R$ has an identity element, as rschwieb has already mentioned. Hence any simple ring has the required property, and these are the only examples when $R$ has a maximal ideal. As for pseudosimple rings,
I do not know if there are any noncommutative examples. But it is a not-too-difficult exercise to show that a commutative pseudosimple ring must be a ring with zero multiplication and pseudosimple underlying additive group, and therefore any commutative pseudosimple ring is isomorphic to a Prufer group $\mathbb Z_{p^\infty}$ equipped with zero multiplication.
The pseudosimple commutative semigroups are classified in
Boris M. Schein, Pseudosimple commutative semigroups, Monatshefte für Mathematik
March 1981, Volume 91, Issue 1, pp 77-78.
and pseudosimple lattices with congruence lattices of every allowable order type are constructed in
Graetzer, G.; Schmidt, E. T.
Two notes on lattice-congruences.
Ann. Univ. Sci. Budapest. Eotvos. Sect. Math. 1 1958 83-87.

A: Let $A$ be an be ideal, we suppose that $A$ is a maximal ideal. We denote by $p_A:R\rightarrow R/A$ the quotient map. There exists an isomorphism $g:R/A\rightarrow R$, $p_A\circ g:R/A\rightarrow R/A$ is a morphism of rings whose kernel contains $g^{-1}(A)$. Since $A$ is maximal, $g^{-1}(A)=0$. We deduce that $A=0$ since $g$ is an isomorphism. This implies that the only non trivial ideal of $R$ is $\{0\}$.


text:
Q: How to add favicon to php pages? I have this line included in all of my pages.
<link rel="icon" href="favicon.ico" type="image/x-icon">

As far as I know, all i need to do is place a file called favicon.ico in my root directory. I did that as well

But the favicon is not appearing. How can I fix this?

A: From what I can see, your favicon.ico most probably is not located in your web root. You should try moving it into httpdocs. I doubt that your web server can access the file right now, besides that you would have to reference it as "../favicon.ico" from a document within httpdocs.