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
30,300,435
I'm somewhat new to objective-c, i'm developing a news iOS application, the app gets all its contents using JSON parsing from a url, i'm using `AFNetworking` for that and this is the method that i made: ``` - (void)getContents { NSString *urlString = @"http://some-url-that-has-json-output/"; urlString = [urlS...
2015/05/18
[ "https://Stackoverflow.com/questions/30300435", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4872117/" ]
You can use default loading indicator of iOS(UIActivityIndicator). You should start animating it before completion block and should hide inside success and failure block. You should create a method using indicator as class variable: ``` indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIAct...
Drag and drop `UIActivityIndicatorView` into your XIB view and connect it with IBOutlet. .h file ``` @property(nonatomic, strong)IBOutlet UIActivityIndicatorView * activityIndicator; ``` Add UIActivity indicator view into your view. show it before `NSString *urlString = @"http://some-url-that-has-json-output/";` ...
90,742
I understand that I need a telephoto lens, combined with a low fstop to separate the subject in a portrait from the background, which will be out of focus. I'm confused if I add a macro/2x telephoto adapter to this lens will that mean the fstop becomes lower or higher? Will it help me to achieve this objective to buy t...
2017/07/08
[ "https://photo.stackexchange.com/questions/90742", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/65548/" ]
No.. in fact you will get somewhat horrible results. The lens you'll end up with is a 32-110mm f:7-f11 (ish) lens because not only does the focal length multiply by two, but you are also reducing the maximum aperture by two stops. The depth of field of 55mm @ f5.6 is exactly the same as 110mm at f8, but the big prob...
A macro adapter will only allow you to do closeup/macro shots. You'll lose the ability to focus at a normal distance for taking portraits. Using a teleconverter wouldn't help either as people normally use f/1.4–f/2.8 apertures to separate the subject from the background, not f/11. There's also a big chance that a tele...
90,742
I understand that I need a telephoto lens, combined with a low fstop to separate the subject in a portrait from the background, which will be out of focus. I'm confused if I add a macro/2x telephoto adapter to this lens will that mean the fstop becomes lower or higher? Will it help me to achieve this objective to buy t...
2017/07/08
[ "https://photo.stackexchange.com/questions/90742", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/65548/" ]
Use the lens you own i.e. the 18 - 55 mm zoomed out to the maximum zoom. In other words, shoot your portrait at 55mm. Use the widest opening available to force a shallow depth of field. Have the subject hold their hand about 8 inches in front of their face. Use this hand target to focus upon. You do this by pressing th...
A macro adapter will only allow you to do closeup/macro shots. You'll lose the ability to focus at a normal distance for taking portraits. Using a teleconverter wouldn't help either as people normally use f/1.4–f/2.8 apertures to separate the subject from the background, not f/11. There's also a big chance that a tele...
62,749,472
I am creating a react native application and want to change the background color of an animated View after the user touches it. For more context, the view is in the shape of a square and I am rotating it 225 degrees when the component mounts. If the user touches the square, it will animate a flipping motion and show th...
2020/07/06
[ "https://Stackoverflow.com/questions/62749472", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10076981/" ]
You can make a hexadecimal literal in Lua by prefixing it with `0x`, as [stated in the reference manual](https://www.lua.org/manual/5.3/manual.html). I found this by googling "lua hex"; such searches usually get good results. "Hexadecimal numbers" aren't anything special, hexadecimal is just a way to represent numbers...
Code to convert: ``` function convertHex() local decValue = readInteger(0x123456); hexValue = decValue end function hexSubtract() for i = 1,37 do local value = 0xC8 hexValue = hexValue - 0xC8 result = hexValue if i == 37 then print(result) --Prints dec value ...
49,522
Tried Googling it a bit, yet never found an answer. Fire does damage at a rate of 1/2 heart per second, but how long do you stay on fire? How much total damage does fire do while not standing in it?
2012/02/03
[ "https://gaming.stackexchange.com/questions/49522", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/19401/" ]
Once you are set on fire by a flame and you step out of it, if you are not wearing armor you take `3.5` hearts of damage at a rate of `.5` per second and then you stop burning. If you are instead set on fire by lava, you take `7` hearts of damage. I tested this by setting myself on fire at every difficulty level.
When you are set on fire, you take `0.5` hearts per second of *pre-armor* damage. If you are **standing in** fire, you take *another* `0.5` hearts per second (pre-armor). If you are **(swimming) in** lava, you take `2.0` hearts per second. This totals to `0.5 / sec` for on fire, `1.0 / sec` for in fire, and `2.5...
49,522
Tried Googling it a bit, yet never found an answer. Fire does damage at a rate of 1/2 heart per second, but how long do you stay on fire? How much total damage does fire do while not standing in it?
2012/02/03
[ "https://gaming.stackexchange.com/questions/49522", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/19401/" ]
Once you are set on fire by a flame and you step out of it, if you are not wearing armor you take `3.5` hearts of damage at a rate of `.5` per second and then you stop burning. If you are instead set on fire by lava, you take `7` hearts of damage. I tested this by setting myself on fire at every difficulty level.
Fire is quite a dangerous and effective weapon in Minecraft, lava being more dangerous and deadly. When an entity with health is set on fire, it takes an initial 1 heart damage for touching the fire and burning, plus 3.5 hearts if they left the fire straight away. This is 4.5 hearts damage with fire minimum, the equati...
49,522
Tried Googling it a bit, yet never found an answer. Fire does damage at a rate of 1/2 heart per second, but how long do you stay on fire? How much total damage does fire do while not standing in it?
2012/02/03
[ "https://gaming.stackexchange.com/questions/49522", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/19401/" ]
When you are set on fire, you take `0.5` hearts per second of *pre-armor* damage. If you are **standing in** fire, you take *another* `0.5` hearts per second (pre-armor). If you are **(swimming) in** lava, you take `2.0` hearts per second. This totals to `0.5 / sec` for on fire, `1.0 / sec` for in fire, and `2.5...
Fire is quite a dangerous and effective weapon in Minecraft, lava being more dangerous and deadly. When an entity with health is set on fire, it takes an initial 1 heart damage for touching the fire and burning, plus 3.5 hearts if they left the fire straight away. This is 4.5 hearts damage with fire minimum, the equati...
26,168,886
I've been looking around and I've not been able to find any solutions that work. I've tried to use all of these without success: ``` GetMDIFrame()->ModifyStyle(WS_CAPTION, 0); GetMDIFrame()->ModifyStyle(WS_CAPTION, 0, SWP_DRAWFRAME|SWP_FRAMECHANGED); SetWindowLong(hwnd, GWL_STYLE, ::GetWindowLong(hwnd, GWL_STYLE) & ~...
2014/10/02
[ "https://Stackoverflow.com/questions/26168886", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1366368/" ]
My answer is only valid if you use the MFC Ribbon Bar implementation or the BCG implementation. The major reason why the style flags do'nt effect a ribbon bar implementation is that the ribbon bar draws its own NC area. There is in fact no "Window caption". You need to initialize your CMFCRibbonBar with the bReplaceFr...
Will this do? The following code produces what you see in the image below. I chose an event in the child window to demo the code. ``` void CChildFrame::OnSysCommand(UINT nID, LPARAM lParam) { // TODO: Add your message handler code here and/or call default CMDIChildWnd::OnSysCommand(nID, lParam); CMDI...
42,854,517
I used Asynctasks to verify some inputs on EditTexts, the problem is, even the asynctasks are in doinbackground() part, when I press the button next, it will go to the next activity. My problem is I used asynctasks for verifications. Here is my code for Next Button: ``` @Override public void onNextClicked(StepperLay...
2017/03/17
[ "https://Stackoverflow.com/questions/42854517", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5865438/" ]
``` f2 = edtAppCategoryET(sAppCategory); f3 = edtAppPlatformET(sAppPlatform); f4 = edtAppDescriptionET(sAppDescription); f5 = edtAppVersionET(sAppVersion); if (!f1 && !f2 && !f3 && !f4 && !f5) { bundleData = new Bundle(); bundleData.putString("appName", sAppName); bundleDat...
Try this code: ``` StepperLayout.OnNextClickedCallback mCallback; ``` --- ``` @Override public void onNextClicked(StepperLayout.OnNextClickedCallback callback) { mCallback = callback; getData(); new VerifyAppNameTask().execute(sAppName); } ``` --- ``` private void yourMethod(...
42,854,517
I used Asynctasks to verify some inputs on EditTexts, the problem is, even the asynctasks are in doinbackground() part, when I press the button next, it will go to the next activity. My problem is I used asynctasks for verifications. Here is my code for Next Button: ``` @Override public void onNextClicked(StepperLay...
2017/03/17
[ "https://Stackoverflow.com/questions/42854517", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5865438/" ]
``` f2 = edtAppCategoryET(sAppCategory); f3 = edtAppPlatformET(sAppPlatform); f4 = edtAppDescriptionET(sAppDescription); f5 = edtAppVersionET(sAppVersion); if (!f1 && !f2 && !f3 && !f4 && !f5) { bundleData = new Bundle(); bundleData.putString("appName", sAppName); bundleDat...
1. Declared a boolean in your AsyncTask name 'isFinish'. 2. Set it true in onPostExecute() 3. Check isFinish before start next Activity This is my sample ``` nextButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { if (null != asyncTask && asyncTask...
22,822,862
again. Im traying to control a set of data that have to begin with a 22 CodeId (GO) and finish with a 23 CodeId (STOP). Sometimes the data can come like the example. So, I have to check the first record to see if is CodeId = 23 then delete this record, and with the last record if CodeId = 22 Then delete the record. The...
2014/04/02
[ "https://Stackoverflow.com/questions/22822862", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3479449/" ]
``` ;With CTE AS ( SELECT [DATE],DriverId, CodeId, , ROW_NUMBER() OVER (ORDER BY [DATE] ASC) rn_Stop , ROW_NUMBER() OVER (ORDER BY [DATE] DESC) rn_Go FROM Table_Name ) DELETE FROM CTE WHERE (rn_Stop = 1 AND CodeId = 23) OR (rn_Go = 1 AND CodeId = 22) ```
I think this code will help you : ``` IF CURSOR_STATUS('global','cur_test')=1 CLOSE cur_test IF CURSOR_STATUS('global','cur_test')=-1 DEALLOCATE cur_test; DECLARE @v_DriverId INT ,@v_CodeId INT DECLARE cur_test CURSOR FOR SELECT DriverId, CodeId FROM #tbl ORDER ...
45,200,819
I am trying to fill a text box but I am getting unable to locate element. I have tried finding the element * by class * by name * Added 10 secs wait But I am still getting the same error. **Here is HTML** ``` <div class="innerWrap"> <textarea aria-autocomplete="list" aria-controls="typeahead_list_u_0_j"...
2017/07/19
[ "https://Stackoverflow.com/questions/45200819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3609329/" ]
So I was finally able to find the element and fix the above error by looking at the page source. ``` print(driver.page_source) ``` Page source showed the name of element was `message` and not `message_text`. However inspect element in browser still shows `message_text`.
This question has been answered before but the doc links that the answer points to is outdated, so here is the new updated ["switch to"/switch commands selenium docs](http://toolsqa.com/selenium-webdriver/switch-commands/) link You need to use this command to switch your driver so that it runs in the correct window/fr...
1,766,867
I want to create a file, and write endless data to it until the disk is full. how can i do it from the command line? thought about something like: ``` copy con somefile.dat dir/s (or somthing else, endless) | somefile.dat ``` (windows powershell commands are also welcomed)
2023/02/04
[ "https://superuser.com/questions/1766867", "https://superuser.com", "https://superuser.com/users/105240/" ]
Open Powershell and enter the following cmdlets and commands: ```ps ### Get C drive remaining free space [uint64]$a = Get-Volume | Where DriveLetter -eq "C" | Select -ExpandProperty SizeRemaining # Create a new file with its size equals to the free space fsutil file createnew test.txt $a ``` This assumes that you ar...
Echoing to a file in an infinite loop will (in the end) fill the disk completely. ``` @echo off :loop echo 1 >> c:\file goto loop ``` This does in theory answer your question, but it has no real world use cases as it will probably take days to fill an average disk with it. The Powershell script proposed by Reddy Lut...
2,960,101
``` var blockGraphics : Graphics = null; blockGraphics.clear(); blockGraphics.beginFill(255); blockGraphics.drawRect(10,10,10,10); ``` I am trying to simply draw a rectangle but nothing appears on the screen. What am i missing?
2010/06/02
[ "https://Stackoverflow.com/questions/2960101", "https://Stackoverflow.com", "https://Stackoverflow.com/users/330731/" ]
Afaik you can't instantiate graphics class.. you need to make a MovieClip or Sprite and work with that.. you can't draw directly to stage. ``` var mc:MovieClip = new MovieClip(); mc.graphics.beginFill(0xFF0000); mc.graphics.drawRect(10,10,10,10); mc.graphics.endFill(); ``` also don't forget to add it to stage ``` a...
I don't really know a whole lot about the graphics class (I've used it a few times) but I don't believe you can call ANYTHING on a null object. ``` blockGraphics = null; blockGraphics.clear(); ``` is the same as calling: ``` null.clear(); ``` Which is going to give you an error. Typically you'll want to take a mo...
2,960,101
``` var blockGraphics : Graphics = null; blockGraphics.clear(); blockGraphics.beginFill(255); blockGraphics.drawRect(10,10,10,10); ``` I am trying to simply draw a rectangle but nothing appears on the screen. What am i missing?
2010/06/02
[ "https://Stackoverflow.com/questions/2960101", "https://Stackoverflow.com", "https://Stackoverflow.com/users/330731/" ]
``` var mySprite:Sprite = new Sprite(); mySprite.graphics.beginFill(0x000000); mySprite.graphics.drawRect(10, 10, 10, 10); mySprite.graphics.endFill(); addChild(mySprite); ```
I don't really know a whole lot about the graphics class (I've used it a few times) but I don't believe you can call ANYTHING on a null object. ``` blockGraphics = null; blockGraphics.clear(); ``` is the same as calling: ``` null.clear(); ``` Which is going to give you an error. Typically you'll want to take a mo...
2,960,101
``` var blockGraphics : Graphics = null; blockGraphics.clear(); blockGraphics.beginFill(255); blockGraphics.drawRect(10,10,10,10); ``` I am trying to simply draw a rectangle but nothing appears on the screen. What am i missing?
2010/06/02
[ "https://Stackoverflow.com/questions/2960101", "https://Stackoverflow.com", "https://Stackoverflow.com/users/330731/" ]
Afaik you can't instantiate graphics class.. you need to make a MovieClip or Sprite and work with that.. you can't draw directly to stage. ``` var mc:MovieClip = new MovieClip(); mc.graphics.beginFill(0xFF0000); mc.graphics.drawRect(10,10,10,10); mc.graphics.endFill(); ``` also don't forget to add it to stage ``` a...
``` var mySprite:Sprite = new Sprite(); mySprite.graphics.beginFill(0x000000); mySprite.graphics.drawRect(10, 10, 10, 10); mySprite.graphics.endFill(); addChild(mySprite); ```
7,668,760
I'm working with backbone.js building some complex view relationships, and I'm wondering if there are any problems from a javascript performance standpoint of doing something that looks like this: ``` var viewOne = Backbone.View.extend({ tagName : 'li', initialize : function() { this.v2...
2011/10/05
[ "https://Stackoverflow.com/questions/7668760", "https://Stackoverflow.com", "https://Stackoverflow.com/users/525714/" ]
Having a parent view responsible for child views is not a bad idea and is quite a common scenario in backbone. The problem I see with the code above is the fact that the child view has knowledge of its parent view. I would suggest using custom events in the viewTwo and have viewOne bind to those events and then respond...
Nesting is a good way of maintaining hierarchical views for writing maintainable code for complex user interfaces. In the simple example there are hardly any performance issues but in more complex situations you do need to keep in mind how deep your nesting goes. For example using complex cell-renderers improperly in ...
7,668,760
I'm working with backbone.js building some complex view relationships, and I'm wondering if there are any problems from a javascript performance standpoint of doing something that looks like this: ``` var viewOne = Backbone.View.extend({ tagName : 'li', initialize : function() { this.v2...
2011/10/05
[ "https://Stackoverflow.com/questions/7668760", "https://Stackoverflow.com", "https://Stackoverflow.com/users/525714/" ]
Having a parent view responsible for child views is not a bad idea and is quite a common scenario in backbone. The problem I see with the code above is the fact that the child view has knowledge of its parent view. I would suggest using custom events in the viewTwo and have viewOne bind to those events and then respond...
Circular references are a bad idea. It is also not good practice, as Kyle said, that a child view have an explicit reference to its parent view. Explicit references should go DOWN the view hierarchy only. That is, it is fine, and typical, for a parent view to have explicit references to all its child views, and to call...
7,668,760
I'm working with backbone.js building some complex view relationships, and I'm wondering if there are any problems from a javascript performance standpoint of doing something that looks like this: ``` var viewOne = Backbone.View.extend({ tagName : 'li', initialize : function() { this.v2...
2011/10/05
[ "https://Stackoverflow.com/questions/7668760", "https://Stackoverflow.com", "https://Stackoverflow.com/users/525714/" ]
Circular references are a bad idea. It is also not good practice, as Kyle said, that a child view have an explicit reference to its parent view. Explicit references should go DOWN the view hierarchy only. That is, it is fine, and typical, for a parent view to have explicit references to all its child views, and to call...
Nesting is a good way of maintaining hierarchical views for writing maintainable code for complex user interfaces. In the simple example there are hardly any performance issues but in more complex situations you do need to keep in mind how deep your nesting goes. For example using complex cell-renderers improperly in ...
12,998,196
If I large my browser then my div header width don’t show 100%. But I set my div header width 100%. Please can someone point out what I may be doing wrong here? Many thanks. Here is my code: ``` <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Welcome Page</title> <link rel="sh...
2012/10/21
[ "https://Stackoverflow.com/questions/12998196", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1493448/" ]
You probably have subtle synchronization errors here: 1. As Jonathan pointed out `raw_data` has lost its qualifier inside the function. Using a `volatile` variable in such a way is undefined behavior, even if there is no signal handler involved. 2. It seems in addition that your data is touched asynchronously by a sig...
When compiled the code (GCC 4.7.1 on Mac OS X 10.7.5), I get a warning: ``` warning: passing argument 2 of ‘get_acc’ discards ‘volatile’ qualifier from pointer target type [enabled by default] note: expected ‘float32_t *’ but argument is of type ‘volatile float32_t *’ ``` I'm not sure that this accounts for your tro...
10,571,983
lets say I have a timer activity. Theres an image view that displays a number of 0 - 9(these are viewed as images, NOT text). eg. the images names are clock\_0, clock\_1, clock\_2...clock\_9. There is a plus and minus button that should change a counter(to pick the image). If current image is clock\_0, pressing the plu...
2012/05/13
[ "https://Stackoverflow.com/questions/10571983", "https://Stackoverflow.com", "https://Stackoverflow.com/users/871956/" ]
To be more specific, in `admin.py` of any app inside `INSTALLED_APPS` **after** `'djcelery'` ``` from django.contrib import admin from djcelery.models import ( TaskState, WorkerState, PeriodicTask, IntervalSchedule, CrontabSchedule) admin.site.unregister(TaskState) admin.site.unregister(WorkerState) admin.si...
You can simply unregister celerys models like admin.site.unregister(CeleryModelIdoNotWantInAdmin)
10,571,983
lets say I have a timer activity. Theres an image view that displays a number of 0 - 9(these are viewed as images, NOT text). eg. the images names are clock\_0, clock\_1, clock\_2...clock\_9. There is a plus and minus button that should change a counter(to pick the image). If current image is clock\_0, pressing the plu...
2012/05/13
[ "https://Stackoverflow.com/questions/10571983", "https://Stackoverflow.com", "https://Stackoverflow.com/users/871956/" ]
Updated version looks like: ``` from django_celery_beat.models import ( IntervalSchedule, CrontabSchedule, SolarSchedule, ClockedSchedule, PeriodicTask, ) admin.site.unregister(SolarSchedule) admin.site.unregister(ClockedSchedule) admin.site.unregister(PeriodicTask) admin.site.unregister(IntervalS...
You can simply unregister celerys models like admin.site.unregister(CeleryModelIdoNotWantInAdmin)
10,571,983
lets say I have a timer activity. Theres an image view that displays a number of 0 - 9(these are viewed as images, NOT text). eg. the images names are clock\_0, clock\_1, clock\_2...clock\_9. There is a plus and minus button that should change a counter(to pick the image). If current image is clock\_0, pressing the plu...
2012/05/13
[ "https://Stackoverflow.com/questions/10571983", "https://Stackoverflow.com", "https://Stackoverflow.com/users/871956/" ]
To be more specific, in `admin.py` of any app inside `INSTALLED_APPS` **after** `'djcelery'` ``` from django.contrib import admin from djcelery.models import ( TaskState, WorkerState, PeriodicTask, IntervalSchedule, CrontabSchedule) admin.site.unregister(TaskState) admin.site.unregister(WorkerState) admin.si...
Updated version looks like: ``` from django_celery_beat.models import ( IntervalSchedule, CrontabSchedule, SolarSchedule, ClockedSchedule, PeriodicTask, ) admin.site.unregister(SolarSchedule) admin.site.unregister(ClockedSchedule) admin.site.unregister(PeriodicTask) admin.site.unregister(IntervalS...
8,851
I'm looking to wire up the second floor of my house and the cold air return provides a convenient, straight run from the office to the utility room. Is it safe and within code to run ethernet cable in the air return? The air returns are not metal ducts, they are just open cavities in the studs. Scope of this question...
2011/09/10
[ "https://diy.stackexchange.com/questions/8851", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/1055/" ]
Looking in [2011 National Electric Code Changes of Interest](http://www.cccassoc.org/blog/wp-content/uploads/2010/11/CCCA_2011_NEC_White_Paper_11-04-2010.pdf), they reference NFPA 90A-2009 : > > Section 4.3.4 of NFPA 90A-2009 states that “Wiring shall not be installed in air ducts” unless it is “directly associated w...
Yes, it is within code to run a low voltage wire inside an air return (aka plenum) in the US. You'll even find cable that is "plenum rated" -- which means it has a lighter jacket on it -- that is specifically meant for use in plenums where it's less likely to encounter sharp edges or be overly stretched during pulls. (...
8,851
I'm looking to wire up the second floor of my house and the cold air return provides a convenient, straight run from the office to the utility room. Is it safe and within code to run ethernet cable in the air return? The air returns are not metal ducts, they are just open cavities in the studs. Scope of this question...
2011/09/10
[ "https://diy.stackexchange.com/questions/8851", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/1055/" ]
> > National Electrical Code 2008 > ============================= > > > **300.22 Wiring in Ducts, Plenums, and Other Air-Handling Spaces.** > > **(B) Ducts or Plenums Used for Environmental Air.** Only wiring methods consisting of Type MI cable, Type MC cable employing a smooth > or corrugated impervious metal sh...
Yes, it is within code to run a low voltage wire inside an air return (aka plenum) in the US. You'll even find cable that is "plenum rated" -- which means it has a lighter jacket on it -- that is specifically meant for use in plenums where it's less likely to encounter sharp edges or be overly stretched during pulls. (...
8,851
I'm looking to wire up the second floor of my house and the cold air return provides a convenient, straight run from the office to the utility room. Is it safe and within code to run ethernet cable in the air return? The air returns are not metal ducts, they are just open cavities in the studs. Scope of this question...
2011/09/10
[ "https://diy.stackexchange.com/questions/8851", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/1055/" ]
> > National Electrical Code 2008 > ============================= > > > **300.22 Wiring in Ducts, Plenums, and Other Air-Handling Spaces.** > > **(B) Ducts or Plenums Used for Environmental Air.** Only wiring methods consisting of Type MI cable, Type MC cable employing a smooth > or corrugated impervious metal sh...
Looking in [2011 National Electric Code Changes of Interest](http://www.cccassoc.org/blog/wp-content/uploads/2010/11/CCCA_2011_NEC_White_Paper_11-04-2010.pdf), they reference NFPA 90A-2009 : > > Section 4.3.4 of NFPA 90A-2009 states that “Wiring shall not be installed in air ducts” unless it is “directly associated w...
63,618,167
So i have created a webpage using react which generates random quotes. This is the code for the web page: ```css @import url('https://fonts.googleapis.com/css2?family=Lora:ital@1&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Lato:wght@300&display=swap'); @import url('https://fonts.googleapis.co...
2020/08/27
[ "https://Stackoverflow.com/questions/63618167", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11853158/" ]
> > Is there a way of assigning automatically the pvc which has the pv in > the node where the pod has been allocated? > > > It depends what you exactly mean by *"assigning automatically the pvc"* but I believe that [local volume](https://kubernetes.io/docs/concepts/storage/volumes/#local) should meet your require...
You can choose which nodes' PV's bind to which PVCs using `nodeAffinity` <https://kubernetes.io/docs/concepts/storage/persistent-volumes/#node-affinity> Claims can also specify a selector which will limit the pool of PVs: <https://kubernetes.io/docs/concepts/storage/persistent-volumes/#selector>
32,015,936
I have a problem with anchor and reload page. When we open my page, we go to a anchor to skip the header and go directly in the content (because a animation start in the content and I want the user see it) After animation stop, a button appear the replay the same animation. So I want to reload the page and go the the...
2015/08/14
[ "https://Stackoverflow.com/questions/32015936", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4139279/" ]
it worked for me ``` <a href="pagelink#hashcontent" onclick="window.location.reload()">Reload</a> ```
> > the button (appear after the animation): > > > Does it appear because it's dynamically added? If so, your jquery trigger is slightly off. ``` $('.page-gagnants-animation .rejouer').on('click', function(){ ``` should be ``` $('.page-gagnants-animation').on('click', " .rejouer", function(){ ``` because [.o...
225,476
As mentioned above this is not about jump drives, this is about ships that physically jump. Writing science fiction, trying not to handwave *too* much, so I want to check if this is a feasible tech. Orbit Jumpers are ships used on small planets with <1 gravities and/or asteroids large enough for a gravitational pull....
2022/03/10
[ "https://worldbuilding.stackexchange.com/questions/225476", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/94885/" ]
**If you can't survive crash-landing from space, you can't survive jumping to space.** An interesting and useful property of orbital trajectories is that they are reversible in time. If you want to start from the ground and launch yourself into space with one sudden impulse, that is essentially the same as a time-reve...
No, not without making astronaut-salsa ====================================== Earth's escape velocity is around 11 kilometers per second. This is *blisteringly* fast. To calculate the acceleration that would be needed to achieve that speed in a single jump, you can use a kinematics formula: $$\frac{v^2}{2\Delta x} =...
225,476
As mentioned above this is not about jump drives, this is about ships that physically jump. Writing science fiction, trying not to handwave *too* much, so I want to check if this is a feasible tech. Orbit Jumpers are ships used on small planets with <1 gravities and/or asteroids large enough for a gravitational pull....
2022/03/10
[ "https://worldbuilding.stackexchange.com/questions/225476", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/94885/" ]
If you have very long legs, yes. Spreading out the force over a long distance means you need less power (and will incur less $v^3$ air resistance. If you wanted short legs they'd have to be telescopic, but then you'd have to fill them with gas as they extend, which would incur friction at the entry point. You could su...
**OPTION 1: GRAVITATIONAL SLINGSHOTS** Potentially, you could have a ship that uses centrifugal force and the gravitational pull of a planet to sling itself around a planet. This maneuver has been done by real-world interstellar vessels before. **OPTION 2: ONE BIG GUN** If you aren't afraid of making your novel seem...
225,476
As mentioned above this is not about jump drives, this is about ships that physically jump. Writing science fiction, trying not to handwave *too* much, so I want to check if this is a feasible tech. Orbit Jumpers are ships used on small planets with <1 gravities and/or asteroids large enough for a gravitational pull....
2022/03/10
[ "https://worldbuilding.stackexchange.com/questions/225476", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/94885/" ]
**If you can't survive crash-landing from space, you can't survive jumping to space.** An interesting and useful property of orbital trajectories is that they are reversible in time. If you want to start from the ground and launch yourself into space with one sudden impulse, that is essentially the same as a time-reve...
When it comes to space everything comes down to delta V, how much ability something has to change it's velocity. For instance it takes roughly 9.4 km/s of delta V to get to low earth orbit from earth. Getting to the moon will take roughly another 6 km/s of delta V. If you were going to jump from the earth to the moon y...
225,476
As mentioned above this is not about jump drives, this is about ships that physically jump. Writing science fiction, trying not to handwave *too* much, so I want to check if this is a feasible tech. Orbit Jumpers are ships used on small planets with <1 gravities and/or asteroids large enough for a gravitational pull....
2022/03/10
[ "https://worldbuilding.stackexchange.com/questions/225476", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/94885/" ]
No, not without making astronaut-salsa ====================================== Earth's escape velocity is around 11 kilometers per second. This is *blisteringly* fast. To calculate the acceleration that would be needed to achieve that speed in a single jump, you can use a kinematics formula: $$\frac{v^2}{2\Delta x} =...
**OPTION 1: GRAVITATIONAL SLINGSHOTS** Potentially, you could have a ship that uses centrifugal force and the gravitational pull of a planet to sling itself around a planet. This maneuver has been done by real-world interstellar vessels before. **OPTION 2: ONE BIG GUN** If you aren't afraid of making your novel seem...
225,476
As mentioned above this is not about jump drives, this is about ships that physically jump. Writing science fiction, trying not to handwave *too* much, so I want to check if this is a feasible tech. Orbit Jumpers are ships used on small planets with <1 gravities and/or asteroids large enough for a gravitational pull....
2022/03/10
[ "https://worldbuilding.stackexchange.com/questions/225476", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/94885/" ]
When it comes to space everything comes down to delta V, how much ability something has to change it's velocity. For instance it takes roughly 9.4 km/s of delta V to get to low earth orbit from earth. Getting to the moon will take roughly another 6 km/s of delta V. If you were going to jump from the earth to the moon y...
**OPTION 1: GRAVITATIONAL SLINGSHOTS** Potentially, you could have a ship that uses centrifugal force and the gravitational pull of a planet to sling itself around a planet. This maneuver has been done by real-world interstellar vessels before. **OPTION 2: ONE BIG GUN** If you aren't afraid of making your novel seem...
225,476
As mentioned above this is not about jump drives, this is about ships that physically jump. Writing science fiction, trying not to handwave *too* much, so I want to check if this is a feasible tech. Orbit Jumpers are ships used on small planets with <1 gravities and/or asteroids large enough for a gravitational pull....
2022/03/10
[ "https://worldbuilding.stackexchange.com/questions/225476", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/94885/" ]
**If you can't survive crash-landing from space, you can't survive jumping to space.** An interesting and useful property of orbital trajectories is that they are reversible in time. If you want to start from the ground and launch yourself into space with one sudden impulse, that is essentially the same as a time-reve...
Possible yes. Feasible no. -------------------------- > > Similar to a railgun in design, but much less power. > > > Exactly. You have mostly answered your own question. Also taking this to apply to places with gravity below 1/3g ### Analogous to gun launch. Essentially the question is asking the feasibility o...
225,476
As mentioned above this is not about jump drives, this is about ships that physically jump. Writing science fiction, trying not to handwave *too* much, so I want to check if this is a feasible tech. Orbit Jumpers are ships used on small planets with <1 gravities and/or asteroids large enough for a gravitational pull....
2022/03/10
[ "https://worldbuilding.stackexchange.com/questions/225476", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/94885/" ]
Possible yes. Feasible no. -------------------------- > > Similar to a railgun in design, but much less power. > > > Exactly. You have mostly answered your own question. Also taking this to apply to places with gravity below 1/3g ### Analogous to gun launch. Essentially the question is asking the feasibility o...
If you have very long legs, yes. Spreading out the force over a long distance means you need less power (and will incur less $v^3$ air resistance. If you wanted short legs they'd have to be telescopic, but then you'd have to fill them with gas as they extend, which would incur friction at the entry point. You could su...
225,476
As mentioned above this is not about jump drives, this is about ships that physically jump. Writing science fiction, trying not to handwave *too* much, so I want to check if this is a feasible tech. Orbit Jumpers are ships used on small planets with <1 gravities and/or asteroids large enough for a gravitational pull....
2022/03/10
[ "https://worldbuilding.stackexchange.com/questions/225476", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/94885/" ]
No, not without making astronaut-salsa ====================================== Earth's escape velocity is around 11 kilometers per second. This is *blisteringly* fast. To calculate the acceleration that would be needed to achieve that speed in a single jump, you can use a kinematics formula: $$\frac{v^2}{2\Delta x} =...
If you have very long legs, yes. Spreading out the force over a long distance means you need less power (and will incur less $v^3$ air resistance. If you wanted short legs they'd have to be telescopic, but then you'd have to fill them with gas as they extend, which would incur friction at the entry point. You could su...
225,476
As mentioned above this is not about jump drives, this is about ships that physically jump. Writing science fiction, trying not to handwave *too* much, so I want to check if this is a feasible tech. Orbit Jumpers are ships used on small planets with <1 gravities and/or asteroids large enough for a gravitational pull....
2022/03/10
[ "https://worldbuilding.stackexchange.com/questions/225476", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/94885/" ]
**If you can't survive crash-landing from space, you can't survive jumping to space.** An interesting and useful property of orbital trajectories is that they are reversible in time. If you want to start from the ground and launch yourself into space with one sudden impulse, that is essentially the same as a time-reve...
**OPTION 1: GRAVITATIONAL SLINGSHOTS** Potentially, you could have a ship that uses centrifugal force and the gravitational pull of a planet to sling itself around a planet. This maneuver has been done by real-world interstellar vessels before. **OPTION 2: ONE BIG GUN** If you aren't afraid of making your novel seem...
225,476
As mentioned above this is not about jump drives, this is about ships that physically jump. Writing science fiction, trying not to handwave *too* much, so I want to check if this is a feasible tech. Orbit Jumpers are ships used on small planets with <1 gravities and/or asteroids large enough for a gravitational pull....
2022/03/10
[ "https://worldbuilding.stackexchange.com/questions/225476", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/94885/" ]
When it comes to space everything comes down to delta V, how much ability something has to change it's velocity. For instance it takes roughly 9.4 km/s of delta V to get to low earth orbit from earth. Getting to the moon will take roughly another 6 km/s of delta V. If you were going to jump from the earth to the moon y...
If you have very long legs, yes. Spreading out the force over a long distance means you need less power (and will incur less $v^3$ air resistance. If you wanted short legs they'd have to be telescopic, but then you'd have to fill them with gas as they extend, which would incur friction at the entry point. You could su...
115,290
I've just bought Age of Empires II: HD, and have been running through the tutorial missions to re-skill up (it's been a while since I played the original). On the last map of the tutorial I built up a sizeable army and told them to move toward the enemy base, however I couldn't figure out how to tell them to attack-mov...
2013/04/27
[ "https://gaming.stackexchange.com/questions/115290", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/28182/" ]
This answer applies to all AoE 2 variants, from the original to the Conquerors expansion to the HD release. There is no attack-move in AoE 2. Right-clicking on an enemy unit will order your military units to pursue and attack that unit, ignoring everything else along the way. If the target moves out of line of sight or...
On the advanced commands panel,there is a button called "attack-move".It was added in "The Forgotten".
115,290
I've just bought Age of Empires II: HD, and have been running through the tutorial missions to re-skill up (it's been a while since I played the original). On the last map of the tutorial I built up a sizeable army and told them to move toward the enemy base, however I couldn't figure out how to tell them to attack-mov...
2013/04/27
[ "https://gaming.stackexchange.com/questions/115290", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/28182/" ]
The expansion [The Forgotten](http://store.steampowered.com/app/239550/) now includes an attack-move command, which is bound to tab.
On the advanced commands panel,there is a button called "attack-move".It was added in "The Forgotten".
56,977,836
I have stupid problem with RxJava2. I need to run two long operations at the same time. I know that I should use Observable.zip() and I use it. The problem, that my long operations is run one after another and another problem that my long operations starting before I subscribe to them. Let's imagine that this is my ...
2019/07/10
[ "https://Stackoverflow.com/questions/56977836", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3136295/" ]
`Observable.just` doesn't run anything when you subscribe. It emits the elements when you subscribe, but your `doSomethingLong` will run as soon as you pass it as an argument. That's normal and it's how the language works. What you're looking for is a way to say return this when we subscribe, but also only run it at t...
Create your Observables as Observable.fromCallable{}. And instead of zip use combineLatest() Docs: <http://reactivex.io/RxJava/javadoc/io/reactivex/Observable.html#fromCallable-java.util.concurrent.Callable-> <http://reactivex.io/documentation/operators/combinelatest.html>
14,705,064
Suppose i have a source class: ``` public class Source { //Several properties that can be mapped to DerivedBase and its subclasses } ``` And some destination classes: ``` public class DestinationBase { //Several properties } public class DestinationDerived1 : DestinationBase { //Several properties } ...
2013/02/05
[ "https://Stackoverflow.com/questions/14705064", "https://Stackoverflow.com", "https://Stackoverflow.com/users/430800/" ]
Include derived mappings into base mapping: ``` Mapper.CreateMap<Source, DestinationBase>() .ForMember(d => d.Id, op => op.MapFrom(s => s.Id)) // you can remove this .Include<Source, DestinationDerived1>() .Include<Source, DestinationDerived2>(); Mapper.CreateMap<Source, DestinationDerived1>() .ForMem...
**For Automapper 8.0**. Current version has new method [IncludeAllDerived](http://docs.automapper.org/en/stable/Mapping-inheritance.html#mapping-inheritance) Here's working example: ``` var config = new MapperConfiguration(cfg => { cfg.CreateMap<Source, DestinationBase>() ...
14,705,064
Suppose i have a source class: ``` public class Source { //Several properties that can be mapped to DerivedBase and its subclasses } ``` And some destination classes: ``` public class DestinationBase { //Several properties } public class DestinationDerived1 : DestinationBase { //Several properties } ...
2013/02/05
[ "https://Stackoverflow.com/questions/14705064", "https://Stackoverflow.com", "https://Stackoverflow.com/users/430800/" ]
Include derived mappings into base mapping: ``` Mapper.CreateMap<Source, DestinationBase>() .ForMember(d => d.Id, op => op.MapFrom(s => s.Id)) // you can remove this .Include<Source, DestinationDerived1>() .Include<Source, DestinationDerived2>(); Mapper.CreateMap<Source, DestinationDerived1>() .ForMem...
NB! For those who are having issues with derived interfaces. AutoMapper does not support registering against derived interfaces. Only classes are handled. To make it work, you have to change your type reference for CreateMap to the class instead of interface. Example: ``` interface Interface1 {} class Class1: Interf...
14,705,064
Suppose i have a source class: ``` public class Source { //Several properties that can be mapped to DerivedBase and its subclasses } ``` And some destination classes: ``` public class DestinationBase { //Several properties } public class DestinationDerived1 : DestinationBase { //Several properties } ...
2013/02/05
[ "https://Stackoverflow.com/questions/14705064", "https://Stackoverflow.com", "https://Stackoverflow.com/users/430800/" ]
**For Automapper 8.0**. Current version has new method [IncludeAllDerived](http://docs.automapper.org/en/stable/Mapping-inheritance.html#mapping-inheritance) Here's working example: ``` var config = new MapperConfiguration(cfg => { cfg.CreateMap<Source, DestinationBase>() ...
NB! For those who are having issues with derived interfaces. AutoMapper does not support registering against derived interfaces. Only classes are handled. To make it work, you have to change your type reference for CreateMap to the class instead of interface. Example: ``` interface Interface1 {} class Class1: Interf...
24,849,699
Suppose I have a column in a data frame as colors say `c("Red", "Blue", "Blue", "Orange")`. I would like to get it as `c(1,2,2,3)`. ``` Red as 1 Blue as 2 Orange as 3 ``` Is there a simpler way of doing this other than the obvious if/else or switch functions?
2014/07/20
[ "https://Stackoverflow.com/questions/24849699", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2500871/" ]
Set up a named vector, describing the link between colour and integers (i.e. specifically how the strings map to the integers): ``` colors=c(1,2,3) names(colors)=c("Red", "Blue", "Orange") ``` Now use the named vector to generate a list of numbers associated with the colours in your data frame: ``` >colors[c("Red",...
I must be missing something, but this method would work I believe. Having coerced your column with words (below, "names") to a factor, you `revalue` them by your numbers in "colors". ``` require(plyr) colors <- c("1","2","3") names <- c("Red", "Blue", "Orange") df <- data.frame(names, colors) df$names <- as.factor(df...
24,849,699
Suppose I have a column in a data frame as colors say `c("Red", "Blue", "Blue", "Orange")`. I would like to get it as `c(1,2,2,3)`. ``` Red as 1 Blue as 2 Orange as 3 ``` Is there a simpler way of doing this other than the obvious if/else or switch functions?
2014/07/20
[ "https://Stackoverflow.com/questions/24849699", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2500871/" ]
Set up a named vector, describing the link between colour and integers (i.e. specifically how the strings map to the integers): ``` colors=c(1,2,3) names(colors)=c("Red", "Blue", "Orange") ``` Now use the named vector to generate a list of numbers associated with the colours in your data frame: ``` >colors[c("Red",...
Using *car::recode()* function: ``` library(car) recode(x, "'Red'=1; 'Blue'=2; 'Orange'=3;") # [1] 1 2 2 3 ```
24,849,699
Suppose I have a column in a data frame as colors say `c("Red", "Blue", "Blue", "Orange")`. I would like to get it as `c(1,2,2,3)`. ``` Red as 1 Blue as 2 Orange as 3 ``` Is there a simpler way of doing this other than the obvious if/else or switch functions?
2014/07/20
[ "https://Stackoverflow.com/questions/24849699", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2500871/" ]
Set up a named vector, describing the link between colour and integers (i.e. specifically how the strings map to the integers): ``` colors=c(1,2,3) names(colors)=c("Red", "Blue", "Orange") ``` Now use the named vector to generate a list of numbers associated with the colours in your data frame: ``` >colors[c("Red",...
Here is a function based on previous code: ``` # Recode 'string' into 'integer' recode_str_int <- function(df, feature) { # 1. Unique values # 1.1. 'string' values list_str <- sort(unique(df[, feature])) # 1.2. 'integer' values list_int <- 1:length(list_str) # 2. Create new feature # 2.1. Names na...
24,849,699
Suppose I have a column in a data frame as colors say `c("Red", "Blue", "Blue", "Orange")`. I would like to get it as `c(1,2,2,3)`. ``` Red as 1 Blue as 2 Orange as 3 ``` Is there a simpler way of doing this other than the obvious if/else or switch functions?
2014/07/20
[ "https://Stackoverflow.com/questions/24849699", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2500871/" ]
I must be missing something, but this method would work I believe. Having coerced your column with words (below, "names") to a factor, you `revalue` them by your numbers in "colors". ``` require(plyr) colors <- c("1","2","3") names <- c("Red", "Blue", "Orange") df <- data.frame(names, colors) df$names <- as.factor(df...
Using *car::recode()* function: ``` library(car) recode(x, "'Red'=1; 'Blue'=2; 'Orange'=3;") # [1] 1 2 2 3 ```
24,849,699
Suppose I have a column in a data frame as colors say `c("Red", "Blue", "Blue", "Orange")`. I would like to get it as `c(1,2,2,3)`. ``` Red as 1 Blue as 2 Orange as 3 ``` Is there a simpler way of doing this other than the obvious if/else or switch functions?
2014/07/20
[ "https://Stackoverflow.com/questions/24849699", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2500871/" ]
I must be missing something, but this method would work I believe. Having coerced your column with words (below, "names") to a factor, you `revalue` them by your numbers in "colors". ``` require(plyr) colors <- c("1","2","3") names <- c("Red", "Blue", "Orange") df <- data.frame(names, colors) df$names <- as.factor(df...
Here is a function based on previous code: ``` # Recode 'string' into 'integer' recode_str_int <- function(df, feature) { # 1. Unique values # 1.1. 'string' values list_str <- sort(unique(df[, feature])) # 1.2. 'integer' values list_int <- 1:length(list_str) # 2. Create new feature # 2.1. Names na...
24,849,699
Suppose I have a column in a data frame as colors say `c("Red", "Blue", "Blue", "Orange")`. I would like to get it as `c(1,2,2,3)`. ``` Red as 1 Blue as 2 Orange as 3 ``` Is there a simpler way of doing this other than the obvious if/else or switch functions?
2014/07/20
[ "https://Stackoverflow.com/questions/24849699", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2500871/" ]
Using *car::recode()* function: ``` library(car) recode(x, "'Red'=1; 'Blue'=2; 'Orange'=3;") # [1] 1 2 2 3 ```
Here is a function based on previous code: ``` # Recode 'string' into 'integer' recode_str_int <- function(df, feature) { # 1. Unique values # 1.1. 'string' values list_str <- sort(unique(df[, feature])) # 1.2. 'integer' values list_int <- 1:length(list_str) # 2. Create new feature # 2.1. Names na...
27,885,028
I had a lot of trouble trying to find a solution to this answer because it's hard to search specifically about it. I will try my best to explain it well though. Currently I have the following code: ``` for(int x = 0; x < 10000; x++){ for(int z = 0; z < 10000; z++){ if(!exists(x + ";" + z)){ ...
2015/01/11
[ "https://Stackoverflow.com/questions/27885028", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3457409/" ]
``` int len = 3; for (int i = 0; i < len; i++) { for (int j = 0; j <= i; j++) //println(i+";"+j); for (int k = i-1; k >= 0; k--) //println(k+";"+i); } ``` In the code above `len` serves the purpose of defining the length of a square (`len` is 3 above which represents a 3 x 3). In your own code you picked 10000 bu...
The algorithm you seem to be looking for is: ``` for(int distanceFromCorner = 0; distanceFromCorner < 10000; distanceFromCorner++) { for(int otherAxis = 0; otherAxis <= distanceFromCorner; otherAxis++) { if(!exists(distanceFromCorner + ";" + otherAxis)) return distanceFromCorner + ";" + otherAx...
24,729,921
I am making a program that interfaces with Teamspeak, and I have an issue where the responses received will not match the commands sent. I run the program multiple times and each time, I will get different results when they should be the same, due to responses being out of sync. ``` my $buf = ''; use IO::Socket; my $...
2014/07/14
[ "https://Stackoverflow.com/questions/24729921", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1490169/" ]
**You have missing (") double quote after this text myWidgetProvider.** ``` <receiver android:name="myWidgetProvider"> ```
Stupid mistake. I forgot to close the quote at : ``` <receiver android:name="myWidgetProvider"> ```
4,269,854
I'm trying to connect to a Rails Application Server that requires authentication. I am using the Jakarta HTTP Client for Java on a Desktop application and it works 100%. But when the exact same code is executed on the Android Emulator I get an IOException. Here is the code, and if anyone could help me figure out why i...
2010/11/24
[ "https://Stackoverflow.com/questions/4269854", "https://Stackoverflow.com", "https://Stackoverflow.com/users/519173/" ]
The reason it kept triggering the IOException was because the Manifest file didn't give the Application rights to the internet ``` <uses-permission android:name="android.permission.INTERNET"></uses-permission> ```
I'm using HttpPost for this kind of task, and never had any problem: ``` [...] DefaultHttpClient client = new DefaultHttpClient(); HttpPost httppost = new HttpPost(LOGIN_SERVLET_URI); List<BasicNameValuePair> params = new ArrayList<BasicNameValuePair>(); params.add(new BasicNameValuePair("userName", userName)); params...
69,603,149
i wanted to ask how will i make my text like the one in the image? Can someone help me? Thank you. This is the code i did so far. but it doesnt look like same This is my code: ```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=devic...
2021/10/17
[ "https://Stackoverflow.com/questions/69603149", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13580234/" ]
You're not going to get exactly the same as that image using the same font, because that reference looks to have the lines *outside* the text shape, rather than making the outline itself wider. Basically, a font is just a vector shape. If you make the outline visible as you have, you can see what the shape is. What yo...
**try to do it with text-shadow...** *here i'm adding 1px blue stroke* ``` text-shadow: -1px -1px 0 blue, 1px -1px 0 blue, -1px 1px 0 blue, 1px 1px 0 blue; ```
69,603,149
i wanted to ask how will i make my text like the one in the image? Can someone help me? Thank you. This is the code i did so far. but it doesnt look like same This is my code: ```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=devic...
2021/10/17
[ "https://Stackoverflow.com/questions/69603149", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13580234/" ]
You can stack as many `text-shadow` elements as you like in a CSS rule. Although you'll never get perfect results with fonts that have sharp external angles, you can get near-perfect results with rounded sans-serif fonts like the one you're using: ```css h2 { color: white; font-size: 6em; margin: 0; font-famil...
**try to do it with text-shadow...** *here i'm adding 1px blue stroke* ``` text-shadow: -1px -1px 0 blue, 1px -1px 0 blue, -1px 1px 0 blue, 1px 1px 0 blue; ```
69,603,149
i wanted to ask how will i make my text like the one in the image? Can someone help me? Thank you. This is the code i did so far. but it doesnt look like same This is my code: ```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=devic...
2021/10/17
[ "https://Stackoverflow.com/questions/69603149", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13580234/" ]
You can stack as many `text-shadow` elements as you like in a CSS rule. Although you'll never get perfect results with fonts that have sharp external angles, you can get near-perfect results with rounded sans-serif fonts like the one you're using: ```css h2 { color: white; font-size: 6em; margin: 0; font-famil...
You're not going to get exactly the same as that image using the same font, because that reference looks to have the lines *outside* the text shape, rather than making the outline itself wider. Basically, a font is just a vector shape. If you make the outline visible as you have, you can see what the shape is. What yo...
23,435,544
I'm setting up the following function in my iOS app: ``` - (IBAction)nextButton:(id)sender { if (self.itemSearch.text.length > 0) { [PFCloud callFunctionInBackground:@"eBayCategorySearch" withParameters:@{@"item": self.itemSearch.text} blo...
2014/05/02
[ "https://Stackoverflow.com/questions/23435544", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3561379/" ]
From the error message ``` -[__NSDictionaryM bytes]: unrecognized selector sent to instance ... ``` and the `NSLog()` output ``` '{ ... }' ``` one can see that the `result` is not a string (containing JSON data), but a `NSDictionary`. So there is no need to use `NSJSONSerialization`: ``` [PFCloud callFuncti...
You can't assign `NSString` directly to `NSData` like: ``` NSData *returnedJSONData = result; ``` Change that to: ``` NSData *returnedJSONData = [result dataUsingEncoding:NSUTF8StringEncoding]; ``` According to [callFunctionInBackground:withParameters:block:](https://www.parse.com/docs/ios/api/Classes/PFCloud.htm...
1,407
The community I'd like to create is based around [a fictional encyclopedia](http://terminusnation.wikidot.com), simply a wiki, powered by Wikidot. It's pretty close to what [the SCP Foundation guys](http://scp-wiki.net) do, in the content, but rather in the format instead. I know, the question seems self-answering in ...
2015/12/09
[ "https://moderators.stackexchange.com/questions/1407", "https://moderators.stackexchange.com", "https://moderators.stackexchange.com/users/1686/" ]
You picked something that is very hard to build: a wiki. The to-date biggest wiki-like site we know is Wikipedia. It shows the very basic principles of a wiki: * A wiki is a site for information sharing and collecting. * It's supposed to be based on scientific or generally accepted facts rather than opinions (oftentim...
The first way to advertise and build a community is making your own content. You should make some content on the Wiki before you are advertising it so everyone can see that you are just someone who wants to have a wiki and everyone else should do the work. Especially if there are other Community for this. When you are ...
198,938
Which file in `/proc` gets read by the kernel during the boot up process? This was a question on my LPIC 101 test that I think I might have answered wrong. I searched on google and some other places but wasn't able to find an answer. Hoping one of you could provide. Thanks!
2015/04/27
[ "https://unix.stackexchange.com/questions/198938", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/95779/" ]
> > My question is, which file in /proc gets read by the kernel during the boot up process? This was a question on my LPIC 101 test... > > > Sounds like a trick question. The files in `/proc` aren't real files on disk (this is why they have a size of 0) and the nodes don't exist until the kernel mounts a `procfs` ...
I think the answer they were looking for is /proc/cmdline "This file shows the parameters passed to the kernel at the time it is started. A sample /proc/cmdline file looks like the following: ro root=/dev/VolGroup00/LogVol00 rhgb quiet 3 This tells us that the kernel is mounted read-only (signified by (ro)), located o...
7,388,361
Is this possible to set different textSize in one TextView? I know that I can change text style using: ``` TextView textView = (TextView) findViewById(R.id.textView); Spannable span = new SpannableString(textView.getText()); span.setSpan(arg0, 1, 10, arg3); textView.setText(span) ``` I know the range start...end of ...
2011/09/12
[ "https://Stackoverflow.com/questions/7388361", "https://Stackoverflow.com", "https://Stackoverflow.com/users/845220/" ]
Try ``` span.setSpan(new RelativeSizeSpan(0.8f), start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); ```
I know very late to answer but people are still might have the same question.Even I struggled a lot on this. Suppose you have these two strings inside your strings.xml file ``` <string name="my_text">You will need a to complete this assembly</string> <string name="text_sub1">screwdriver, hammer, and measuring tape<...
7,388,361
Is this possible to set different textSize in one TextView? I know that I can change text style using: ``` TextView textView = (TextView) findViewById(R.id.textView); Spannable span = new SpannableString(textView.getText()); span.setSpan(arg0, 1, 10, arg3); textView.setText(span) ``` I know the range start...end of ...
2011/09/12
[ "https://Stackoverflow.com/questions/7388361", "https://Stackoverflow.com", "https://Stackoverflow.com/users/845220/" ]
Try ``` span.setSpan(new RelativeSizeSpan(0.8f), start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); ```
Try with **AbsoluteSizeSpan** ``` snackbarText.setSpan(new AbsoluteSizeSpan(fontsize, true), start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); ``` The complete code is: ``` SpannableStringBuilder snackbarText = new SpannableStringBuilder(); snackbarText.append("Your text"); snackbarText.setSpan(new AbsoluteSizeSpan(...
7,388,361
Is this possible to set different textSize in one TextView? I know that I can change text style using: ``` TextView textView = (TextView) findViewById(R.id.textView); Spannable span = new SpannableString(textView.getText()); span.setSpan(arg0, 1, 10, arg3); textView.setText(span) ``` I know the range start...end of ...
2011/09/12
[ "https://Stackoverflow.com/questions/7388361", "https://Stackoverflow.com", "https://Stackoverflow.com/users/845220/" ]
I know very late to answer but people are still might have the same question.Even I struggled a lot on this. Suppose you have these two strings inside your strings.xml file ``` <string name="my_text">You will need a to complete this assembly</string> <string name="text_sub1">screwdriver, hammer, and measuring tape<...
Try with **AbsoluteSizeSpan** ``` snackbarText.setSpan(new AbsoluteSizeSpan(fontsize, true), start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); ``` The complete code is: ``` SpannableStringBuilder snackbarText = new SpannableStringBuilder(); snackbarText.append("Your text"); snackbarText.setSpan(new AbsoluteSizeSpan(...
72,798,014
I was trying to write a java program where every digit of an input integer is printed in words. For example: *input* `123` should produce an *output* `"one two three"`. I wrote the following program that takes an integer value, then converts it into a string. I then iterated over the characters of the string and conv...
2022/06/29
[ "https://Stackoverflow.com/questions/72798014", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17644775/" ]
This is the place your code is failing at: ``` a = Integer.valueOf(s); ``` Instead of converting `'1'` to `1` as you were expecting, it converts `'1'` into the ascii equivalent, 49. To avoid this: ``` a = Character.getNumericValue(s); ``` This will convert `'1'` to `1`, and so on.
Change: ``` a = Integer.valueOf(s); ``` To: ``` a = s - '0'; ``` Subtracting `'0'` returns the int value of a digit character.
72,798,014
I was trying to write a java program where every digit of an input integer is printed in words. For example: *input* `123` should produce an *output* `"one two three"`. I wrote the following program that takes an integer value, then converts it into a string. I then iterated over the characters of the string and conv...
2022/06/29
[ "https://Stackoverflow.com/questions/72798014", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17644775/" ]
This is the place your code is failing at: ``` a = Integer.valueOf(s); ``` Instead of converting `'1'` to `1` as you were expecting, it converts `'1'` into the ascii equivalent, 49. To avoid this: ``` a = Character.getNumericValue(s); ``` This will convert `'1'` to `1`, and so on.
Here's the problem: There are two Integer.valueOf() methods: 1. `Integer.valueOf(int)` 2. `Integer.valueOf(String)` When you call valueOf on a character such as '5', the `Integer.valueOf(int)` is called. The `'5'` is casted to int which is 53 which is the ascii code for the character `'5'`. Your code: ``` for (int...
72,798,014
I was trying to write a java program where every digit of an input integer is printed in words. For example: *input* `123` should produce an *output* `"one two three"`. I wrote the following program that takes an integer value, then converts it into a string. I then iterated over the characters of the string and conv...
2022/06/29
[ "https://Stackoverflow.com/questions/72798014", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17644775/" ]
This is the place your code is failing at: ``` a = Integer.valueOf(s); ``` Instead of converting `'1'` to `1` as you were expecting, it converts `'1'` into the ascii equivalent, 49. To avoid this: ``` a = Character.getNumericValue(s); ``` This will convert `'1'` to `1`, and so on.
you are getting an error here ``` a = Integer.valueOf(s); ``` it converts char to their respective Unicode value. Instead of this code, you can use the below function. ``` Character.getNumericValue(); ``` Refer this link -> [Char to Int](https://www.javatpoint.com/java-char-to-int) You can also do ``` String c...
72,798,014
I was trying to write a java program where every digit of an input integer is printed in words. For example: *input* `123` should produce an *output* `"one two three"`. I wrote the following program that takes an integer value, then converts it into a string. I then iterated over the characters of the string and conv...
2022/06/29
[ "https://Stackoverflow.com/questions/72798014", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17644775/" ]
This is the place your code is failing at: ``` a = Integer.valueOf(s); ``` Instead of converting `'1'` to `1` as you were expecting, it converts `'1'` into the ascii equivalent, 49. To avoid this: ``` a = Character.getNumericValue(s); ``` This will convert `'1'` to `1`, and so on.
Firstly, lean about the [*primitive data types in Java*](https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html). If your background is JavaScript, which has no `char` type, you might have been thinking that `char` is a "kind of" string, but it's **not**. `char` - is a *16-bit **numeric*** primitive...
72,798,014
I was trying to write a java program where every digit of an input integer is printed in words. For example: *input* `123` should produce an *output* `"one two three"`. I wrote the following program that takes an integer value, then converts it into a string. I then iterated over the characters of the string and conv...
2022/06/29
[ "https://Stackoverflow.com/questions/72798014", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17644775/" ]
Here's the problem: There are two Integer.valueOf() methods: 1. `Integer.valueOf(int)` 2. `Integer.valueOf(String)` When you call valueOf on a character such as '5', the `Integer.valueOf(int)` is called. The `'5'` is casted to int which is 53 which is the ascii code for the character `'5'`. Your code: ``` for (int...
Change: ``` a = Integer.valueOf(s); ``` To: ``` a = s - '0'; ``` Subtracting `'0'` returns the int value of a digit character.
72,798,014
I was trying to write a java program where every digit of an input integer is printed in words. For example: *input* `123` should produce an *output* `"one two three"`. I wrote the following program that takes an integer value, then converts it into a string. I then iterated over the characters of the string and conv...
2022/06/29
[ "https://Stackoverflow.com/questions/72798014", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17644775/" ]
Change: ``` a = Integer.valueOf(s); ``` To: ``` a = s - '0'; ``` Subtracting `'0'` returns the int value of a digit character.
Firstly, lean about the [*primitive data types in Java*](https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html). If your background is JavaScript, which has no `char` type, you might have been thinking that `char` is a "kind of" string, but it's **not**. `char` - is a *16-bit **numeric*** primitive...
72,798,014
I was trying to write a java program where every digit of an input integer is printed in words. For example: *input* `123` should produce an *output* `"one two three"`. I wrote the following program that takes an integer value, then converts it into a string. I then iterated over the characters of the string and conv...
2022/06/29
[ "https://Stackoverflow.com/questions/72798014", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17644775/" ]
Here's the problem: There are two Integer.valueOf() methods: 1. `Integer.valueOf(int)` 2. `Integer.valueOf(String)` When you call valueOf on a character such as '5', the `Integer.valueOf(int)` is called. The `'5'` is casted to int which is 53 which is the ascii code for the character `'5'`. Your code: ``` for (int...
you are getting an error here ``` a = Integer.valueOf(s); ``` it converts char to their respective Unicode value. Instead of this code, you can use the below function. ``` Character.getNumericValue(); ``` Refer this link -> [Char to Int](https://www.javatpoint.com/java-char-to-int) You can also do ``` String c...
72,798,014
I was trying to write a java program where every digit of an input integer is printed in words. For example: *input* `123` should produce an *output* `"one two three"`. I wrote the following program that takes an integer value, then converts it into a string. I then iterated over the characters of the string and conv...
2022/06/29
[ "https://Stackoverflow.com/questions/72798014", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17644775/" ]
Here's the problem: There are two Integer.valueOf() methods: 1. `Integer.valueOf(int)` 2. `Integer.valueOf(String)` When you call valueOf on a character such as '5', the `Integer.valueOf(int)` is called. The `'5'` is casted to int which is 53 which is the ascii code for the character `'5'`. Your code: ``` for (int...
Firstly, lean about the [*primitive data types in Java*](https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html). If your background is JavaScript, which has no `char` type, you might have been thinking that `char` is a "kind of" string, but it's **not**. `char` - is a *16-bit **numeric*** primitive...
72,798,014
I was trying to write a java program where every digit of an input integer is printed in words. For example: *input* `123` should produce an *output* `"one two three"`. I wrote the following program that takes an integer value, then converts it into a string. I then iterated over the characters of the string and conv...
2022/06/29
[ "https://Stackoverflow.com/questions/72798014", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17644775/" ]
you are getting an error here ``` a = Integer.valueOf(s); ``` it converts char to their respective Unicode value. Instead of this code, you can use the below function. ``` Character.getNumericValue(); ``` Refer this link -> [Char to Int](https://www.javatpoint.com/java-char-to-int) You can also do ``` String c...
Firstly, lean about the [*primitive data types in Java*](https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html). If your background is JavaScript, which has no `char` type, you might have been thinking that `char` is a "kind of" string, but it's **not**. `char` - is a *16-bit **numeric*** primitive...
28,087,177
Whether Word and Excel documents can be covertable to PDF using **ITEXTSHARP** in c# .Net? Or any possible means of achieving this other than using Microsoft Interops? Thanks in advance.
2015/01/22
[ "https://Stackoverflow.com/questions/28087177", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2474521/" ]
The short answer is no, iTextSharp cannot convert Word/Excel/PowerPoint/Visio files to PDF. The longer answer is that if you can "somehow" get data from those file formats you can then use iTextSharp to create a PDF. It is 100% up to you to figure out the "somehow", iTextSharp won't help you there. [See this answer](h...
I would use open source libraries (like EPPlus for reading/writing Excel) and use with ITextSharp. It's fairly simplistic to use.
45,685,351
I am trying to send an email with formatted HTML inside the string and an argument. my code is like this: ``` string title = "Big"; string text = "<p>email stuff with <b>important</b> {0} stuff</p>"; string.Format(text, title); MailMessage msz = new MailMessage(); var studentEmail = "someplace@somewhere.net"; msz...
2017/08/15
[ "https://Stackoverflow.com/questions/45685351", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6645514/" ]
You can use ***string interpolation*** to add the value(s) you need directly: ``` string title = "Big" // Now this value has your expected output. string text = $"<p>email stuff with <b>important</b> {title} stuff</p>"; ```
Actually it will depend on how did you send the email. You should store the text into `Body` part of a `MailMessage` ``` string title = "Big"; string text = "<p>email stuff with <b>important</b> {0} stuff</p>"; string.Format(text, title); MailMessage message = new MailMessage(); message.From = "sender@abc.com"); mes...
7,849,265
I would like to have vertical tabs in Flex 4. I have started implementing this by having a vertical list down one side. On list selection I am updating the selection index of a view stack. This gives the functionality of vertical tabs. My problem is the look and feel. How do I get the list to have a similar look and f...
2011/10/21
[ "https://Stackoverflow.com/questions/7849265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/846476/" ]
Simplest solution at <http://blog.flexexamples.com/2009/02/13/creating-a-vertical-fxbuttonbar-control-in-flex-gumbo/> If you take a look at the ButtonBar skin, you'll see that by default it uses a special horizontal layout - ButtonBarHorizontalLayout. Depending on your demands, you might want to implement your own ve...
Have you tried `rotation=90`? With coordinate correction, of course - it will be rotated around top left corner.
7,849,265
I would like to have vertical tabs in Flex 4. I have started implementing this by having a vertical list down one side. On list selection I am updating the selection index of a view stack. This gives the functionality of vertical tabs. My problem is the look and feel. How do I get the list to have a similar look and f...
2011/10/21
[ "https://Stackoverflow.com/questions/7849265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/846476/" ]
Simplest solution at <http://blog.flexexamples.com/2009/02/13/creating-a-vertical-fxbuttonbar-control-in-flex-gumbo/> If you take a look at the ButtonBar skin, you'll see that by default it uses a special horizontal layout - ButtonBarHorizontalLayout. Depending on your demands, you might want to implement your own ve...
Using bug a lot's link I have the following which works: ``` <s:layout> <s:HorizontalLayout horizontalAlign="left" paddingLeft="10"/> </s:layout> <s:ButtonBar id="btnBar" horizontalCenter="0" verticalCenter="0"> <s:layout> <s:VerticalLayout gap="-1"/> </s:layout> <s:dataProvider> <s:Ar...
7,849,265
I would like to have vertical tabs in Flex 4. I have started implementing this by having a vertical list down one side. On list selection I am updating the selection index of a view stack. This gives the functionality of vertical tabs. My problem is the look and feel. How do I get the list to have a similar look and f...
2011/10/21
[ "https://Stackoverflow.com/questions/7849265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/846476/" ]
Simplest solution at <http://blog.flexexamples.com/2009/02/13/creating-a-vertical-fxbuttonbar-control-in-flex-gumbo/> If you take a look at the ButtonBar skin, you'll see that by default it uses a special horizontal layout - ButtonBarHorizontalLayout. Depending on your demands, you might want to implement your own ve...
i'm still quite new to Flex, so I thought, I might post my solution for anybody facing similar difficulties, as I did. If there are nicer ways for the same solution, I'll gladly take advices! After a lot of research about the Skinclass from TabbedViewNavigator, I decided to make my own TabbedViewNavigator/SplitView. T...
7,849,265
I would like to have vertical tabs in Flex 4. I have started implementing this by having a vertical list down one side. On list selection I am updating the selection index of a view stack. This gives the functionality of vertical tabs. My problem is the look and feel. How do I get the list to have a similar look and f...
2011/10/21
[ "https://Stackoverflow.com/questions/7849265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/846476/" ]
Using bug a lot's link I have the following which works: ``` <s:layout> <s:HorizontalLayout horizontalAlign="left" paddingLeft="10"/> </s:layout> <s:ButtonBar id="btnBar" horizontalCenter="0" verticalCenter="0"> <s:layout> <s:VerticalLayout gap="-1"/> </s:layout> <s:dataProvider> <s:Ar...
Have you tried `rotation=90`? With coordinate correction, of course - it will be rotated around top left corner.
7,849,265
I would like to have vertical tabs in Flex 4. I have started implementing this by having a vertical list down one side. On list selection I am updating the selection index of a view stack. This gives the functionality of vertical tabs. My problem is the look and feel. How do I get the list to have a similar look and f...
2011/10/21
[ "https://Stackoverflow.com/questions/7849265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/846476/" ]
i'm still quite new to Flex, so I thought, I might post my solution for anybody facing similar difficulties, as I did. If there are nicer ways for the same solution, I'll gladly take advices! After a lot of research about the Skinclass from TabbedViewNavigator, I decided to make my own TabbedViewNavigator/SplitView. T...
Have you tried `rotation=90`? With coordinate correction, of course - it will be rotated around top left corner.
22,891,985
I'm new to OpenGL. I simply want to thicken one line using glLineWidth, but that also affects all other lines as well. So I tried the other way by putting glLineWidth inside between begin and end, then it didn't work. My code is shown below: ``` glBegin(GL_LINES); glLineWidth(3); glVertex2f(5, 10); glVertex2f(30, 35);...
2014/04/06
[ "https://Stackoverflow.com/questions/22891985", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2291409/" ]
Did you try something like this? ``` glLineWidth(3); glBegin(GL_LINES); glVertex2f(5, 10); glVertex2f(30, 35); glEnd(); glLineWidth(1); glBegin(GL_LINES); glVertex2f(20, 25); glVertex2f(50, 55); glEnd(); ```
`glLineWidth` is a function that affects global state (i.e. it applies to all lines drawn after it is called). If you want other lines to have different widths, you'll have to specify a new `glLineWidth` before drawing them. Note that the default line width value is `1.0`.
64,337,060
There is a resulting matrix `matrix = np.array(...)` and I would like to multiply `i` row by `j` column. How can I implement this?
2020/10/13
[ "https://Stackoverflow.com/questions/64337060", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12412154/" ]
Question is ill-defined because it has more than one interpretation: * Element-wise product `m[i] * m[:, j]` which is a vector. * OP wants a different meaning, I guess it's a [dot product](https://en.wikipedia.org/wiki/Dot_product): `np.dot(m[i], m[:, j])` or `np.sum(m[i] * m[:, j])`
just a simple multiply will do the work for you. ``` row = matrix[i] column = matrix[:,j] result = sum(row*column) ```
18,434,957
Does the function `qsort()` in `stdlib.h` actually use quicksort algorithm, as the name suggests?
2013/08/26
[ "https://Stackoverflow.com/questions/18434957", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2135642/" ]
The `qsort()` function may be implemented using any sort algorithm that the library implementer chooses, but the name suggests that the algorithm should be close to optimal. Using an O(N2) algorithm would be permissible, but a major QoI (quality of implementation) issue. It is worth noting that comparison is quite exp...
The C11 standard does not specify. So any reasonable O(n log n) would be acceptable.
783,729
I needed to solve $$\lim\_{x \to 0} x \* \ln x.$$ and I wasn't sure how I would do it so I looked up the answer. They used L'Hoptial to solve this and I don't understand why this works. $\lim\_{x\to0} x \* \ln x = \lim\_{x\to0} \frac{\ln x}{1/x} $ but I can't use L'Hopital here because this is $\frac{\text{undef...
2014/05/06
[ "https://math.stackexchange.com/questions/783729", "https://math.stackexchange.com", "https://math.stackexchange.com/users/42885/" ]
You can use L'Hopital if you rewrite your expression $$\frac{\ln x}{1/x}$$ As $x \to 0^+,$ we have the indeterminate form of $\frac{\infty}{\infty}$, so you are now licensed to take the derivative of the numerator and of the denominator and evaluate the limit. $$\lim\_{x\to0^+}\frac{\dfrac1x}{-\dfrac1{x^2}} \;=\;-\li...
We can apply L'Hospital's Rule safely on $$F=\lim\_{x\to0^+}\frac{\ln x}{\dfrac1x}$$ as it is of the form $\dfrac\infty\infty$ $\displaystyle F=\lim\_{x\to0^+}\frac{\dfrac1x}{-\dfrac1{x^2}}=-\lim\_{x\to0^+}x=0 $
88,832
Circuit splits have the effect of treating people in America differently with regards to the law depending on where they live, due to differing interpretations of the same statute. Some of these differing interpretations involve what seems like major questions of rights that such as in [these cases](https://en.wikipedi...
2023/02/02
[ "https://law.stackexchange.com/questions/88832", "https://law.stackexchange.com", "https://law.stackexchange.com/users/1312/" ]
(The original title of your question suggested you might think that federal circuit precedent binds state courts: [it generally does not](https://law.stackexchange.com/a/87111/46948), even on matters of federal law.) But regardless, Congress would not be able to legislatively lower the constitutional floor. If a certa...
Generally speaking, Congress does enact uniform federal laws, and there may be some constitutional boundaries and limitations on enacting local laws (as noted below with respect to bankruptcy court costs). But there isn't a hard and fast rule permitting federal law to be different in different states or on some other g...
5,560,132
I am trying to execute ``` sudo -su db2inst1 /opt/ibm/db2/V9.7/bin/db2 force application (1995) ``` but I get this error: > > bash: syntax error near unexpected token `(' > > > However, ``` sudo -su db2inst1 id ``` gives me correct output. So it must be something about the `()` If I try ``` sudo -su db2in...
2011/04/06
[ "https://Stackoverflow.com/questions/5560132", "https://Stackoverflow.com", "https://Stackoverflow.com/users/250422/" ]
NOTE: While this answer seems to have been correct at the time [sudo was changed later that same year to add extra escaping around characters in the arguments with `-i` and `-s`], it is not correct for modern versions of sudo, which escape all special characters when constructing the command line to be passed to `$SHEL...
Try ``` sudo -su db2inst1 /opt/ibm/db2/V9.7/bin/db2 force application \(1995\) ```
53,106,866
So I have a problem here. I get set of random words and my job is to find out if there exists atleast one sequence of words that connects all words (first-last letter) in line. For example sequence of words (apple - eagle - elephant - tiger) would return true. But sequence of words (apple - eagle - elephant - peach) w...
2018/11/01
[ "https://Stackoverflow.com/questions/53106866", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8452731/" ]
This may happen if the datagram is sent to a broadcast address, and you’re bound to all interfaces (0.0.0.0), and there are two interfaces the datagram is received on. To exclude this possibility, switch to the `receiveDatagram` API and dump the full details of the datagram you’ve received. My bet is that the interface...
Unslander Monica is correct, it binds to all interfaces default, you can fix it by m\_socket->bind(QHostAddress::LocalHost,11112);
42,051,486
Good morning everyone. I know from the title it's everything confused, so I will try to explain it better. I need to create an app for a medical project to calc HbA1c. I have 3 editText in which I type values of medical test. Each of three changes because of other one. For example: if I have 42 in one, the other one ...
2017/02/05
[ "https://Stackoverflow.com/questions/42051486", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5798814/" ]
Instead of using `onClickListener`, try using `addTextChangedListener()` and change your TextViews whenever `onTextChanged()` is called. By using this you can even change them while typing. It looks something like this: ``` editText.addTextChangedListener(new TextWatcher() { @Override public...
Though answer by @Anjani is correct and you could use it but I would recommend using Butterknife. Here is the code: ``` @OnTextChanged(value = R.id.editText, callback = OnTextChanged.Callback.TEXT_CHANGED) void afterCommentTextChange(CharSequence s, int start, int before, int count) { // Do what ever you wan...
72,590
I need a camera which monitors grayscale the environment because of strict battery life requirement (one week) and because computers can only understand grayscale. I am thinking GoPro Hero 3 because of Pebble support, bluetooth connection and low resolution (5 Mpix). I want to monitor just mice on roofs with the camera...
2016/01/07
[ "https://photo.stackexchange.com/questions/72590", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/24178/" ]
Not sure how this fits in with e-ink, but there is a product category called "trail camera" that might do what you need. These are cameras designed to take pictures in the dark or light in response to motion and most should easily meet your one week power requirement. Although most of these cameras store the images on...
As I understand it, your thinking is: e-ink displays save power by being monochrome. Therefore, it seems logical that one could also save power with a monochrome sensor. But, this is based on a false assumption. E-ink is low power because it is an entirely different technology, one which requires power only to *chang...
72,590
I need a camera which monitors grayscale the environment because of strict battery life requirement (one week) and because computers can only understand grayscale. I am thinking GoPro Hero 3 because of Pebble support, bluetooth connection and low resolution (5 Mpix). I want to monitor just mice on roofs with the camera...
2016/01/07
[ "https://photo.stackexchange.com/questions/72590", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/24178/" ]
Not sure how this fits in with e-ink, but there is a product category called "trail camera" that might do what you need. These are cameras designed to take pictures in the dark or light in response to motion and most should easily meet your one week power requirement. Although most of these cameras store the images on...
> > Could I save power by using a camera with only grayscale detectors? > > > No. You couldn't. Sensors are greyscale right up into the IR range and only become 'colour' with the application of a coloured filter array. The number of pixels in a sensor does not have an appreciable difference on power requirements ...
10,777,996
Hi say I have a table: ``` Person: PersonId Name ManagerId ``` So the ManagerId is a reference back to another person. So there might be a persons in the database: ``` 1 Bob null 2 Steve 1 3 Tim 2 ``` So Bob is Steve's Manager and Steve is Tim's Manager. So what I was wanting to do is write a query that gets ...
2012/05/27
[ "https://Stackoverflow.com/questions/10777996", "https://Stackoverflow.com", "https://Stackoverflow.com/users/822229/" ]
You can use Common Table Expressions (CTEs) to solve this problem. CTEs can be used for recursion, as Andrei pointed out (see the excellent reference that Andrei included in his post). Let's say you have a table as follows: ``` create table Person ( PersonId int primary key, Name varchar(25), ManagerId int fo...
If you are using MS SQL Server 2005 or later, you can use CTE, as @AndreiDrynov pointed out, like this: ``` ;WITH Emps(PersonId, Name, PersonLevel, ManagerName) AS ( SELECT PersonId, Name, 0 AS PersonLevel, CONVERT(NVARCHAR(50), 'No Manager') AS ManagerName FROM Persons WHERE ManagerId IS NULL ...
10,777,996
Hi say I have a table: ``` Person: PersonId Name ManagerId ``` So the ManagerId is a reference back to another person. So there might be a persons in the database: ``` 1 Bob null 2 Steve 1 3 Tim 2 ``` So Bob is Steve's Manager and Steve is Tim's Manager. So what I was wanting to do is write a query that gets ...
2012/05/27
[ "https://Stackoverflow.com/questions/10777996", "https://Stackoverflow.com", "https://Stackoverflow.com/users/822229/" ]
You can use Common Table Expressions (CTEs) to solve this problem. CTEs can be used for recursion, as Andrei pointed out (see the excellent reference that Andrei included in his post). Let's say you have a table as follows: ``` create table Person ( PersonId int primary key, Name varchar(25), ManagerId int fo...
``` select * from Person A inner join Person B ON B.PersonID = A.ManagerID where ManagerId = 1 ```
1,138,573
I'm trying to bind a XAML ComboBox so that its list items are the members of the System.IO.Ports.Parity enum. I've found plenty of examples of databinding enums, but it seems these don't work if the enum is in a different namespace (like System.IO.Ports). Right now I have: ``` <ObjectDataProvider MethodName="GetVal...
2009/07/16
[ "https://Stackoverflow.com/questions/1138573", "https://Stackoverflow.com", "https://Stackoverflow.com/users/135041/" ]
Adding something like ``` xmlns:sysioports="clr-namespace:System.IO.Ports;assembly=System" ``` and then changing the `<x:Type />` line to ``` <x:Type TypeName="sysioports:Parity" /> ``` Should make it work.
just because you should include and use namespace like this ``` <Window xmlns:custom="clr-namespace:System.IO.Ports.Parity;assembly=SampleLibrary"> ... <x:Type TypeName="custom:Parity" /> ... </Window> ```
8,898,573
We've upgraded the asp.net runtime from 2.0 to 4.0 - turns out a vendor provided control has breaking changes. Our entire site is on asp.net runtime 4.0. Is it possible to use asp.net runtime 2.0 for a few controls (using some directive) or a folder (using web.config)?
2012/01/17
[ "https://Stackoverflow.com/questions/8898573", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1067398/" ]
Each application pool must use only one version of the runtime, and that is configured within IIS. I agree with @DanielAWhite - your vendor needs a lesson in software design. [See this MSDN article for comments regarding application pool configuration and CLR versions.](http://msdn.microsoft.com/en-us/library/a99tx...
We are running the .NET 2 and 4 assemblies within same site without problems on IIS 7. I'm not sure, but you may have problems on IIS 6 since it can not run multiple framework versions at the same time. What kind of problem you have? If it's client issues, try to set in web config render compatibility to 3.5. If it not...
8,898,573
We've upgraded the asp.net runtime from 2.0 to 4.0 - turns out a vendor provided control has breaking changes. Our entire site is on asp.net runtime 4.0. Is it possible to use asp.net runtime 2.0 for a few controls (using some directive) or a folder (using web.config)?
2012/01/17
[ "https://Stackoverflow.com/questions/8898573", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1067398/" ]
Each application pool must use only one version of the runtime, and that is configured within IIS. I agree with @DanielAWhite - your vendor needs a lesson in software design. [See this MSDN article for comments regarding application pool configuration and CLR versions.](http://msdn.microsoft.com/en-us/library/a99tx...
you would need two different app pools because the .NET Framework version is defined per appPool in IIS, I think having two folders with different web.config and using two different app pools could work, but keep in mind that it will be more like having two web applications working separately and not working as one app...
8,898,573
We've upgraded the asp.net runtime from 2.0 to 4.0 - turns out a vendor provided control has breaking changes. Our entire site is on asp.net runtime 4.0. Is it possible to use asp.net runtime 2.0 for a few controls (using some directive) or a folder (using web.config)?
2012/01/17
[ "https://Stackoverflow.com/questions/8898573", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1067398/" ]
Each application pool must use only one version of the runtime, and that is configured within IIS. I agree with @DanielAWhite - your vendor needs a lesson in software design. [See this MSDN article for comments regarding application pool configuration and CLR versions.](http://msdn.microsoft.com/en-us/library/a99tx...
David Lively is correct about your direct question. The proper action is probably to run the site in 2.0 for now. You could also look at segmenting the site into two application pools if the control(s) in question only appear in a small area. I just wanted to make sure, though, that you you know of the `<system.web><p...
8,898,573
We've upgraded the asp.net runtime from 2.0 to 4.0 - turns out a vendor provided control has breaking changes. Our entire site is on asp.net runtime 4.0. Is it possible to use asp.net runtime 2.0 for a few controls (using some directive) or a folder (using web.config)?
2012/01/17
[ "https://Stackoverflow.com/questions/8898573", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1067398/" ]
you would need two different app pools because the .NET Framework version is defined per appPool in IIS, I think having two folders with different web.config and using two different app pools could work, but keep in mind that it will be more like having two web applications working separately and not working as one app...
We are running the .NET 2 and 4 assemblies within same site without problems on IIS 7. I'm not sure, but you may have problems on IIS 6 since it can not run multiple framework versions at the same time. What kind of problem you have? If it's client issues, try to set in web config render compatibility to 3.5. If it not...
8,898,573
We've upgraded the asp.net runtime from 2.0 to 4.0 - turns out a vendor provided control has breaking changes. Our entire site is on asp.net runtime 4.0. Is it possible to use asp.net runtime 2.0 for a few controls (using some directive) or a folder (using web.config)?
2012/01/17
[ "https://Stackoverflow.com/questions/8898573", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1067398/" ]
David Lively is correct about your direct question. The proper action is probably to run the site in 2.0 for now. You could also look at segmenting the site into two application pools if the control(s) in question only appear in a small area. I just wanted to make sure, though, that you you know of the `<system.web><p...
We are running the .NET 2 and 4 assemblies within same site without problems on IIS 7. I'm not sure, but you may have problems on IIS 6 since it can not run multiple framework versions at the same time. What kind of problem you have? If it's client issues, try to set in web config render compatibility to 3.5. If it not...
55,663,896
I don't want to directly import security\_access\_key in my application due to security reason. I tried accessing environment variable like below step 1: added security\_access\_key to .env file ``` security_access_key=abc123 ``` step 2: access it in App.js ``` console.log(process.env.security_access_key) ```...
2019/04/13
[ "https://Stackoverflow.com/questions/55663896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7750342/" ]
I had the same problem, here is how I fixed it. Check your PATH environment variable. In my system PATH one of the values was surrounded with double quotes. It was the path to an old DirectX 9 library that I had been using to build an old Winamp Visualizer lol. Be careful, because Windows 10 hides the fact that some ...
I had the same problem. In my case, it was because of incorrect autoexec in my command line. So I cleaned up corresponding entry in my registry (HKLM\Software\Microsoft\Command Processor\AutoRun) and everything started working. If that does not help, I recommend to create new account on your PC and test it there. If ...
55,663,896
I don't want to directly import security\_access\_key in my application due to security reason. I tried accessing environment variable like below step 1: added security\_access\_key to .env file ``` security_access_key=abc123 ``` step 2: access it in App.js ``` console.log(process.env.security_access_key) ```...
2019/04/13
[ "https://Stackoverflow.com/questions/55663896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7750342/" ]
I had the same problem, here is how I fixed it. Check your PATH environment variable. In my system PATH one of the values was surrounded with double quotes. It was the path to an old DirectX 9 library that I had been using to build an old Winamp Visualizer lol. Be careful, because Windows 10 hides the fact that some ...
The CMakeError.log or CMakeOutput.log files will contain more information about this error. (You can look for vcvars64.bat) For me, it said "The input line is too long" and "The syntax of the command is incorrect" in these files. In my case it was caused by the PATH environment variable being too long. The errors were...
55,663,896
I don't want to directly import security\_access\_key in my application due to security reason. I tried accessing environment variable like below step 1: added security\_access\_key to .env file ``` security_access_key=abc123 ``` step 2: access it in App.js ``` console.log(process.env.security_access_key) ```...
2019/04/13
[ "https://Stackoverflow.com/questions/55663896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7750342/" ]
I had the same problem. In my case, it was not the PATH variable. The problem is TEMP or TMP, which are derived from the user name. When your user name contains a space, you should set TMP and TEMP to paths without spaces before starting to compile.
I had the same problem. In my case, it was because of incorrect autoexec in my command line. So I cleaned up corresponding entry in my registry (HKLM\Software\Microsoft\Command Processor\AutoRun) and everything started working. If that does not help, I recommend to create new account on your PC and test it there. If ...
55,663,896
I don't want to directly import security\_access\_key in my application due to security reason. I tried accessing environment variable like below step 1: added security\_access\_key to .env file ``` security_access_key=abc123 ``` step 2: access it in App.js ``` console.log(process.env.security_access_key) ```...
2019/04/13
[ "https://Stackoverflow.com/questions/55663896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7750342/" ]
I had the same problem. In my case, it was not the PATH variable. The problem is TEMP or TMP, which are derived from the user name. When your user name contains a space, you should set TMP and TEMP to paths without spaces before starting to compile.
The CMakeError.log or CMakeOutput.log files will contain more information about this error. (You can look for vcvars64.bat) For me, it said "The input line is too long" and "The syntax of the command is incorrect" in these files. In my case it was caused by the PATH environment variable being too long. The errors were...