qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
25,359,358
I have a question around the topic Generics in Java: Let's say I have following generic (static) method in class. In this method, I want to have access to certain method/fields of the real class. Is there some typesafe way in the static language Java? Or are there any workarounds? ``` public class GenericClassUtil { ...
2014/08/18
[ "https://Stackoverflow.com/questions/25359358", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1625596/" ]
Create an Interface and extend `Easel`, `Cat`, `Dog` class to that interface. ``` public static <T extends ThatInterface> workWithRealTypeAttr(T objectClass) { //here get access to values of Easel, Cat, Dog or some other class } ``` [Ref:](http://docs.oracle.com/javase/tutorial/java/generics/bounded.html) > > The...
The only way you can do is let all your classes implements a common interface and keep one common method in that interface. And you have to specify bounds for your T like (Considering Animal is the super class for all your mentioned class) Then you can access t.commonMethod() inside For example Have interface like ...
25,359,358
I have a question around the topic Generics in Java: Let's say I have following generic (static) method in class. In this method, I want to have access to certain method/fields of the real class. Is there some typesafe way in the static language Java? Or are there any workarounds? ``` public class GenericClassUtil { ...
2014/08/18
[ "https://Stackoverflow.com/questions/25359358", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1625596/" ]
Create an Interface and extend `Easel`, `Cat`, `Dog` class to that interface. ``` public static <T extends ThatInterface> workWithRealTypeAttr(T objectClass) { //here get access to values of Easel, Cat, Dog or some other class } ``` [Ref:](http://docs.oracle.com/javase/tutorial/java/generics/bounded.html) > > The...
You can do if you limit the generic type to classes that extend a certain base class. For example if your method only operates on `Animal` class then you would have: ``` public static <T extends Animal> workWithRealTypeAttr(T objectClass) { objectClass.someAnimalMethod() } public class Animal { public void...
25,359,358
I have a question around the topic Generics in Java: Let's say I have following generic (static) method in class. In this method, I want to have access to certain method/fields of the real class. Is there some typesafe way in the static language Java? Or are there any workarounds? ``` public class GenericClassUtil { ...
2014/08/18
[ "https://Stackoverflow.com/questions/25359358", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1625596/" ]
You can do if you limit the generic type to classes that extend a certain base class. For example if your method only operates on `Animal` class then you would have: ``` public static <T extends Animal> workWithRealTypeAttr(T objectClass) { objectClass.someAnimalMethod() } public class Animal { public void...
Although it's not elegant you could use construction as below. You can try using instanceof and casting. ``` public static <T> workWithRealTypeAttr(T objectClass) { if (objectClass instanceof Easel) { ((Easel) objectClass).toSomehtingEaselsDo()); } elseif (objectClass instanceof Cat) { ((Cat) ...
25,359,358
I have a question around the topic Generics in Java: Let's say I have following generic (static) method in class. In this method, I want to have access to certain method/fields of the real class. Is there some typesafe way in the static language Java? Or are there any workarounds? ``` public class GenericClassUtil { ...
2014/08/18
[ "https://Stackoverflow.com/questions/25359358", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1625596/" ]
> > I want to have access to certain method/fields of the real class > > > If you want to access method/fields of the real class then use different **overloaded methods** ``` class GenericClassUtil { public static void workWithRealTypeAttr(Bird objectClass) { // call a method specific to Bird (Ease...
Yes you can. There are two (or more) ways to achieve it. You can use Animal interface/class and use wildcard like this: ``` public static <T extends Animal> void makeAnimalEat(T animal) { animal.eat(); } ``` or use reflection like this: ``` public static <T> void makeAnimalEatReflection(T animal) throws NoSuc...
25,359,358
I have a question around the topic Generics in Java: Let's say I have following generic (static) method in class. In this method, I want to have access to certain method/fields of the real class. Is there some typesafe way in the static language Java? Or are there any workarounds? ``` public class GenericClassUtil { ...
2014/08/18
[ "https://Stackoverflow.com/questions/25359358", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1625596/" ]
> > I want to have access to certain method/fields of the real class > > > If you want to access method/fields of the real class then use different **overloaded methods** ``` class GenericClassUtil { public static void workWithRealTypeAttr(Bird objectClass) { // call a method specific to Bird (Ease...
The only way you can do is let all your classes implements a common interface and keep one common method in that interface. And you have to specify bounds for your T like (Considering Animal is the super class for all your mentioned class) Then you can access t.commonMethod() inside For example Have interface like ...
25,359,358
I have a question around the topic Generics in Java: Let's say I have following generic (static) method in class. In this method, I want to have access to certain method/fields of the real class. Is there some typesafe way in the static language Java? Or are there any workarounds? ``` public class GenericClassUtil { ...
2014/08/18
[ "https://Stackoverflow.com/questions/25359358", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1625596/" ]
You can do if you limit the generic type to classes that extend a certain base class. For example if your method only operates on `Animal` class then you would have: ``` public static <T extends Animal> workWithRealTypeAttr(T objectClass) { objectClass.someAnimalMethod() } public class Animal { public void...
The only way you can do is let all your classes implements a common interface and keep one common method in that interface. And you have to specify bounds for your T like (Considering Animal is the super class for all your mentioned class) Then you can access t.commonMethod() inside For example Have interface like ...
25,359,358
I have a question around the topic Generics in Java: Let's say I have following generic (static) method in class. In this method, I want to have access to certain method/fields of the real class. Is there some typesafe way in the static language Java? Or are there any workarounds? ``` public class GenericClassUtil { ...
2014/08/18
[ "https://Stackoverflow.com/questions/25359358", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1625596/" ]
Create an Interface and extend `Easel`, `Cat`, `Dog` class to that interface. ``` public static <T extends ThatInterface> workWithRealTypeAttr(T objectClass) { //here get access to values of Easel, Cat, Dog or some other class } ``` [Ref:](http://docs.oracle.com/javase/tutorial/java/generics/bounded.html) > > The...
Yes you can. There are two (or more) ways to achieve it. You can use Animal interface/class and use wildcard like this: ``` public static <T extends Animal> void makeAnimalEat(T animal) { animal.eat(); } ``` or use reflection like this: ``` public static <T> void makeAnimalEatReflection(T animal) throws NoSuc...
788,161
I can set the screen resolution manually once I log in using the following command: ``` xrandr -s 1360x768 ``` but I am not able to make it "stick". Every time I log back in, the resolution for a little while changes to 1360x768, but by the time the desktop appears, switches back to 800x600. I have also tried other...
2016/06/17
[ "https://askubuntu.com/questions/788161", "https://askubuntu.com", "https://askubuntu.com/users/242805/" ]
If you are using Ubuntu on VMWare Workstation, you need to install **`VMWare tools`** to get proper resolution. Here is the step by step procedure to do that : * Start your Virtual machine and login to your Ubuntu. * Go to **VM** --> **Install VMWare Tools...** [![enter image description here](https://i.stack.imgur....
Edit your VMX to include: ``` vga.guestBackedPrimaryAware = "FALSE" svga.minVRAMSize = "16777216" ``` notes: * Tested with Xubuntu 16.04 with kernel version 4.4.0-77 in VMWare Fusion 8.5.6 at 1920x1200 * This may be a problem with the combination of kernel version (4.4.0-77 in my case) and virtualHW.version (see re...
788,161
I can set the screen resolution manually once I log in using the following command: ``` xrandr -s 1360x768 ``` but I am not able to make it "stick". Every time I log back in, the resolution for a little while changes to 1360x768, but by the time the desktop appears, switches back to 800x600. I have also tried other...
2016/06/17
[ "https://askubuntu.com/questions/788161", "https://askubuntu.com", "https://askubuntu.com/users/242805/" ]
I had the same problem, annoying but finally fixed using a variation of the first suggested answer above. I'm running Ubuntu 16.04.3 on Fusion 8.5.8 with HW version 12. Within Fusion display settings: 1. "Use full resolution for Retina Display" should be checked 2. "Use Fusion Display Preferences" set for both "Si...
Edit your VMX to include: ``` vga.guestBackedPrimaryAware = "FALSE" svga.minVRAMSize = "16777216" ``` notes: * Tested with Xubuntu 16.04 with kernel version 4.4.0-77 in VMWare Fusion 8.5.6 at 1920x1200 * This may be a problem with the combination of kernel version (4.4.0-77 in my case) and virtualHW.version (see re...
788,161
I can set the screen resolution manually once I log in using the following command: ``` xrandr -s 1360x768 ``` but I am not able to make it "stick". Every time I log back in, the resolution for a little while changes to 1360x768, but by the time the desktop appears, switches back to 800x600. I have also tried other...
2016/06/17
[ "https://askubuntu.com/questions/788161", "https://askubuntu.com", "https://askubuntu.com/users/242805/" ]
If you are using Ubuntu on VMWare Workstation, you need to install **`VMWare tools`** to get proper resolution. Here is the step by step procedure to do that : * Start your Virtual machine and login to your Ubuntu. * Go to **VM** --> **Install VMWare Tools...** [![enter image description here](https://i.stack.imgur....
Changing the resolution requires the VMWare Tools, or the open source equivalents. I've found the Open Source versions to work a little better than the compile-them versions that ship with VMWare Workstation. Install the Open VM Tools, with the following commands. Note that if you've installed the VMware Tools already...
788,161
I can set the screen resolution manually once I log in using the following command: ``` xrandr -s 1360x768 ``` but I am not able to make it "stick". Every time I log back in, the resolution for a little while changes to 1360x768, but by the time the desktop appears, switches back to 800x600. I have also tried other...
2016/06/17
[ "https://askubuntu.com/questions/788161", "https://askubuntu.com", "https://askubuntu.com/users/242805/" ]
Changing the resolution requires the VMWare Tools, or the open source equivalents. I've found the Open Source versions to work a little better than the compile-them versions that ship with VMWare Workstation. Install the Open VM Tools, with the following commands. Note that if you've installed the VMware Tools already...
I had the same problem, annoying but finally fixed using a variation of the first suggested answer above. I'm running Ubuntu 16.04.3 on Fusion 8.5.8 with HW version 12. Within Fusion display settings: 1. "Use full resolution for Retina Display" should be checked 2. "Use Fusion Display Preferences" set for both "Si...
788,161
I can set the screen resolution manually once I log in using the following command: ``` xrandr -s 1360x768 ``` but I am not able to make it "stick". Every time I log back in, the resolution for a little while changes to 1360x768, but by the time the desktop appears, switches back to 800x600. I have also tried other...
2016/06/17
[ "https://askubuntu.com/questions/788161", "https://askubuntu.com", "https://askubuntu.com/users/242805/" ]
If you are using Ubuntu on VMWare Workstation, you need to install **`VMWare tools`** to get proper resolution. Here is the step by step procedure to do that : * Start your Virtual machine and login to your Ubuntu. * Go to **VM** --> **Install VMWare Tools...** [![enter image description here](https://i.stack.imgur....
Like you, I can't find any way to get it to run on startup, but I did find a way to get it to run on login which was "good enough" for me. I added this to my `~/.profile`: ``` xrandr --newmode "1600x900_60.00" 118.25 1600 1696 1856 2112 900 903 908 934 -hsync +vsync xrandr --addmode Virtual1 1600x900_60.00 xrandr -s 1...
788,161
I can set the screen resolution manually once I log in using the following command: ``` xrandr -s 1360x768 ``` but I am not able to make it "stick". Every time I log back in, the resolution for a little while changes to 1360x768, but by the time the desktop appears, switches back to 800x600. I have also tried other...
2016/06/17
[ "https://askubuntu.com/questions/788161", "https://askubuntu.com", "https://askubuntu.com/users/242805/" ]
Changing the resolution requires the VMWare Tools, or the open source equivalents. I've found the Open Source versions to work a little better than the compile-them versions that ship with VMWare Workstation. Install the Open VM Tools, with the following commands. Note that if you've installed the VMware Tools already...
Like you, I can't find any way to get it to run on startup, but I did find a way to get it to run on login which was "good enough" for me. I added this to my `~/.profile`: ``` xrandr --newmode "1600x900_60.00" 118.25 1600 1696 1856 2112 900 903 908 934 -hsync +vsync xrandr --addmode Virtual1 1600x900_60.00 xrandr -s 1...
788,161
I can set the screen resolution manually once I log in using the following command: ``` xrandr -s 1360x768 ``` but I am not able to make it "stick". Every time I log back in, the resolution for a little while changes to 1360x768, but by the time the desktop appears, switches back to 800x600. I have also tried other...
2016/06/17
[ "https://askubuntu.com/questions/788161", "https://askubuntu.com", "https://askubuntu.com/users/242805/" ]
If you are using Ubuntu on VMWare Workstation, you need to install **`VMWare tools`** to get proper resolution. Here is the step by step procedure to do that : * Start your Virtual machine and login to your Ubuntu. * Go to **VM** --> **Install VMWare Tools...** [![enter image description here](https://i.stack.imgur....
I had the same problem, annoying but finally fixed using a variation of the first suggested answer above. I'm running Ubuntu 16.04.3 on Fusion 8.5.8 with HW version 12. Within Fusion display settings: 1. "Use full resolution for Retina Display" should be checked 2. "Use Fusion Display Preferences" set for both "Si...
788,161
I can set the screen resolution manually once I log in using the following command: ``` xrandr -s 1360x768 ``` but I am not able to make it "stick". Every time I log back in, the resolution for a little while changes to 1360x768, but by the time the desktop appears, switches back to 800x600. I have also tried other...
2016/06/17
[ "https://askubuntu.com/questions/788161", "https://askubuntu.com", "https://askubuntu.com/users/242805/" ]
I wrote here before, a clean install of ubuntu has no problem with resolution. But after that I found the solution while I was looking for an answer for another problem. Follow the steps below and everything will be fixed. If you have the latest VMware Tools and open-vm-tools is not install, the skip to step 3. 1) `...
I had the same problem, annoying but finally fixed using a variation of the first suggested answer above. I'm running Ubuntu 16.04.3 on Fusion 8.5.8 with HW version 12. Within Fusion display settings: 1. "Use full resolution for Retina Display" should be checked 2. "Use Fusion Display Preferences" set for both "Si...
788,161
I can set the screen resolution manually once I log in using the following command: ``` xrandr -s 1360x768 ``` but I am not able to make it "stick". Every time I log back in, the resolution for a little while changes to 1360x768, but by the time the desktop appears, switches back to 800x600. I have also tried other...
2016/06/17
[ "https://askubuntu.com/questions/788161", "https://askubuntu.com", "https://askubuntu.com/users/242805/" ]
Like you, I can't find any way to get it to run on startup, but I did find a way to get it to run on login which was "good enough" for me. I added this to my `~/.profile`: ``` xrandr --newmode "1600x900_60.00" 118.25 1600 1696 1856 2112 900 903 908 934 -hsync +vsync xrandr --addmode Virtual1 1600x900_60.00 xrandr -s 1...
Edit your VMX to include: ``` vga.guestBackedPrimaryAware = "FALSE" svga.minVRAMSize = "16777216" ``` notes: * Tested with Xubuntu 16.04 with kernel version 4.4.0-77 in VMWare Fusion 8.5.6 at 1920x1200 * This may be a problem with the combination of kernel version (4.4.0-77 in my case) and virtualHW.version (see re...
788,161
I can set the screen resolution manually once I log in using the following command: ``` xrandr -s 1360x768 ``` but I am not able to make it "stick". Every time I log back in, the resolution for a little while changes to 1360x768, but by the time the desktop appears, switches back to 800x600. I have also tried other...
2016/06/17
[ "https://askubuntu.com/questions/788161", "https://askubuntu.com", "https://askubuntu.com/users/242805/" ]
I wrote here before, a clean install of ubuntu has no problem with resolution. But after that I found the solution while I was looking for an answer for another problem. Follow the steps below and everything will be fixed. If you have the latest VMware Tools and open-vm-tools is not install, the skip to step 3. 1) `...
Edit your VMX to include: ``` vga.guestBackedPrimaryAware = "FALSE" svga.minVRAMSize = "16777216" ``` notes: * Tested with Xubuntu 16.04 with kernel version 4.4.0-77 in VMWare Fusion 8.5.6 at 1920x1200 * This may be a problem with the combination of kernel version (4.4.0-77 in my case) and virtualHW.version (see re...
13,276,155
I have almost the same issue as where described [here](https://stackoverflow.com/questions/10536170/equalizer-not-always-supported-even-when-api-9), answer in this post doesn't help me, I release my equalizer immediately after setting band levels to it. It works perfect on my 4.0.4 device, it works great on friend's 2....
2012/11/07
[ "https://Stackoverflow.com/questions/13276155", "https://Stackoverflow.com", "https://Stackoverflow.com/users/552246/" ]
Make sure that you reboot the device and test it again with the release() after using the equalizer, it worked for me after 2 days of searching for clues.
This depends on the build of Android that is loaded on the device. This log means that there is no library to implements the AudioEffect feature. I m afraid there is no solution for this, rather then importing into your project some third party audio effect library
13,276,155
I have almost the same issue as where described [here](https://stackoverflow.com/questions/10536170/equalizer-not-always-supported-even-when-api-9), answer in this post doesn't help me, I release my equalizer immediately after setting band levels to it. It works perfect on my 4.0.4 device, it works great on friend's 2....
2012/11/07
[ "https://Stackoverflow.com/questions/13276155", "https://Stackoverflow.com", "https://Stackoverflow.com/users/552246/" ]
From the documentation, you have to call release() on an Equalizer, MediaPlayer, Visualizer, etc for a graceful exit, or you will see this error when restarting the app. The only remedy then is to reboot, as previously mentioned in this thread. This is where the Android application lifecycle makes things a little diff...
This depends on the build of Android that is loaded on the device. This log means that there is no library to implements the AudioEffect feature. I m afraid there is no solution for this, rather then importing into your project some third party audio effect library
13,276,155
I have almost the same issue as where described [here](https://stackoverflow.com/questions/10536170/equalizer-not-always-supported-even-when-api-9), answer in this post doesn't help me, I release my equalizer immediately after setting band levels to it. It works perfect on my 4.0.4 device, it works great on friend's 2....
2012/11/07
[ "https://Stackoverflow.com/questions/13276155", "https://Stackoverflow.com", "https://Stackoverflow.com/users/552246/" ]
Make sure that you reboot the device and test it again with the release() after using the equalizer, it worked for me after 2 days of searching for clues.
From the documentation, you have to call release() on an Equalizer, MediaPlayer, Visualizer, etc for a graceful exit, or you will see this error when restarting the app. The only remedy then is to reboot, as previously mentioned in this thread. This is where the Android application lifecycle makes things a little diff...
45,595,323
This is the `Cluster` table: ``` ╭────╥────────────┬─────────────╮ │ id ║ name │ prefix │ ╞════╬════════════╪═════════════╡ │ 1 ║ Yard work │ YA │ │ 2 ║ Construc.. │ CR │ └────╨────────────┴─────────────┘ ``` Both `name` and `prefix` have uniqueness and non-null constraints. Now we g...
2017/08/09
[ "https://Stackoverflow.com/questions/45595323", "https://Stackoverflow.com", "https://Stackoverflow.com/users/354531/" ]
If performance is not an issue at all, then I suggest you following solution: Schema: ```sql create table cluster ( id bigint primary key, name text not null unique, prefix text not null unique ); create table material ( id text primary key, cluster_id bigint not null references cluster...
* this is a terrible design; you should **not** compose (candidate)keys from (concatenations of) expressions, and **certainly not** from aggregates. * since your composed identifier is functionally dependent on the actual keys, it can be constructed on the fly (in this case: based on a window-function) * using some par...
8,379,555
I am trying to limit the swipe area of the UIScrollview, but i amnot able to do that. I would like to set the swipe area only to the top of the UIScrollview, but i would like to set all the content visible. Update: ``` - (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { if ([touches count] > 0) {...
2011/12/04
[ "https://Stackoverflow.com/questions/8379555", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1077114/" ]
You can disable scrolling on the `UIScrollView`, override `touchesBegan:withEvent:` in your view controller, check if any of the touches began in the area where you'd like to enable swipes, and if the answer is 'yes', re-enable scrolling. Also override `touchesEnded:withEvent:` and `touchesCancelled:withEvent:` to disa...
[This blog post](http://www.lukaszielinski.de/blog/posts/2014/03/26/restrict-panning-of-uipageviewcontroller-to-certain-area/) showcases a very simple and clean way of implementing the functionality. ``` // init or viewDidLoad UIScrollView *scrollView = (UIScrollView *)view; _scrollViewPanGestureRecognzier = [[UI...
8,379,555
I am trying to limit the swipe area of the UIScrollview, but i amnot able to do that. I would like to set the swipe area only to the top of the UIScrollview, but i would like to set all the content visible. Update: ``` - (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { if ([touches count] > 0) {...
2011/12/04
[ "https://Stackoverflow.com/questions/8379555", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1077114/" ]
You can disable scrolling on the `UIScrollView`, override `touchesBegan:withEvent:` in your view controller, check if any of the touches began in the area where you'd like to enable swipes, and if the answer is 'yes', re-enable scrolling. Also override `touchesEnded:withEvent:` and `touchesCancelled:withEvent:` to disa...
Other answers didn't work for me. Subclassing `UIScrollView` worked for me (Swift 3): ``` class ScrollViewWithLimitedPan : UIScrollView { // MARK: - UIPanGestureRecognizer Delegate Method Override - override func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool { let locat...
8,379,555
I am trying to limit the swipe area of the UIScrollview, but i amnot able to do that. I would like to set the swipe area only to the top of the UIScrollview, but i would like to set all the content visible. Update: ``` - (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { if ([touches count] > 0) {...
2011/12/04
[ "https://Stackoverflow.com/questions/8379555", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1077114/" ]
Other answers didn't work for me. Subclassing `UIScrollView` worked for me (Swift 3): ``` class ScrollViewWithLimitedPan : UIScrollView { // MARK: - UIPanGestureRecognizer Delegate Method Override - override func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool { let locat...
[This blog post](http://www.lukaszielinski.de/blog/posts/2014/03/26/restrict-panning-of-uipageviewcontroller-to-certain-area/) showcases a very simple and clean way of implementing the functionality. ``` // init or viewDidLoad UIScrollView *scrollView = (UIScrollView *)view; _scrollViewPanGestureRecognzier = [[UI...
79,239
[Calmette](https://en.wikipedia.org/wiki/Albert_Calmette) tried injecting horses with snake venom and then taking out the serum which has produced antibodies against the venom and injecting in the snake-bitten human. Shouldn't our immune system recognize this exogenous protein and try to eliminate it as it's a non-se...
2018/11/23
[ "https://biology.stackexchange.com/questions/79239", "https://biology.stackexchange.com", "https://biology.stackexchange.com/users/42917/" ]
Our immune system does react to horse antibodies, but as with any adaptive immune response it takes some time for the response to develop. In the weeks before our immune response fully responds to the horse antibodies, the infused antibodies can have their effect. If you then have a *second* infusion of horse antibodi...
Human/mammalian immune system do not react to everything foreign that enters the body. This foreign substances are called "antigens". Instead, the host [i.e. body] reacts to "immunogens" - these are antigens, that CAN elicit immune reaction. Microbes are immunogens, for instance. They don't only consist of microbe prot...
21,003
With a few colleagues, we're trying to design an (intermediate) algebra course (US terminology) where we stress the interplay between algebra and geometry. The algebraic topics we would like to cover are (1) linear equation in two variables, (2) quadratic equations in two variables, (3) polynomials in one variable, (4)...
2011/02/08
[ "https://math.stackexchange.com/questions/21003", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
Bart, as linear equations related to lines, some rational functions are related to orbifolds. You can also explain the solutions of r(z)=c where c is given. It might be very instructive to see the solution set of r(z)=c as c changes continuously on the sphere, or more generally, r(z)=L or C where L is an arbitrary line...
For 5, for square roots, it seems almost too obvious to use the hypotenuse of right triangles. For higher roots, diagonals on cubes of higher dimensions? For 3, a quadratic in one variable is also a conic section. For higher degrees...so this is for high school right? ...yeah this one isn't obvious.
21,003
With a few colleagues, we're trying to design an (intermediate) algebra course (US terminology) where we stress the interplay between algebra and geometry. The algebraic topics we would like to cover are (1) linear equation in two variables, (2) quadratic equations in two variables, (3) polynomials in one variable, (4)...
2011/02/08
[ "https://math.stackexchange.com/questions/21003", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
This seems rather ambitious for most U.S. college intermediate algebra courses, which typically are not-for-credit remedial courses that lie below the level of college algebra and precalculus courses. Nonetheless, here are some things I've used in precalculus courses that might of use. To see what the graph of somethi...
For 5, for square roots, it seems almost too obvious to use the hypotenuse of right triangles. For higher roots, diagonals on cubes of higher dimensions? For 3, a quadratic in one variable is also a conic section. For higher degrees...so this is for high school right? ...yeah this one isn't obvious.
21,003
With a few colleagues, we're trying to design an (intermediate) algebra course (US terminology) where we stress the interplay between algebra and geometry. The algebraic topics we would like to cover are (1) linear equation in two variables, (2) quadratic equations in two variables, (3) polynomials in one variable, (4)...
2011/02/08
[ "https://math.stackexchange.com/questions/21003", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
This seems rather ambitious for most U.S. college intermediate algebra courses, which typically are not-for-credit remedial courses that lie below the level of college algebra and precalculus courses. Nonetheless, here are some things I've used in precalculus courses that might of use. To see what the graph of somethi...
Bart, as linear equations related to lines, some rational functions are related to orbifolds. You can also explain the solutions of r(z)=c where c is given. It might be very instructive to see the solution set of r(z)=c as c changes continuously on the sphere, or more generally, r(z)=L or C where L is an arbitrary line...
34,489,986
this is my code ``` void SMatrix::pow(int power, SMatrix & result) { if (this->rowSize != this->colSize || this->rowSize != result.rowSize || this->colSize != result.colSize || power <= 0) { delete & result; result = new SMatrix (result.rowSize, result.colSize); } } ```...
2015/12/28
[ "https://Stackoverflow.com/questions/34489986", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5699256/" ]
This code is just "doing it wrong". If you have a reference argument, then the implied effect is that the ownership of any pointer to it belongs to the caller. ``` void SMatrix::pow(int power, SMatrix & result) { if (this->rowSize != this->colSize || this->rowSize != result.rowSize || this->colSize != resul...
``` delete & result; result = new SMatrix (result.rowSize, result.colSize); ``` You can't `delete` an object and then call `operator=` on it. You're doing the equivalent of this: ``` std::string* j = new std::string ("hello"); delete j; *j = "goodbye"; // Oops, there's no string whose value we can se...
40,876,192
I have a directory with script files, say: ``` scripts/ foo.sh script1.sh test.sh ... etc ``` and would like to execute each script like: ``` $ ./scripts/foo.sh start $ ./scripts/script1.sh start etc ``` without needing to know all the script filenames. Is there a way to append `start...
2016/11/29
[ "https://Stackoverflow.com/questions/40876192", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1183537/" ]
Use a simple loop: ``` for script in scripts/*.sh; do "$script" start done ``` There's just one caveat: if there are no such `*.sh` files, you will get an error. A simple workaround for that is to check if `$script` is actually a file (and executable): ``` for script in scripts/*.sh; do [ -x "$script" ] && ...
Zsh has some shorthand loops that bash doesn't: ``` for f (scripts/*.sh) "$f" start ```
2,820
In Naruto, when the medical team starts to heal wounds, they use their chakra. Does this only heal and restore chakra, or does it also help regenerate the skin cut by kunais?
2013/03/06
[ "https://anime.stackexchange.com/questions/2820", "https://anime.stackexchange.com", "https://anime.stackexchange.com/users/8/" ]
Medical ninjutsu can be used to heal wounds, such as those cause by kunai. It is used for a number of purposes, including: * Healing: [Healing Chakra Transmission](http://naruto.wikia.com/wiki/Healing_Chakra_Transmission), [Healing Resuscitation Regeneration Technique](http://naruto.wikia.com/wiki/Healing_Resuscitatio...
**How does the healing jutsu work?** It works by channeling the healer's chakra into the patient's body, in order to help the regeneration of skin, cells, chakra flow, etc. The medical-nin can also use medical ninjutsu in himself. This type of technique requires great chakra control, because excessive infusion of chak...
25,008,029
Googlebot can't fetch my joomla site after I migrate to another Hosting .. And when I checked with <http://web-sniffer.net/> (with option: Trace., and user-agent: googlebot) the result is 403. ``` <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>403 Forbidden</title> </head><body> <h1>Forbidden...
2014/07/29
[ "https://Stackoverflow.com/questions/25008029", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3886309/" ]
There are two things happening here. One is member hiding. This is fairly well-known and covered [elsewhere](https://stackoverflow.com/questions/3838553/overriding-vs-method-hiding). The other, less-known feature is interface re-implementation covered in section 13.4.6 of the C# 5 specification. To quote: > > A class...
Interfaces by definition have no associated implementation, which is to say their methods are always virtual and abstract. In contrast, the class `Bar` above defines a concrete implementation for `GetName`. This satisfies the contract required to implement `IFoo`. Class `Baz` now inherits from `Bar` and declares a `ne...
25,008,029
Googlebot can't fetch my joomla site after I migrate to another Hosting .. And when I checked with <http://web-sniffer.net/> (with option: Trace., and user-agent: googlebot) the result is 403. ``` <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>403 Forbidden</title> </head><body> <h1>Forbidden...
2014/07/29
[ "https://Stackoverflow.com/questions/25008029", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3886309/" ]
There are two things happening here. One is member hiding. This is fairly well-known and covered [elsewhere](https://stackoverflow.com/questions/3838553/overriding-vs-method-hiding). The other, less-known feature is interface re-implementation covered in section 13.4.6 of the C# 5 specification. To quote: > > A class...
The output is Bar-Bar-Quux as a result of 3 calls to GetName() in your Console.WriteLine method call. ``` Bar f1 = new Baz(); IFoo f2 = new Baz(); IFoo f3 = new Quux(); Console.WriteLine(f1.GetName() + "-" + f2.GetName() + "-" + f3.GetName()); //Bar-Bar-Quux ``` Let's examine each call so it can be made more clear w...
25,008,029
Googlebot can't fetch my joomla site after I migrate to another Hosting .. And when I checked with <http://web-sniffer.net/> (with option: Trace., and user-agent: googlebot) the result is 403. ``` <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>403 Forbidden</title> </head><body> <h1>Forbidden...
2014/07/29
[ "https://Stackoverflow.com/questions/25008029", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3886309/" ]
Interfaces by definition have no associated implementation, which is to say their methods are always virtual and abstract. In contrast, the class `Bar` above defines a concrete implementation for `GetName`. This satisfies the contract required to implement `IFoo`. Class `Baz` now inherits from `Bar` and declares a `ne...
The output is Bar-Bar-Quux as a result of 3 calls to GetName() in your Console.WriteLine method call. ``` Bar f1 = new Baz(); IFoo f2 = new Baz(); IFoo f3 = new Quux(); Console.WriteLine(f1.GetName() + "-" + f2.GetName() + "-" + f3.GetName()); //Bar-Bar-Quux ``` Let's examine each call so it can be made more clear w...
51,739,653
So this is for a HW problem. It is a guessing game for numbers between 1 and 10. I had to create two exception classes: 1. to handle guesses 2. if the user exceeds 5 guesses There is also a third requirement for if the user enters an incorrect format (however that did not require me to make an additional exception cla...
2018/08/08
[ "https://Stackoverflow.com/questions/51739653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
**Use Input & Output Decorators** Basic concept ---> [DEMO](https://stackblitz.com/edit/angular-harudq) **app.component.html:** ``` <app-component1 (elm)="catch1Data($event)"> </app-component1> <app-component2 [elm]="datatocomp2" *ngIf="datatocomp2"></app-component2> parent component : {{datatocomp2 | json}} ``` ...
Use a shared service to share data between components, event emitter method isn't the best way for components in routing Simple example , create a datashare service **//DataShare Service** ``` import { ReplaySubject } from 'rxjs/Rx'; export class DatashareService { private dataObs$ = new ReplaySubject<any>(1)...
2,694,269
$$2^x = 3$$ $$5^y = 2$$ $$3^z = 125$$ Find the result of $xyz$ To get $xyz$, I've tried to multiply all together. $$2^x . 5^y . 3^z = 750$$ Unfortunalety, I've gone too wrong as in my perspective. Can you assist? I'd like to get your professional tips. **EDIT:** I'm trying to solve this question by using exponen...
2018/03/16
[ "https://math.stackexchange.com/questions/2694269", "https://math.stackexchange.com", "https://math.stackexchange.com/users/493389/" ]
Solve for each $x=\log\_2(3)$, $y=\log\_5(2)$ and $z=\log\_3(125)$. The product would be $xyz=\log\_2(3)\log\_5(2)\log\_3(125)$. Very likely they will examine also the possibility of some simplification. --- For the new requirement: Raise the first equation to $z$. You get $2^{xz}=3^z=125=5^3=2^{3/y}$. Raise agai...
taking the logarithm we get $$x=\frac{\ln(3)}{\ln(2)}$$ $$y=\frac{\ln(2)}{\ln(5)}$$ $$z=\frac{\ln(125)}{\ln(3)}$$ Can you proceed?
2,694,269
$$2^x = 3$$ $$5^y = 2$$ $$3^z = 125$$ Find the result of $xyz$ To get $xyz$, I've tried to multiply all together. $$2^x . 5^y . 3^z = 750$$ Unfortunalety, I've gone too wrong as in my perspective. Can you assist? I'd like to get your professional tips. **EDIT:** I'm trying to solve this question by using exponen...
2018/03/16
[ "https://math.stackexchange.com/questions/2694269", "https://math.stackexchange.com", "https://math.stackexchange.com/users/493389/" ]
$$5^{xyz}=(5^y)^{xz}=2^{xz}=(2^x)^z=3^z=125$$
Solve for each $x=\log\_2(3)$, $y=\log\_5(2)$ and $z=\log\_3(125)$. The product would be $xyz=\log\_2(3)\log\_5(2)\log\_3(125)$. Very likely they will examine also the possibility of some simplification. --- For the new requirement: Raise the first equation to $z$. You get $2^{xz}=3^z=125=5^3=2^{3/y}$. Raise agai...
2,694,269
$$2^x = 3$$ $$5^y = 2$$ $$3^z = 125$$ Find the result of $xyz$ To get $xyz$, I've tried to multiply all together. $$2^x . 5^y . 3^z = 750$$ Unfortunalety, I've gone too wrong as in my perspective. Can you assist? I'd like to get your professional tips. **EDIT:** I'm trying to solve this question by using exponen...
2018/03/16
[ "https://math.stackexchange.com/questions/2694269", "https://math.stackexchange.com", "https://math.stackexchange.com/users/493389/" ]
$$5^{xyz}=(5^y)^{xz}=2^{xz}=(2^x)^z=3^z=125$$
taking the logarithm we get $$x=\frac{\ln(3)}{\ln(2)}$$ $$y=\frac{\ln(2)}{\ln(5)}$$ $$z=\frac{\ln(125)}{\ln(3)}$$ Can you proceed?
58,473,505
``` df = pd.read_csv( 'https://media-doselect.s3.amazonaws.com/generic/MJjpYqLzv08xAkjqLp1ga1Aq/Historical_Data.csv') df.head() Date Article_ID Country_Code Sold_Units 0 20170817 1132 AT 1 1 20170818 1132 AT 1 2 20170821 1132 A...
2019/10/20
[ "https://Stackoverflow.com/questions/58473505", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11801923/" ]
You can use [`DataFrame.asfreq`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.asfreq.html) to reindex after deleting duplicates and then adding duplicate data and sorting: ``` df['Date'] = pd.to_datetime(df['Date'].astype(str), format='%Y-%m-%d') df2=df[df.duplicated('Date')].set_index(...
You can use: ``` df['Date'] = pd.to_datetime(df['Date'].astype(str), format='%Y-%m-%d',errors='coerce') ``` You don't miss your missing date, but it is represented by NaT. You've got something like this ``` Date Article_ID Outlet_Code Sold_Units 0 2017-08-17 1132 AT 1 1 2017-08...
65,433,445
I am new here I have this code ``` <div class="like-buttons"> <div class="liked"></div><button class="dislike like"><span class="countl">12</span></button> </div> ``` <https://codepen.io/Void0000/pen/oNzGmGr> and I need to make (with jQuery) some function, that when I will click on my button, it will be count ...
2020/12/24
[ "https://Stackoverflow.com/questions/65433445", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14879896/" ]
Set event listeners on the classes, by jQuery. Like - ``` $('.like').onclick(function(){ let like = $(this). closest('.countd').html(); like = like + 1; }); ``` Do same for dislike button.
I am sorry, i wrote that i have two buttnos, it mistake, a have only 1 button, so i need this fucntion only for one button. So i clack once on button +1, i click once again on this button -1, etc< only 1 button!
65,433,445
I am new here I have this code ``` <div class="like-buttons"> <div class="liked"></div><button class="dislike like"><span class="countl">12</span></button> </div> ``` <https://codepen.io/Void0000/pen/oNzGmGr> and I need to make (with jQuery) some function, that when I will click on my button, it will be count ...
2020/12/24
[ "https://Stackoverflow.com/questions/65433445", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14879896/" ]
According to @Shivam 's answer you can change like this; ``` $('.like').onclick(function(){ let like = $(this).closest('.countd').html(); if($(this).hasClass("clicked")){ $(this).removeClass("clicked"); like++; } else{ $(this).addClass("clicked"); like--; } ...
Set event listeners on the classes, by jQuery. Like - ``` $('.like').onclick(function(){ let like = $(this). closest('.countd').html(); like = like + 1; }); ``` Do same for dislike button.
65,433,445
I am new here I have this code ``` <div class="like-buttons"> <div class="liked"></div><button class="dislike like"><span class="countl">12</span></button> </div> ``` <https://codepen.io/Void0000/pen/oNzGmGr> and I need to make (with jQuery) some function, that when I will click on my button, it will be count ...
2020/12/24
[ "https://Stackoverflow.com/questions/65433445", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14879896/" ]
Set event listeners on the classes, by jQuery. Like - ``` $('.like').onclick(function(){ let like = $(this). closest('.countd').html(); like = like + 1; }); ``` Do same for dislike button.
Unfortunetly, its all not working = (
65,433,445
I am new here I have this code ``` <div class="like-buttons"> <div class="liked"></div><button class="dislike like"><span class="countl">12</span></button> </div> ``` <https://codepen.io/Void0000/pen/oNzGmGr> and I need to make (with jQuery) some function, that when I will click on my button, it will be count ...
2020/12/24
[ "https://Stackoverflow.com/questions/65433445", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14879896/" ]
According to @Shivam 's answer you can change like this; ``` $('.like').onclick(function(){ let like = $(this).closest('.countd').html(); if($(this).hasClass("clicked")){ $(this).removeClass("clicked"); like++; } else{ $(this).addClass("clicked"); like--; } ...
I am sorry, i wrote that i have two buttnos, it mistake, a have only 1 button, so i need this fucntion only for one button. So i clack once on button +1, i click once again on this button -1, etc< only 1 button!
65,433,445
I am new here I have this code ``` <div class="like-buttons"> <div class="liked"></div><button class="dislike like"><span class="countl">12</span></button> </div> ``` <https://codepen.io/Void0000/pen/oNzGmGr> and I need to make (with jQuery) some function, that when I will click on my button, it will be count ...
2020/12/24
[ "https://Stackoverflow.com/questions/65433445", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14879896/" ]
According to @Shivam 's answer you can change like this; ``` $('.like').onclick(function(){ let like = $(this).closest('.countd').html(); if($(this).hasClass("clicked")){ $(this).removeClass("clicked"); like++; } else{ $(this).addClass("clicked"); like--; } ...
Unfortunetly, its all not working = (
9,531,660
In Steve McConnell's "Code Complete", he describes testing an encryption program: > > I set up a test-data generator that fully exercised the encryption and > decryption parts of the program. It generated files of random > characters in random sizes. [...] For each random case, it generated > two copies of the ran...
2012/03/02
[ "https://Stackoverflow.com/questions/9531660", "https://Stackoverflow.com", "https://Stackoverflow.com/users/200783/" ]
It is definitely **not a unit test**, since it is * not testing the smallest possible unit, which would be a single method of the core encryption unit * uses a lot of other functions as file access and memory management, instead of mocking them * is too slow for a unit test. Since the test is not going through the GU...
I'd call it a functional test or a system test (although only a partial one -- there needs to be another test that fixed, known test vectors produce the correct known output). In principle, a unit test should execute no code from the project whatsoever, other than the unit under test. And *possibly* some other units t...
410,550
`ls` returns output in several columns, whereas `ls|cat` returns byte-identical output with `ls -1` for directories I've tried. Still I see `ls -1` piped in answers, like `ls -1|wc -l`. Is there ever a reason to prefer `ls -1`? Why does `...|cat` change the output of `ls`?
2017/12/13
[ "https://unix.stackexchange.com/questions/410550", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/263916/" ]
`ls` tests whether output is going to a terminal. If the output isn't going to a terminal, then `-1` is the default. (This can be overridden by one of the `-C`, `-m`, or `-x` options.) Thus, when `ls` is used in a pipeline and you haven't overridden it with another option, `ls` will use `-1`. *You can rely on this bec...
When piping ls, ls cannot determine how much columns the console actually has (independant of the right-side command). So ls just does that on its own choice, or, in other words, this behaviour is **unstable** and may change in future versions. In contrast, `ls -1` was created for the purpose of counting or scripting ...
410,550
`ls` returns output in several columns, whereas `ls|cat` returns byte-identical output with `ls -1` for directories I've tried. Still I see `ls -1` piped in answers, like `ls -1|wc -l`. Is there ever a reason to prefer `ls -1`? Why does `...|cat` change the output of `ls`?
2017/12/13
[ "https://unix.stackexchange.com/questions/410550", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/263916/" ]
* Why does piping the standard output change the behavior of `ls`?  Because it was designed that way.  The [POSIX Specification](http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ls.html) says: > > The default format shall be to list one entry per line to standard output; > the exceptions are to terminals > ...
When piping ls, ls cannot determine how much columns the console actually has (independant of the right-side command). So ls just does that on its own choice, or, in other words, this behaviour is **unstable** and may change in future versions. In contrast, `ls -1` was created for the purpose of counting or scripting ...
410,550
`ls` returns output in several columns, whereas `ls|cat` returns byte-identical output with `ls -1` for directories I've tried. Still I see `ls -1` piped in answers, like `ls -1|wc -l`. Is there ever a reason to prefer `ls -1`? Why does `...|cat` change the output of `ls`?
2017/12/13
[ "https://unix.stackexchange.com/questions/410550", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/263916/" ]
`ls` tests whether output is going to a terminal. If the output isn't going to a terminal, then `-1` is the default. (This can be overridden by one of the `-C`, `-m`, or `-x` options.) Thus, when `ls` is used in a pipeline and you haven't overridden it with another option, `ls` will use `-1`. *You can rely on this bec...
* Why does piping the standard output change the behavior of `ls`?  Because it was designed that way.  The [POSIX Specification](http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ls.html) says: > > The default format shall be to list one entry per line to standard output; > the exceptions are to terminals > ...
26,627,096
I'm trying to create a text-based adventure game. I'm thinking I want the map to be represented by different nodes where each node corresponds to a distinct location and has node pointer variables (left, forward, and right) that should point to another node in the respective direction. I tried to implement it as a link...
2014/10/29
[ "https://Stackoverflow.com/questions/26627096", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2280464/" ]
A linked datastructure would do a good job of doing what you want: example: ``` class location { std::string loc_name; std::vector<std::pair<std::string,location*>> connections; std::string description; public: bool add_link(location* loc, std::string dicription_to, std::string dicription_from); /...
You could implement a custom linked datastructure with linked positions on the map like this: ``` struct Map_Node{ Map_Node *left; Map_Node *right; Map_Node *forward; /* other needed field*/ }; ``` Then, you need to do the memory management on your own. For example by using smart pointers. ``` std::...
35,728,722
I'm writting some code that uses a serialized file. The file is called **alcala.ser** and is in **utils**, a subfolder of **java**. The class calling the file is in the same folder. Here's the code: ``` InputStream file = new FileInputStream("/alcala.ser"); ``` I also tried: ``` InputStream file = new FileInputStre...
2016/03/01
[ "https://Stackoverflow.com/questions/35728722", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5120619/" ]
> > The file is called alcala.ser and is in utils, a subfolder of java. > > > Move the file out of there and into `assets/`. Then, use `AssetManager` to `open()` an `InputStream` on the asset.
Check External and Internal Storage option in <http://developer.android.com/guide/topics/data/data-storage.html>. Depending on how do you want to handle privacy you have to chose one or the other.
42,454
I have an integrated ION GPU, which is supported by the proprietary drivers and I've never been able to get the open source drivers to work. I would like my left screen to be normal, but the right hand screen to be rotated. How do I achieve this?
2012/07/06
[ "https://unix.stackexchange.com/questions/42454", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/19208/" ]
It took me a while to work this out, so I wanted to share it with others.I will assume that the nvidia drivers and `nvidia-settings` are installed. (On Arch, run `sudo pacman -S nvidia nvidia-utils`.) First, we need to generate a `xorg.conf` using `nvidia-settings`. From a GUI terminal, run `sudo nvidia-settings`. 1....
It seems the most recent version of the closed source NVIDIA drivers supports randr (see <http://www.phoronix.com/scan.php?page=news_item&px=MTA5NTY>). Just use the most recent driver and a RandR front-end of your choice. For example arandr will allow you to move monitors around and alter their orientation.
54,051,703
I have a created a simple Azure Logic App that sends a file via FTP to a customer. I have tested the Logic App and it works to my VM. I have an issue however that my customer whitelists IP addresses that FTP to them and Azure will only supply you with regional IP addresses meaning anyone who uses Logic App in my region...
2019/01/05
[ "https://Stackoverflow.com/questions/54051703", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10871330/" ]
You get `full_name` with these structs ( I specified only the relevant keys) ``` struct Root: Decodable { let graphql : Graphql } struct Graphql: Decodable { let user : User } struct User: Decodable { let fullName : String } ``` and decode the data ``` let data = Data(jsonData.utf8) do { let decod...
There are many ways of doing this First-Method: ``` do { let responseData = Data(data.utf8) let decodeData = try JSONDecoder().decode(Controller.self, from: responseData) if (decodeData.ErrorCode! == "0") { //Success } else { //Failure } } catch let jsonErr { //Failure } ``` ...
123,447
How do we get the url to thumbnail image of of a product through rest API. `/V1/products/{sku}/media` would get us the relative url such as `"/m/b/mb01-blue-0.jpg"` and the image url would be `baseurl/catalog/product/m/b/mb01-blue-0.jpg` This works fine. But how do we get the thumbnail which usually resides in the ...
2016/06/29
[ "https://magento.stackexchange.com/questions/123447", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/41556/" ]
If you need the complete path of the thumbnail image with Magento 2 cache system through API, you can create your custom API based on the native ProductRepository class. Create a new module. (explained in other posts) Create a **etc/webapi.xml** file : ``` <?xml version="1.0"?> <routes xmlns:xsi="http://www.w3.org/2...
It should be possible with the following url: `/rest/V1/products/{sku}` This will return the product and there should be a node for custom\_attributes which contains a thumbnail link ``` <custom_attributes> <item> <attribute_code>thumbnail</attribute_code> <value>/m/b/mb01-blue-0.jpg</value> <...
123,447
How do we get the url to thumbnail image of of a product through rest API. `/V1/products/{sku}/media` would get us the relative url such as `"/m/b/mb01-blue-0.jpg"` and the image url would be `baseurl/catalog/product/m/b/mb01-blue-0.jpg` This works fine. But how do we get the thumbnail which usually resides in the ...
2016/06/29
[ "https://magento.stackexchange.com/questions/123447", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/41556/" ]
The reasons why Magento doesn't provide this functionality out of the box are next: * To return image thumbnail URL as a part of Product with attribute or extension attribute that will mean to introduce support of Read-Only (non-modifiable) attributes in Data Objects. Because URL is a representation of some data. Data...
It should be possible with the following url: `/rest/V1/products/{sku}` This will return the product and there should be a node for custom\_attributes which contains a thumbnail link ``` <custom_attributes> <item> <attribute_code>thumbnail</attribute_code> <value>/m/b/mb01-blue-0.jpg</value> <...
123,447
How do we get the url to thumbnail image of of a product through rest API. `/V1/products/{sku}/media` would get us the relative url such as `"/m/b/mb01-blue-0.jpg"` and the image url would be `baseurl/catalog/product/m/b/mb01-blue-0.jpg` This works fine. But how do we get the thumbnail which usually resides in the ...
2016/06/29
[ "https://magento.stackexchange.com/questions/123447", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/41556/" ]
If you need the complete path of the thumbnail image with Magento 2 cache system through API, you can create your custom API based on the native ProductRepository class. Create a new module. (explained in other posts) Create a **etc/webapi.xml** file : ``` <?xml version="1.0"?> <routes xmlns:xsi="http://www.w3.org/2...
The reasons why Magento doesn't provide this functionality out of the box are next: * To return image thumbnail URL as a part of Product with attribute or extension attribute that will mean to introduce support of Read-Only (non-modifiable) attributes in Data Objects. Because URL is a representation of some data. Data...
12,848,345
I'm using a dictionary in python to make what is basically an infinite 2d array by using a tuple as the key ``` grid = {} grid[(0,0)] = cell() ``` the value 'cell' is a new object. Can I have, say, a function within that object that is able to get its key value? ie. (0,0) I could just put that data in the object it...
2012/10/11
[ "https://Stackoverflow.com/questions/12848345", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1432808/" ]
``` class cell(object): def my_idx(self,grid): return grid.keys()[grid.values().index(self)] ``` then call it ``` some_cell.my_idx(grid) ```
This should work: ``` class Cell(object): def get_idx(self, grid): """ >>> cell = Cell() >>> cell.get_idx({(0, 0): cell}) (0, 0) >>> cell = Cell() >>> cell.get_idx({(0, 0): Cell(), (1, 1): cell, (2, 2): Cell()}) (1, 1) """ return [x[0] for x...
12,848,345
I'm using a dictionary in python to make what is basically an infinite 2d array by using a tuple as the key ``` grid = {} grid[(0,0)] = cell() ``` the value 'cell' is a new object. Can I have, say, a function within that object that is able to get its key value? ie. (0,0) I could just put that data in the object it...
2012/10/11
[ "https://Stackoverflow.com/questions/12848345", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1432808/" ]
``` class cell(object): def my_idx(self,grid): return grid.keys()[grid.values().index(self)] ``` then call it ``` some_cell.my_idx(grid) ```
Your questions implies that there's a 1:1 mapping between dict keys and their values, which is not true. Take this code: ``` grid = {} c = cell() grid[(0,0)] = c grid[(0,1)] = c ``` That's perfectly valid in python, even if your use case does not allow it. What index should the function you are looking for return fo...
12,848,345
I'm using a dictionary in python to make what is basically an infinite 2d array by using a tuple as the key ``` grid = {} grid[(0,0)] = cell() ``` the value 'cell' is a new object. Can I have, say, a function within that object that is able to get its key value? ie. (0,0) I could just put that data in the object it...
2012/10/11
[ "https://Stackoverflow.com/questions/12848345", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1432808/" ]
``` class cell(object): def my_idx(self,grid): return grid.keys()[grid.values().index(self)] ``` then call it ``` some_cell.my_idx(grid) ```
Give your `cell` class an `address` attribute, which is a two-tuple, e.g. `(0,0)`. Give the `cell` class a `__hash__` method, which returns `hash(self.address)`. ``` class cell: def __init__(self,address): self.address = address def __hash__(self): return hash(self.address) def __eq__(sel...
12,848,345
I'm using a dictionary in python to make what is basically an infinite 2d array by using a tuple as the key ``` grid = {} grid[(0,0)] = cell() ``` the value 'cell' is a new object. Can I have, say, a function within that object that is able to get its key value? ie. (0,0) I could just put that data in the object it...
2012/10/11
[ "https://Stackoverflow.com/questions/12848345", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1432808/" ]
``` class cell(object): def my_idx(self,grid): return grid.keys()[grid.values().index(self)] ``` then call it ``` some_cell.my_idx(grid) ```
There are two separate issues here... first, to access the grid from within cell, I would have `cell`'s constructor take a reference to grid as a mandatory argument. ``` grid = {} grid[(0,0)] = cell(grid) ``` and ``` class cell: def __init__(self, gridRef): self.grid = gridRef ``` But, accessing the key is ...
12,848,345
I'm using a dictionary in python to make what is basically an infinite 2d array by using a tuple as the key ``` grid = {} grid[(0,0)] = cell() ``` the value 'cell' is a new object. Can I have, say, a function within that object that is able to get its key value? ie. (0,0) I could just put that data in the object it...
2012/10/11
[ "https://Stackoverflow.com/questions/12848345", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1432808/" ]
This should work: ``` class Cell(object): def get_idx(self, grid): """ >>> cell = Cell() >>> cell.get_idx({(0, 0): cell}) (0, 0) >>> cell = Cell() >>> cell.get_idx({(0, 0): Cell(), (1, 1): cell, (2, 2): Cell()}) (1, 1) """ return [x[0] for x...
Give your `cell` class an `address` attribute, which is a two-tuple, e.g. `(0,0)`. Give the `cell` class a `__hash__` method, which returns `hash(self.address)`. ``` class cell: def __init__(self,address): self.address = address def __hash__(self): return hash(self.address) def __eq__(sel...
12,848,345
I'm using a dictionary in python to make what is basically an infinite 2d array by using a tuple as the key ``` grid = {} grid[(0,0)] = cell() ``` the value 'cell' is a new object. Can I have, say, a function within that object that is able to get its key value? ie. (0,0) I could just put that data in the object it...
2012/10/11
[ "https://Stackoverflow.com/questions/12848345", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1432808/" ]
Your questions implies that there's a 1:1 mapping between dict keys and their values, which is not true. Take this code: ``` grid = {} c = cell() grid[(0,0)] = c grid[(0,1)] = c ``` That's perfectly valid in python, even if your use case does not allow it. What index should the function you are looking for return fo...
Give your `cell` class an `address` attribute, which is a two-tuple, e.g. `(0,0)`. Give the `cell` class a `__hash__` method, which returns `hash(self.address)`. ``` class cell: def __init__(self,address): self.address = address def __hash__(self): return hash(self.address) def __eq__(sel...
12,848,345
I'm using a dictionary in python to make what is basically an infinite 2d array by using a tuple as the key ``` grid = {} grid[(0,0)] = cell() ``` the value 'cell' is a new object. Can I have, say, a function within that object that is able to get its key value? ie. (0,0) I could just put that data in the object it...
2012/10/11
[ "https://Stackoverflow.com/questions/12848345", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1432808/" ]
There are two separate issues here... first, to access the grid from within cell, I would have `cell`'s constructor take a reference to grid as a mandatory argument. ``` grid = {} grid[(0,0)] = cell(grid) ``` and ``` class cell: def __init__(self, gridRef): self.grid = gridRef ``` But, accessing the key is ...
Give your `cell` class an `address` attribute, which is a two-tuple, e.g. `(0,0)`. Give the `cell` class a `__hash__` method, which returns `hash(self.address)`. ``` class cell: def __init__(self,address): self.address = address def __hash__(self): return hash(self.address) def __eq__(sel...
15,752,200
I have created a windows service project using Visual Studio which needs to be installed on to the remote machine using MSBuild. I have had a look at lots of resources on good ways of deploying windows services. Most answer were using PowerShell scripts which i think of as an alternative. Can anyone provide me with go...
2013/04/01
[ "https://Stackoverflow.com/questions/15752200", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2155069/" ]
You can use Exec Task (<http://msdn.microsoft.com/en-us/library/x8zx72cd.aspx>) look at the link. Using powershell remoting would be another option for sure.
To install service to the remote machine you can try ServiceController task that can control a Windows service. From [here](http://weblogs.asp.net/scottgu/archive/2006/02/12/438061.aspx).
15,752,200
I have created a windows service project using Visual Studio which needs to be installed on to the remote machine using MSBuild. I have had a look at lots of resources on good ways of deploying windows services. Most answer were using PowerShell scripts which i think of as an alternative. Can anyone provide me with go...
2013/04/01
[ "https://Stackoverflow.com/questions/15752200", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2155069/" ]
you can use MSBuild example for install: ``` <MSBuild.ExtensionPack.Computer.WindowsService TaskAction="Install" ServiceName="SomeWindowsService" User="UserLocal" Password="PassLocal" ServicePath="\\RemoteComp2\PathForYourService\WindowsService.exe" RemoteUser="UserRemoteComp2" RemoteUserPassword="PassRemoteComp2" Mac...
To install service to the remote machine you can try ServiceController task that can control a Windows service. From [here](http://weblogs.asp.net/scottgu/archive/2006/02/12/438061.aspx).
15,752,200
I have created a windows service project using Visual Studio which needs to be installed on to the remote machine using MSBuild. I have had a look at lots of resources on good ways of deploying windows services. Most answer were using PowerShell scripts which i think of as an alternative. Can anyone provide me with go...
2013/04/01
[ "https://Stackoverflow.com/questions/15752200", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2155069/" ]
You can use Exec Task (<http://msdn.microsoft.com/en-us/library/x8zx72cd.aspx>) look at the link. Using powershell remoting would be another option for sure.
Have a look at PSExec (<http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx>) depending on your requirements and deployment scenario. It, combined with the MSBuild Exec task, would allow you to install the service remotely.
15,752,200
I have created a windows service project using Visual Studio which needs to be installed on to the remote machine using MSBuild. I have had a look at lots of resources on good ways of deploying windows services. Most answer were using PowerShell scripts which i think of as an alternative. Can anyone provide me with go...
2013/04/01
[ "https://Stackoverflow.com/questions/15752200", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2155069/" ]
You can use Exec Task (<http://msdn.microsoft.com/en-us/library/x8zx72cd.aspx>) look at the link. Using powershell remoting would be another option for sure.
you can use MSBuild example for install: ``` <MSBuild.ExtensionPack.Computer.WindowsService TaskAction="Install" ServiceName="SomeWindowsService" User="UserLocal" Password="PassLocal" ServicePath="\\RemoteComp2\PathForYourService\WindowsService.exe" RemoteUser="UserRemoteComp2" RemoteUserPassword="PassRemoteComp2" Mac...
15,752,200
I have created a windows service project using Visual Studio which needs to be installed on to the remote machine using MSBuild. I have had a look at lots of resources on good ways of deploying windows services. Most answer were using PowerShell scripts which i think of as an alternative. Can anyone provide me with go...
2013/04/01
[ "https://Stackoverflow.com/questions/15752200", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2155069/" ]
you can use MSBuild example for install: ``` <MSBuild.ExtensionPack.Computer.WindowsService TaskAction="Install" ServiceName="SomeWindowsService" User="UserLocal" Password="PassLocal" ServicePath="\\RemoteComp2\PathForYourService\WindowsService.exe" RemoteUser="UserRemoteComp2" RemoteUserPassword="PassRemoteComp2" Mac...
Have a look at PSExec (<http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx>) depending on your requirements and deployment scenario. It, combined with the MSBuild Exec task, would allow you to install the service remotely.
27,417,705
I'm very new in AngularJS. I want to post registration data to a json file. Post request is working correctly,but data is not writing to file. I can't understand that position. Is there something wrong with my post request code? And how can I fix that? Thanks! ``` var regModel = { FirstName: 'Someone', LastNa...
2014/12/11
[ "https://Stackoverflow.com/questions/27417705", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4152306/" ]
try this: ``` private void sendSMSWithDelay(String number, String responseMessage, int delayInResponce) { Intent intent = new Intent(Global.getMyApplicationContext(), MyCallBroadcastReceiver.class); // Intent i = new Intent(MessageService.this, // ViewMessageActivi...
Refer following link <https://developer.android.com/training/scheduling/alarms.html> For example:- alarmMgr.setRepeating(AlarmManager.RTC\_WAKEUP, calendar.getTimeInMillis(), System.currentTimeMillis() + (delayInResponce \* 60 \* 1000), pendingIntent);
40,257,164
I am struglling to start implementation or development for sitecore ecommerce connector. I tried to google to find some tutorials but there is not much information available. I have successfully install sitecore and commerce connector but i don't know how to start developing product and other services to sync product d...
2016/10/26
[ "https://Stackoverflow.com/questions/40257164", "https://Stackoverflow.com", "https://Stackoverflow.com/users/167689/" ]
On this youtube channel you will find a demo video how to start with commerce connect. It is connected to a NopCommerce website. <https://www.youtube.com/watch?v=JECKXgAOAZU> You can find also informations on github account : <https://github.com/Sitecore/Commerce-Connect-StarterKit/tree/release/8.2.281/master> Th...
Sitecore provides "Commerce Connect" to connect to external system. Commerce Connect is an integration layer between a front-end web shop solution and a back-end e-commerce system You can get more information on <http://www.sitecore.net/en/products/sitecore-experience-platform/cross-channel-delivery/commerce>
26,017,429
I am starting a Process with Process.Start("MyProcess.exe") function. "MyProcess.exe" uses a DLL. Exe and DLL are in same folder. I have modified this DLL and located it into a different path with same name. For some cases, I want to start MyProcess.exe with modified DLL and I do not want to delete original DLL. ...
2014/09/24
[ "https://Stackoverflow.com/questions/26017429", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2511092/" ]
Because of the built in [rules within the operating system](http://msdn.microsoft.com/en-us/library/windows/desktop/ff919712%28v=vs.85%29.aspx), the system always searches directories in the following order: * The directory from which the application loaded. * The system directory. * The 16-bit system directory. * The...
If the DLL have the different version you casu use [Specifying an Assembly's Location](http://msdn.microsoft.com/en-us/library/4191fzwb(v=vs.110).aspx) in the config file of MyProcess.exe if is .Net
3,381,454
Say $E(X\_{n} 1\_{\vert X\_{n} \vert \geq 1 })=\frac{1}{n}$ for all $n \in \mathbb N$. Can I immediately deduce that $(X\_{n})\_{n}$ is uniformly integrable? My idea: $E(\vert X\_{n}\vert)= E(\vert X\_{n}\vert 1\_{\vert X\_{n} \vert \geq 1 })+E(\vert X\_{n}\vert 1\_{\vert X\_{n} \vert < 1 })\leq\frac{1}{n}+1$ Thus...
2019/10/05
[ "https://math.stackexchange.com/questions/3381454", "https://math.stackexchange.com", "https://math.stackexchange.com/users/512018/" ]
For given $\epsilon>0$ choose $N \in \mathbb{N}$ sufficiently large such that $1/N \leq \epsilon$. Then $$\int\_{|X\_n| \geq R} |X\_n| \, d\mathbb{P} \leq \int\_{|X\_n| \geq 1} |X\_n| \, d\mathbb{P} \leq \frac{1}{n} \leq \epsilon$$ for all $n \geq N$ and $R \geq 1$. On the other hand, the finite family $\{X\_1,\ldot...
If the assumption was $$ E\left(\lvert X\_{n}\rvert 1\_{\vert X\_{n} \vert \geq 1 }\right))=\frac{1}{n}, $$ then for all $R\geqslant 1$, $\limsup\_{n\to+\infty}E\left(\lvert X\_{n}\rvert 1\_{\vert X\_{n} \vert \geq R }\right))=0$ hence the uniform integrability follows. However, with the assumption $$E\left( X\_{n}...
36,950,296
Am trying to configure `Qt for Android development` on my windows 7 machine. I have downloaded the `latest Android Studio, NDK, Apache Ant 1.9.7 and Qt Creator from qt.io (Qt 5.6.0 for Android (Windows 32-bit, 1.1 GB))`. I am able to create AVD in Android Studio and was able to start AVD and deploy an application I cr...
2016/04/30
[ "https://Stackoverflow.com/questions/36950296", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2043014/" ]
It looks like your virtual devices are all x86 based, while your Qt kit builds for ARM. This will not matter for Android Studio, since it is not native code but Java, but Qt is C++ code and you cannot target a x86 device with an ARM compiler. Either install Qt for Android x86 or create an ARM virtual device.
Initially I was working on Android studio installed on my Windows 7 machine. And, when I wanted to work on "Qt for Android" I have set the Android SDK and NDK paths in Qt Creator to the same locations that I used in Android Studio, and for some reason I was unable to create an ARM virtual device in Qt Creator. Based ...
7,043,141
I am building a TSQL query to parse through a FTP log from FileZilla. I am trying to figure out if there is a way to get information from a line preceding the current one? For example, I have parsed out the Following procedure: "STOR file.exe" With the FileZilla is doesn't say if the STOR wass successful until the ne...
2011/08/12
[ "https://Stackoverflow.com/questions/7043141", "https://Stackoverflow.com", "https://Stackoverflow.com/users/781558/" ]
Assuming you have parsed these lines into actual columns, and you have SQL server 2005 or greater. You can use `CROSS APPLY` example query below (untested). I hope this helps. ``` select o.*, prev.* from FTPLog o cross apply ( select top 1 * from FTPLog P where P.LogDate < O.LogDate order by LogDate DESC ...
James has the right idea, though there may be some issues if you ever have log dates that are exactly the same (and from your sample it looks like you might). You may be able to add an identity column to force an order at the time the data is inserted, then you can use James' concept on the identity column. More than ...
4,450,741
How can I show that $P(B|A) = P(B)$, given that $A$ and $B$ are independent?
2022/05/15
[ "https://math.stackexchange.com/questions/4450741", "https://math.stackexchange.com", "https://math.stackexchange.com/users/868990/" ]
$$f(x) = x^2 + 1$$ is irreducible over $\mathbb Q$, but $$f(x^3) = x^6 + 1 = (x^2 + 1)(x^4 - x^2 + 1)$$ obviously factors.
If $k\ne2$ then $f(x)=x^2-2^k$ is irreducible but $f(x^k)=(x^2)^k-2^k$ is reducible
4,450,741
How can I show that $P(B|A) = P(B)$, given that $A$ and $B$ are independent?
2022/05/15
[ "https://math.stackexchange.com/questions/4450741", "https://math.stackexchange.com", "https://math.stackexchange.com/users/868990/" ]
If $k\ne2$ then $f(x)=x^2-2^k$ is irreducible but $f(x^k)=(x^2)^k-2^k$ is reducible
Another sufficient condition is given in *Problems from the Book* by Titu Andreescu (Example 9, page 494): > > Let $f(x)$ be a monic polynomial with integer coefficients and let $p$ be a prime number. If $f(x)$ is irreducible in $\mathbb{Z}[x]$ and $\sqrt[p]{(-1)^{\deg f}f(0)}$ is irrational, then $f(x^p)$ is also ir...
4,450,741
How can I show that $P(B|A) = P(B)$, given that $A$ and $B$ are independent?
2022/05/15
[ "https://math.stackexchange.com/questions/4450741", "https://math.stackexchange.com", "https://math.stackexchange.com/users/868990/" ]
$$f(x) = x^2 + 1$$ is irreducible over $\mathbb Q$, but $$f(x^3) = x^6 + 1 = (x^2 + 1)(x^4 - x^2 + 1)$$ obviously factors.
Here is a sufficient condition: $f(x)$ is irreducible over $\mathbb{Q}$ and in some field $K$ (the splitting field of $f(x)$) we have $f(x) = (x-\alpha\_1)\cdot \ldots \cdot (x-\alpha\_n)$, and moreover each $x^k - \alpha\_i$, $1\le i \le n$, is irreducible over $K$. This applies in particular to your polynomial, see...
4,450,741
How can I show that $P(B|A) = P(B)$, given that $A$ and $B$ are independent?
2022/05/15
[ "https://math.stackexchange.com/questions/4450741", "https://math.stackexchange.com", "https://math.stackexchange.com/users/868990/" ]
$$f(x) = x^2 + 1$$ is irreducible over $\mathbb Q$, but $$f(x^3) = x^6 + 1 = (x^2 + 1)(x^4 - x^2 + 1)$$ obviously factors.
Another sufficient condition is given in *Problems from the Book* by Titu Andreescu (Example 9, page 494): > > Let $f(x)$ be a monic polynomial with integer coefficients and let $p$ be a prime number. If $f(x)$ is irreducible in $\mathbb{Z}[x]$ and $\sqrt[p]{(-1)^{\deg f}f(0)}$ is irrational, then $f(x^p)$ is also ir...
4,450,741
How can I show that $P(B|A) = P(B)$, given that $A$ and $B$ are independent?
2022/05/15
[ "https://math.stackexchange.com/questions/4450741", "https://math.stackexchange.com", "https://math.stackexchange.com/users/868990/" ]
Here is a sufficient condition: $f(x)$ is irreducible over $\mathbb{Q}$ and in some field $K$ (the splitting field of $f(x)$) we have $f(x) = (x-\alpha\_1)\cdot \ldots \cdot (x-\alpha\_n)$, and moreover each $x^k - \alpha\_i$, $1\le i \le n$, is irreducible over $K$. This applies in particular to your polynomial, see...
Another sufficient condition is given in *Problems from the Book* by Titu Andreescu (Example 9, page 494): > > Let $f(x)$ be a monic polynomial with integer coefficients and let $p$ be a prime number. If $f(x)$ is irreducible in $\mathbb{Z}[x]$ and $\sqrt[p]{(-1)^{\deg f}f(0)}$ is irrational, then $f(x^p)$ is also ir...
389,520
Let $K$ be a number field and let $D$ be a central division algebra over $K$. Let $d$ be the index so that $[D:K]=d^2$. What is the minimal $n$ such that there exists an embedding of $D$ into $\mathrm{Mat}\_{n \times n}(K)$? Of course, we can always embed $D$ into $\mathrm{Mat}\_{n \times n}(K)$ for $n=d^2$, but can w...
2021/04/06
[ "https://mathoverflow.net/questions/389520", "https://mathoverflow.net", "https://mathoverflow.net/users/7443/" ]
Any embedding of $D$ into $M\_n(K)$ defines a $D$-module structure on $K^n$. But $D$ is a simple algebra and we know all its modules: they are $D^m\cong K^{km}$ where $k=[D:K]$. Thus, $m=1$ is the best you can do.
$n = [D : K]$. Assume $n < [D : K]$. Let $p: D \rightarrow \mathrm{Mat}\_{n \times n}$ be an embedding, and let $\{\alpha\_i\}\_{1 \leq i \leq d^2}$ be a basis for $D$ over $K$, where $d^2=[D:K]$. Choose any nonzero vector $v \in V \simeq K^n$. Then as there are $d^2$ elements of the set $\{p(\alpha\_i)(v)\}$, they m...
67,737,215
I have the following JavaScript code and I get an error that says: Uncaught TypeError: Cannot read property 'value' of undefined" Specifically, at the line: const parola=form.parola.value; ```js <%- include('partials/header') %> <form action="/signup"> <h2>Kullanıcı Oluştur</h2> <label for="email">email</la...
2021/05/28
[ "https://Stackoverflow.com/questions/67737215", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16058589/" ]
*The Outlooks* on Windows don’t support `background-image` in CSS nor the HTML `background` attribute. So VML is indeed the usual way to go. I wrote a post this year about mimicking [background properties in VML](https://www.hteumeuleu.com/2021/background-properties-in-vml/). You'll need the following corresponding VML...
Please try this ``` <style> background { background-image: url('image-url.jpg'); background-repeat: no-repeat; background-attachment: fixed; background-size: cover; } </style> ```
51,261,939
I have made a Django employee portal which will be accessed by LAN only. It works when another employee opens it by typing the IP address of the server on their web browser. However I don't have much experience with Django and I think that this is not the proper way to do so. I run my server using python manage.py runs...
2018/07/10
[ "https://Stackoverflow.com/questions/51261939", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10042266/" ]
[Setting up Django and your web server with uWSGI and nginx](https://uwsgi-docs.readthedocs.io/en/latest/tutorials/Django_and_nginx.html) There is not an official way to do it, what I do effectively, intranet solutions as well, is with nginx and uWSGI (on ubuntu). Serving with Windows? perhaps: <https://www.toptal.co...
I think for ip address issue you can use host names <https://wesbos.com/localhost-mobile-device-testing/> and for running server in background you can use gunicorn with supervisor check this out <https://www.agiliq.com/blog/2014/05/supervisor-with-django-and-gunicorn/>
51,261,939
I have made a Django employee portal which will be accessed by LAN only. It works when another employee opens it by typing the IP address of the server on their web browser. However I don't have much experience with Django and I think that this is not the proper way to do so. I run my server using python manage.py runs...
2018/07/10
[ "https://Stackoverflow.com/questions/51261939", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10042266/" ]
The simplest way to allow everyone on your network to access your Django webserver is to do `python manage.py runserver 0.0.0.0:8000` This allows anyone on the network to access it by using your IP address (or computer name) and the port 8000. (so something like 192.168.1.2:8000) This of course isn't really nice s...
I think for ip address issue you can use host names <https://wesbos.com/localhost-mobile-device-testing/> and for running server in background you can use gunicorn with supervisor check this out <https://www.agiliq.com/blog/2014/05/supervisor-with-django-and-gunicorn/>
1,063,364
I am creating a file-oriented database of some test results performed by various users. For this I need to generate unique id for every entry in the database. The ids must satisfy following requirements: * Ids should be fairly small (6 characters at most) * For every test case and user combination each time same id sh...
2009/06/30
[ "https://Stackoverflow.com/questions/1063364", "https://Stackoverflow.com", "https://Stackoverflow.com/users/91593/" ]
Do you have more than 256 users and/or more than 65536 test cases per user? If not, you can just index users from 0 .. 255 and test cases from 0 .. 65535 and encode it as a string of hexadecimal digits so six characters would be fine. If you have more users or test cases than that, I would again index the users and te...
If you don't have a lot of users/testcases a simple solution like this might be enough. You'd have to add the limit (and probably pack the integer when storing it). ``` vinko@parrot:~# more hash.pl use strict; use warnings; my %hash; my $count = 0; sub getUniqueId { my $_user = shift; my $_test = sh...
1,063,364
I am creating a file-oriented database of some test results performed by various users. For this I need to generate unique id for every entry in the database. The ids must satisfy following requirements: * Ids should be fairly small (6 characters at most) * For every test case and user combination each time same id sh...
2009/06/30
[ "https://Stackoverflow.com/questions/1063364", "https://Stackoverflow.com", "https://Stackoverflow.com/users/91593/" ]
Part of your problem may be that you are using floating point math and BKDR is almost certainly wanting integer math. You can fix that bug by saying ``` my @chars = split(//,$hash_var); my $hash = 0; my $seed = 31; for my $char ( @chars ) { use integer; if( $char !~ m/\d/ ) { $hash = ( $seed * $hash ) +...
If you don't have a lot of users/testcases a simple solution like this might be enough. You'd have to add the limit (and probably pack the integer when storing it). ``` vinko@parrot:~# more hash.pl use strict; use warnings; my %hash; my $count = 0; sub getUniqueId { my $_user = shift; my $_test = sh...
73,008,449
``` String name = "Jack"; char letter = name.charAt(0); System.out.println(letter); ``` You know this is a java method **`charAt`** that it gives you a character of a String just by telling the index of the String. I'm asking for a method like this in Dart, does Dart have a method like that?
2022/07/17
[ "https://Stackoverflow.com/questions/73008449", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19141096/" ]
You can use [`String.operator[]`](https://api.dart.dev/stable/dart-core/String/operator_get.html). ```dart String name = "Jack"; String letter = name[0]; print(letter); ``` Note that this operates on UTF-16 *code units*, not on Unicode code points nor on grapheme clusters. Also note that Dart does not have a `char...
You can use ``` String.substring(int startIndex, [ int endIndex ]) ``` Example -- ``` void main(){ String s = "hello"; print(s.substring(1, 2)); } ``` Output ``` e ``` Note that , endIndex is one greater than startIndex, and the char which is returned is present at startIndex.
73,008,449
``` String name = "Jack"; char letter = name.charAt(0); System.out.println(letter); ``` You know this is a java method **`charAt`** that it gives you a character of a String just by telling the index of the String. I'm asking for a method like this in Dart, does Dart have a method like that?
2022/07/17
[ "https://Stackoverflow.com/questions/73008449", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19141096/" ]
Dart has two operations that match the Java behavior, because Java prints integers of the type `char` specially. Dart has [`String.codeUnitAt`](https://api.dart.dev/stable/2.17.6/dart-core/String/codeUnitAt.html), which does the same as Java's `charAt`: Returns an integer representing the UTF-16 code unit at that posi...
You can use ``` String.substring(int startIndex, [ int endIndex ]) ``` Example -- ``` void main(){ String s = "hello"; print(s.substring(1, 2)); } ``` Output ``` e ``` Note that , endIndex is one greater than startIndex, and the char which is returned is present at startIndex.
14,109,259
I'm working on an application written in C# where I basically need to act as my own certificate authority. The data flow is something like this: * The end user generates a public/private key pair and sends me proof of their identity and a certificate request of some kind with their public key * The app validates their...
2013/01/01
[ "https://Stackoverflow.com/questions/14109259", "https://Stackoverflow.com", "https://Stackoverflow.com/users/211378/" ]
The concise example of certgen with Bouncy Castle <http://netpl.blogspot.com/2012/12/how-to-create-x509certificate2.html> I've also blogged on signing and validating of xml documents <http://netpl.blogspot.com/2012/12/interoperable-xml-digital-signatures-c_4247.html>
I think you will change you mind about using command-line utilities but assuming you don't, I don't have the answer because I haven't done it but here are a few tips. I'm confident This can be done with bouncycastle C# library. The library is basically undocumented though. What I would do is first download an *earlier...
32,322,945
I have a two DATETIME columns: event\_start and event\_end. I'm not sure why this isn't working. ``` SELECT * FROM ibclc_schedules WHERE NOW() >= event_start AND NOW() <= event_end ORDER BY event_start ASC LIMIT 1 ``` I get a "Notice: Trying to get property of non-object" printed to the screen.
2015/09/01
[ "https://Stackoverflow.com/questions/32322945", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1938311/" ]
I suggest you to debug current datetime of mysql server with query `SELECT NOW();` and check it is really between event\_start and event\_end of your needed result.
i think this is a php error kindly check your php code or write your code here so we have an idea about that, or first check this query in phpmyadmin weather its returning something or not
251,471
I have a server with 8TB data, and a tape with high numbered 400GB tape cartridges. What would be the best solution to backup this server with the least effort ? I think after one full backup, I can make many increments on one 400GB tape. But how can I make the full backup across the tapes (with manual tape change), a...
2011/03/24
[ "https://serverfault.com/questions/251471", "https://serverfault.com", "https://serverfault.com/users/74590/" ]
Don't try and do it yourself. You should be using a program such as [amanda](http://www.amanda.org/) or [bacula](http://www.bacula.org/) to manage your backups. Use amanda when you don't have a tape library. Use bacula when you have a tape library available. --- *mini rant follows* Sure, just using `dump` or `tar`...
I would suggest to do full initial backup that spans multiple tapes and then do differential backups over 5-7 tapes on daily basis. When size of differential backup grows to fill a full tape take another full backup and start the cycle over. In your case it will be one full backup about once a year. You could use Amand...
251,471
I have a server with 8TB data, and a tape with high numbered 400GB tape cartridges. What would be the best solution to backup this server with the least effort ? I think after one full backup, I can make many increments on one 400GB tape. But how can I make the full backup across the tapes (with manual tape change), a...
2011/03/24
[ "https://serverfault.com/questions/251471", "https://serverfault.com", "https://serverfault.com/users/74590/" ]
I'd certainly recommend full backups over incremental backups - it just saves so much pain! While you can do it with tar (at least the you can with the Gnu version of tar), I'd recommend using something a bit more robust - I like afio (unlike tar where you put files in an archive then compress the archive, [afio](http...
As always with backups, "Best" refers to what you are backing up, why you are backing up (i.e. what your are trying to mitigate through backups), what tools you have, how much data, how often, retention policy, etc. I do use `tar` for mine. Amanda and Backula are too big/complicated IMHO for a single machine backup, b...
251,471
I have a server with 8TB data, and a tape with high numbered 400GB tape cartridges. What would be the best solution to backup this server with the least effort ? I think after one full backup, I can make many increments on one 400GB tape. But how can I make the full backup across the tapes (with manual tape change), a...
2011/03/24
[ "https://serverfault.com/questions/251471", "https://serverfault.com", "https://serverfault.com/users/74590/" ]
Don't try and do it yourself. You should be using a program such as [amanda](http://www.amanda.org/) or [bacula](http://www.bacula.org/) to manage your backups. Use amanda when you don't have a tape library. Use bacula when you have a tape library available. --- *mini rant follows* Sure, just using `dump` or `tar`...
Have look in this link has every small details for tap backup <http://www.cyberciti.biz/faq/linux-tape-backup-with-mt-and-tar-command-howto/>
251,471
I have a server with 8TB data, and a tape with high numbered 400GB tape cartridges. What would be the best solution to backup this server with the least effort ? I think after one full backup, I can make many increments on one 400GB tape. But how can I make the full backup across the tapes (with manual tape change), a...
2011/03/24
[ "https://serverfault.com/questions/251471", "https://serverfault.com", "https://serverfault.com/users/74590/" ]
Don't try and do it yourself. You should be using a program such as [amanda](http://www.amanda.org/) or [bacula](http://www.bacula.org/) to manage your backups. Use amanda when you don't have a tape library. Use bacula when you have a tape library available. --- *mini rant follows* Sure, just using `dump` or `tar`...
I'd certainly recommend full backups over incremental backups - it just saves so much pain! While you can do it with tar (at least the you can with the Gnu version of tar), I'd recommend using something a bit more robust - I like afio (unlike tar where you put files in an archive then compress the archive, [afio](http...
251,471
I have a server with 8TB data, and a tape with high numbered 400GB tape cartridges. What would be the best solution to backup this server with the least effort ? I think after one full backup, I can make many increments on one 400GB tape. But how can I make the full backup across the tapes (with manual tape change), a...
2011/03/24
[ "https://serverfault.com/questions/251471", "https://serverfault.com", "https://serverfault.com/users/74590/" ]
I've used all sorts of backups. Certainly Bacula is a reliable way to perform backups, but I think part of the question revolved around security and simplicity. It is harder to find an easier or more reliable means of backing up a file system than to use good old dump. (This presumes that you are using a file system su...
I would suggest to do full initial backup that spans multiple tapes and then do differential backups over 5-7 tapes on daily basis. When size of differential backup grows to fill a full tape take another full backup and start the cycle over. In your case it will be one full backup about once a year. You could use Amand...
251,471
I have a server with 8TB data, and a tape with high numbered 400GB tape cartridges. What would be the best solution to backup this server with the least effort ? I think after one full backup, I can make many increments on one 400GB tape. But how can I make the full backup across the tapes (with manual tape change), a...
2011/03/24
[ "https://serverfault.com/questions/251471", "https://serverfault.com", "https://serverfault.com/users/74590/" ]
I'd certainly recommend full backups over incremental backups - it just saves so much pain! While you can do it with tar (at least the you can with the Gnu version of tar), I'd recommend using something a bit more robust - I like afio (unlike tar where you put files in an archive then compress the archive, [afio](http...
Have look in this link has every small details for tap backup <http://www.cyberciti.biz/faq/linux-tape-backup-with-mt-and-tar-command-howto/>
251,471
I have a server with 8TB data, and a tape with high numbered 400GB tape cartridges. What would be the best solution to backup this server with the least effort ? I think after one full backup, I can make many increments on one 400GB tape. But how can I make the full backup across the tapes (with manual tape change), a...
2011/03/24
[ "https://serverfault.com/questions/251471", "https://serverfault.com", "https://serverfault.com/users/74590/" ]
I've used all sorts of backups. Certainly Bacula is a reliable way to perform backups, but I think part of the question revolved around security and simplicity. It is harder to find an easier or more reliable means of backing up a file system than to use good old dump. (This presumes that you are using a file system su...
Have look in this link has every small details for tap backup <http://www.cyberciti.biz/faq/linux-tape-backup-with-mt-and-tar-command-howto/>
251,471
I have a server with 8TB data, and a tape with high numbered 400GB tape cartridges. What would be the best solution to backup this server with the least effort ? I think after one full backup, I can make many increments on one 400GB tape. But how can I make the full backup across the tapes (with manual tape change), a...
2011/03/24
[ "https://serverfault.com/questions/251471", "https://serverfault.com", "https://serverfault.com/users/74590/" ]
I'd certainly recommend full backups over incremental backups - it just saves so much pain! While you can do it with tar (at least the you can with the Gnu version of tar), I'd recommend using something a bit more robust - I like afio (unlike tar where you put files in an archive then compress the archive, [afio](http...
I would suggest to do full initial backup that spans multiple tapes and then do differential backups over 5-7 tapes on daily basis. When size of differential backup grows to fill a full tape take another full backup and start the cycle over. In your case it will be one full backup about once a year. You could use Amand...
251,471
I have a server with 8TB data, and a tape with high numbered 400GB tape cartridges. What would be the best solution to backup this server with the least effort ? I think after one full backup, I can make many increments on one 400GB tape. But how can I make the full backup across the tapes (with manual tape change), a...
2011/03/24
[ "https://serverfault.com/questions/251471", "https://serverfault.com", "https://serverfault.com/users/74590/" ]
I'd certainly recommend full backups over incremental backups - it just saves so much pain! While you can do it with tar (at least the you can with the Gnu version of tar), I'd recommend using something a bit more robust - I like afio (unlike tar where you put files in an archive then compress the archive, [afio](http...
``` #!/bin/bash INCR_LOG = "/var/log/increment.snar" DAY_OF_WEEK = $(date +%u) if [ $DAY_OF_WEEK = 0 ]; then rm $INCR_LOG; fi tar -cf archive-$DAY_OF_WEEK.tar --listed-incremental=$INCR_LOG /dir/to/be/backed/up ``` Something similar to that, set it up to run everyday in crontab. Will make a weekly full backup a...
251,471
I have a server with 8TB data, and a tape with high numbered 400GB tape cartridges. What would be the best solution to backup this server with the least effort ? I think after one full backup, I can make many increments on one 400GB tape. But how can I make the full backup across the tapes (with manual tape change), a...
2011/03/24
[ "https://serverfault.com/questions/251471", "https://serverfault.com", "https://serverfault.com/users/74590/" ]
As always with backups, "Best" refers to what you are backing up, why you are backing up (i.e. what your are trying to mitigate through backups), what tools you have, how much data, how often, retention policy, etc. I do use `tar` for mine. Amanda and Backula are too big/complicated IMHO for a single machine backup, b...
``` #!/bin/bash INCR_LOG = "/var/log/increment.snar" DAY_OF_WEEK = $(date +%u) if [ $DAY_OF_WEEK = 0 ]; then rm $INCR_LOG; fi tar -cf archive-$DAY_OF_WEEK.tar --listed-incremental=$INCR_LOG /dir/to/be/backed/up ``` Something similar to that, set it up to run everyday in crontab. Will make a weekly full backup a...
66,560
Is there any way to enable tabbed browsing of documents in Microsoft Word (at least in Office 2003) like we see in EditPlus or TextPad?
2008/10/03
[ "https://superuser.com/questions/66560", "https://superuser.com", "https://superuser.com/users/48287/" ]
It's possible with [**OfficeTabs**](http://hi.baidu.com/officecm/blog/item/19de9c6dcf6276f2431694b0.html). ![alt text](https://i.stack.imgur.com/NJUXu.jpg) Read more about it [here](http://www.mydigitallife.info/2009/09/07/officetab-add-on-tab-feature-for-microsoft-office/).
With Office Tab, you can bring tabbed browsing to Word, Excel and PowerPoint. [Office Tab](http://www.extendoffice.com/) ![enter image description here](https://i.stack.imgur.com/mQcp6.jpg)
203,231
What does link quality mean in WLAN ?
2010/10/25
[ "https://superuser.com/questions/203231", "https://superuser.com", "https://superuser.com/users/25930/" ]
It's dependent on several factors, from the [Federal Standard 1037C for Telecommunications](http://www.its.bldrdoc.gov/fs-1037/fs-1037c.htm): > > **link quality analysis (LQA):** In > adaptive high-frequency (HF) radio, > the overall process by which > measurements of signal quality are > made, assessed, and anal...
I think there are a few types of link quality, but in simple terms, it means how much of the data you send and receive will make it to the destination in good condition. High link quality means the requests you send will make it there intact, and the responses should be in good condition as well. Low quality will giv...