qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
13,537,503
Can I please have a design suggestion for the following problem: I am using Codeigniter/Grocery\_CRUD. My system is multi tenanted - different autonomous sites - within the same client. I have quite a few instances of tables that have unique logical keys. One such table structure is: equip\_items id (pk) equ...
2012/11/24
[ "https://Stackoverflow.com/questions/13537503", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1228116/" ]
**UPDATE:** This code is now part of grocery CRUD version >= 1.4 and you don't need to use an extension anymore. For more see the documentation for [unique\_fields](http://www.grocerycrud.com/documentation/options_functions/unique_fields) I will try to explain it as easy as I can: **1.** First of all for those who h...
I have done this using a callback: ``` $crud->set_rules('name','Name','callback_unique_equip_item_check['.$this->uri->segment(4).']'); function unique_equip_item_check($str, $edited_id) { $var = $this->Equip_Item_model->is_unique_except( $edited_id, $this->input->post('site_id'), ...
16,329
I have some basic questions about my 1-year-old pug. 1. How much should he eat? Typically he should eat 2 times, but he always keeps some food in his bowl and whenever he wants he eats. Is this a good practice? (I use Royal Canin Mini Adult) 2. Now-a-days he always wants what I'm eating. How to stop this? I'm too ne...
2017/02/08
[ "https://pets.stackexchange.com/questions/16329", "https://pets.stackexchange.com", "https://pets.stackexchange.com/users/8839/" ]
1. As Gone2 has stated, you should definitely regulate your pug's intake by removing the food after 15-20 minutes with each feeding. All kibble has feeding directions on the back, so you should follow the feeding recommendations on the bag for his weight unless otherwise directed by a veterinarian. Dogs should generall...
1. Leaving food out beyond the two set feeding times is not a good practice. You should go by the recommended amount on the bag for his weight and split that in half; one portion each feeding. 2. To prevent begging you should avoid reacting to the begging and if necessary physically separate yourself from the him while...
15,043,674
I do something like this in my code ``` S s; s.a=1 s.b=2 v.push_back(s) ``` Now that C++ has forwarding can i write something like ``` v.push_back(1,2) ``` fyi visual studio supports forwarding as the below works as expected ``` //http://herbsutter.com/gotw/_102/ template<typename T, typename ...Args> std::uniqu...
2013/02/23
[ "https://Stackoverflow.com/questions/15043674", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You can use `std::vector::emplace_back` which will create the object inplace with the fitting constructor. This of course requires that you have such a constructor defined. ``` v.emplace_back(1,2); ``` As of C++11 every std-container offers an emplace-like function which gives the above described behavior. Compatib...
`push_back` doesn't support forwarding, but the new `emplace_back` does. However, `push_back` does support initializer lists: ``` v.push_back({1,2}); ```
33,840
Consider our world at 18-19 centuries. Our civilization knows how to print books, build steam machines, we have made first experiments on electricity. And one day the [Mad God Sheogorath](http://elderscrolls.wikia.com/wiki/Sheogorath) is emerged. He can bend the reality by his will. For example, he can violate the pr...
2016/01/21
[ "https://worldbuilding.stackexchange.com/questions/33840", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/2763/" ]
I think you're vastly underestimating just how different a truly non-deterministic universe would be. **Case A** If the god's influence is sporadic enough that you can still discern a "default" set of laws that nature follows most of the time, then scientists would simply study those laws. **Case B** If the god's i...
This is actually a very common misconception about the scientific method that we seem to teach in schools. The scientific method is not *just* about identifying the "right" laws governing the universe. It is also about building useful models of the universe. In fact, if you are willing to sit down with any real scienti...
33,840
Consider our world at 18-19 centuries. Our civilization knows how to print books, build steam machines, we have made first experiments on electricity. And one day the [Mad God Sheogorath](http://elderscrolls.wikia.com/wiki/Sheogorath) is emerged. He can bend the reality by his will. For example, he can violate the pr...
2016/01/21
[ "https://worldbuilding.stackexchange.com/questions/33840", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/2763/" ]
**Caveat**: I've made some assumptions in order to make this work as a potential world. Like many have pointed out, a truly mad god acting without care would probably manage to kill off the human race pretty quickly if they acted often enough to have a tangible effect on the world (by triggering a catastrophic imbalanc...
As a writer and reader, if I'm dealing with a being with what we might call "godlike powers", they still have to operate within a larger reality. For example in your setup, Sheogorath builds a tiny "Perpetual Motion Machine" but is actually cheating because in some mysterious god power way, it is perfectly converting a...
33,840
Consider our world at 18-19 centuries. Our civilization knows how to print books, build steam machines, we have made first experiments on electricity. And one day the [Mad God Sheogorath](http://elderscrolls.wikia.com/wiki/Sheogorath) is emerged. He can bend the reality by his will. For example, he can violate the pr...
2016/01/21
[ "https://worldbuilding.stackexchange.com/questions/33840", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/2763/" ]
I think you're vastly underestimating just how different a truly non-deterministic universe would be. **Case A** If the god's influence is sporadic enough that you can still discern a "default" set of laws that nature follows most of the time, then scientists would simply study those laws. **Case B** If the god's i...
As a writer and reader, if I'm dealing with a being with what we might call "godlike powers", they still have to operate within a larger reality. For example in your setup, Sheogorath builds a tiny "Perpetual Motion Machine" but is actually cheating because in some mysterious god power way, it is perfectly converting a...
33,840
Consider our world at 18-19 centuries. Our civilization knows how to print books, build steam machines, we have made first experiments on electricity. And one day the [Mad God Sheogorath](http://elderscrolls.wikia.com/wiki/Sheogorath) is emerged. He can bend the reality by his will. For example, he can violate the pr...
2016/01/21
[ "https://worldbuilding.stackexchange.com/questions/33840", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/2763/" ]
**It very much depends on your god's sense of humour.** If he's decided for example that [da red wunz go fasta](https://en.wikipedia.org/wiki/Ork_%28Warhammer_40,000%29) and anything blue can fly then you've pretty much had it. All the rules that you come up with are going to be wrong. If his logic has an internal co...
This is actually a very common misconception about the scientific method that we seem to teach in schools. The scientific method is not *just* about identifying the "right" laws governing the universe. It is also about building useful models of the universe. In fact, if you are willing to sit down with any real scienti...
33,840
Consider our world at 18-19 centuries. Our civilization knows how to print books, build steam machines, we have made first experiments on electricity. And one day the [Mad God Sheogorath](http://elderscrolls.wikia.com/wiki/Sheogorath) is emerged. He can bend the reality by his will. For example, he can violate the pr...
2016/01/21
[ "https://worldbuilding.stackexchange.com/questions/33840", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/2763/" ]
**Absolutely** To quote some mouseover text from a certain webcomic: 'We don't use science to prove we're right. We use science to *become* right'. The scientific method is just as valid in your crazy mixed up world as it is now, and will remain so unless the world becomes so crazy that no logical sense can be made of...
As a writer and reader, if I'm dealing with a being with what we might call "godlike powers", they still have to operate within a larger reality. For example in your setup, Sheogorath builds a tiny "Perpetual Motion Machine" but is actually cheating because in some mysterious god power way, it is perfectly converting a...
33,840
Consider our world at 18-19 centuries. Our civilization knows how to print books, build steam machines, we have made first experiments on electricity. And one day the [Mad God Sheogorath](http://elderscrolls.wikia.com/wiki/Sheogorath) is emerged. He can bend the reality by his will. For example, he can violate the pr...
2016/01/21
[ "https://worldbuilding.stackexchange.com/questions/33840", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/2763/" ]
**Caveat**: I've made some assumptions in order to make this work as a potential world. Like many have pointed out, a truly mad god acting without care would probably manage to kill off the human race pretty quickly if they acted often enough to have a tangible effect on the world (by triggering a catastrophic imbalanc...
**Absolutely** To quote some mouseover text from a certain webcomic: 'We don't use science to prove we're right. We use science to *become* right'. The scientific method is just as valid in your crazy mixed up world as it is now, and will remain so unless the world becomes so crazy that no logical sense can be made of...
33,840
Consider our world at 18-19 centuries. Our civilization knows how to print books, build steam machines, we have made first experiments on electricity. And one day the [Mad God Sheogorath](http://elderscrolls.wikia.com/wiki/Sheogorath) is emerged. He can bend the reality by his will. For example, he can violate the pr...
2016/01/21
[ "https://worldbuilding.stackexchange.com/questions/33840", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/2763/" ]
*Is the scientific method still possible in this world?* More or less. The scientific method depends heavily on being able to prove things are either true or false (at least it used to) with as many few "maybe" in between as possible. Those "maybe" being mostly regarded as proof of falsehood. Simply put, it depend...
As a writer and reader, if I'm dealing with a being with what we might call "godlike powers", they still have to operate within a larger reality. For example in your setup, Sheogorath builds a tiny "Perpetual Motion Machine" but is actually cheating because in some mysterious god power way, it is perfectly converting a...
33,840
Consider our world at 18-19 centuries. Our civilization knows how to print books, build steam machines, we have made first experiments on electricity. And one day the [Mad God Sheogorath](http://elderscrolls.wikia.com/wiki/Sheogorath) is emerged. He can bend the reality by his will. For example, he can violate the pr...
2016/01/21
[ "https://worldbuilding.stackexchange.com/questions/33840", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/2763/" ]
**Caveat**: I've made some assumptions in order to make this work as a potential world. Like many have pointed out, a truly mad god acting without care would probably manage to kill off the human race pretty quickly if they acted often enough to have a tangible effect on the world (by triggering a catastrophic imbalanc...
This is actually a very common misconception about the scientific method that we seem to teach in schools. The scientific method is not *just* about identifying the "right" laws governing the universe. It is also about building useful models of the universe. In fact, if you are willing to sit down with any real scienti...
33,840
Consider our world at 18-19 centuries. Our civilization knows how to print books, build steam machines, we have made first experiments on electricity. And one day the [Mad God Sheogorath](http://elderscrolls.wikia.com/wiki/Sheogorath) is emerged. He can bend the reality by his will. For example, he can violate the pr...
2016/01/21
[ "https://worldbuilding.stackexchange.com/questions/33840", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/2763/" ]
**It very much depends on your god's sense of humour.** If he's decided for example that [da red wunz go fasta](https://en.wikipedia.org/wiki/Ork_%28Warhammer_40,000%29) and anything blue can fly then you've pretty much had it. All the rules that you come up with are going to be wrong. If his logic has an internal co...
As a writer and reader, if I'm dealing with a being with what we might call "godlike powers", they still have to operate within a larger reality. For example in your setup, Sheogorath builds a tiny "Perpetual Motion Machine" but is actually cheating because in some mysterious god power way, it is perfectly converting a...
33,840
Consider our world at 18-19 centuries. Our civilization knows how to print books, build steam machines, we have made first experiments on electricity. And one day the [Mad God Sheogorath](http://elderscrolls.wikia.com/wiki/Sheogorath) is emerged. He can bend the reality by his will. For example, he can violate the pr...
2016/01/21
[ "https://worldbuilding.stackexchange.com/questions/33840", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/2763/" ]
**Absolutely** To quote some mouseover text from a certain webcomic: 'We don't use science to prove we're right. We use science to *become* right'. The scientific method is just as valid in your crazy mixed up world as it is now, and will remain so unless the world becomes so crazy that no logical sense can be made of...
This is actually a very common misconception about the scientific method that we seem to teach in schools. The scientific method is not *just* about identifying the "right" laws governing the universe. It is also about building useful models of the universe. In fact, if you are willing to sit down with any real scienti...
8,051,394
Could anybody help me out to get nested tabs through ajax calls. Description: I am having Jquery Tabs with ajax option CODE: ``` $( ".has_ajax_tabs" ).tabs({ ajaxOptions: { error: function( xhr, status, index, anchor ) { $( anchor.hash ).html("<h3>OOPS...Something went wrong!</h3>...
2011/11/08
[ "https://Stackoverflow.com/questions/8051394", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
That's a bad idea. The lifetime of a threadpool thread is determined by the code it executes, preferably short and snappy. This is *not* the rule for an STA thread, it must stay active and pump a message loop as long as the COM objects that were created on that thread are not finalized. A requirement that's very incomp...
I have analyzed the source code and found out that SmartThreadPool doesn't support STA threads. The only way to create them is to modify the sources as follows: 1. Add *StartSTAThreads* property to the *STPStartInfo* class. 2. Add ``` if (_stpStartInfo.StartSTAThreads) { workerThread.SetApartmentState(Apartment...
8,051,394
Could anybody help me out to get nested tabs through ajax calls. Description: I am having Jquery Tabs with ajax option CODE: ``` $( ".has_ajax_tabs" ).tabs({ ajaxOptions: { error: function( xhr, status, index, anchor ) { $( anchor.hash ).html("<h3>OOPS...Something went wrong!</h3>...
2011/11/08
[ "https://Stackoverflow.com/questions/8051394", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
For completeness, the [current version](http://www.codeproject.com/Articles/7933/Smart-Thread-Pool#Feature29) does support STA threads: ``` STPStartInfo stpStartInfo = new STPStartInfo(); stpStartInfo.ApartmentState = ApartmentState.STA; SmartThreadPool stp = new SmartThreadPool(stpStartInfo); ```
I have analyzed the source code and found out that SmartThreadPool doesn't support STA threads. The only way to create them is to modify the sources as follows: 1. Add *StartSTAThreads* property to the *STPStartInfo* class. 2. Add ``` if (_stpStartInfo.StartSTAThreads) { workerThread.SetApartmentState(Apartment...
16,660
I'm currently building a functional Lego escalator that is minifigure-scaled and with staircases transitioning from flat platform to stairwell. Here's my progress so far: [![escalator slope design](https://i.stack.imgur.com/OOvDG.png)](https://i.stack.imgur.com/OOvDG.png) But with the design of the staircases hopefully...
2021/10/15
[ "https://bricks.stackexchange.com/questions/16660", "https://bricks.stackexchange.com", "https://bricks.stackexchange.com/users/19067/" ]
Could this work in you case? Using snot brick to build it vertically. [![Slope 45°](https://i.stack.imgur.com/9mNeE.jpg)](https://i.stack.imgur.com/9mNeE.jpg) EDIT 1: The only way I managed to get your angle and snap it correctly is like that. I used stud.io with collision turned on to be sure it could work. I hope ...
**Update:** Now that I have stud.io installed, I've finally got an upright design for the slope's framework as follows: [![39.5 degrees slope (white) with supporting frameworks (green)](https://i.stack.imgur.com/MTQh3.png)](https://i.stack.imgur.com/MTQh3.png) This design was based off of @Hugo 's suggestion, but modif...
330,170
I learned British English, but I work exclusively with Americans. I'll often say "Fat lot of good X did for us", and I get confused looks from others. For example, the other day, I said "I think we should have had them take the web development course; fat lot of good the algorithms course did for them" and people have ...
2022/12/30
[ "https://ell.stackexchange.com/questions/330170", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/151216/" ]
**Just leave out the fat**, in speech, and use a sarcastic tone. "I think we should have had them take the web development course; a lot of good the algorithms course did for them." The fact is that this is an idiomatic expression. And **many Americans** *would in fact understand* "a fat lot of good". Who cares what...
A whole lot of good would also work. I'm guessing the confusion comes from the fact that "fat" generally refers to being overweight.
3,599,278
I must develop a simple web application to produce reports. I have a single table "contract" and i must return very simple aggregated values : number of documents produced in a time range, average number of pages for documents and so on . The table gets filled by a batch application, users will have roles that will all...
2010/08/30
[ "https://Stackoverflow.com/questions/3599278", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
KISS - keep it simple and stupid. You have five days. Create working application and if you have time refactor it to some better solution.
The road to good code is not paved with design patterns. Good code is code that is readable, maintainable, robust, compatible and future-proof. Don’t get me wrong: Design patterns are a great thing because they help categorise, and thus teach, the experience that earlier generations of programmers have accrued. Each ...
3,599,278
I must develop a simple web application to produce reports. I have a single table "contract" and i must return very simple aggregated values : number of documents produced in a time range, average number of pages for documents and so on . The table gets filled by a batch application, users will have roles that will all...
2010/08/30
[ "https://Stackoverflow.com/questions/3599278", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
KISS - keep it simple and stupid. You have five days. Create working application and if you have time refactor it to some better solution.
How about you use strategy pattern for the retrieving data? And use interfaces like following to keep it extendable at all times. * IReportFilter: Report filter/criteria set * IReportParams: Gets report parameters * IReportData: Gets the report data in a result set * IReportFormat: Report formatting * IReportRender: R...
14,055,690
can i get the whole `linearlayout` or other layouts converted to bitmap. my code is this : ``` LinearLayout view = (LinearLayout)findViewById(R.id.linear_parent); view.setDrawingCacheEnabled(true); view.buildDrawingCache(); Bitmap bm = view.getDrawingCache(); ByteArrayOutputStream bytes = new ByteArrayOutputStream(...
2012/12/27
[ "https://Stackoverflow.com/questions/14055690", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1882012/" ]
instead of ImageView try *clickable="true"* and *drawableEnd* ``` <TextView android:id="@+id/textView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:drawableEnd="@drawable/navigation_icon" android:text="Text" android:clickable="true" /> ```
try to make your xml look like below. ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" > <LinearLayout android:layout_width="wrap_conte...
14,055,690
can i get the whole `linearlayout` or other layouts converted to bitmap. my code is this : ``` LinearLayout view = (LinearLayout)findViewById(R.id.linear_parent); view.setDrawingCacheEnabled(true); view.buildDrawingCache(); Bitmap bm = view.getDrawingCache(); ByteArrayOutputStream bytes = new ByteArrayOutputStream(...
2012/12/27
[ "https://Stackoverflow.com/questions/14055690", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1882012/" ]
After lot of googling, I found a good solution of my problem ``` TextView textView =new TextView(this); SpannableStringBuilder ssb = new SpannableStringBuilder( "Here's a smiley how are you " ); Bitmap smiley = BitmapFactory.decodeResource( getResources(), R.drawable.movie_add ); ...
try to make your xml look like below. ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" > <LinearLayout android:layout_width="wrap_conte...
14,055,690
can i get the whole `linearlayout` or other layouts converted to bitmap. my code is this : ``` LinearLayout view = (LinearLayout)findViewById(R.id.linear_parent); view.setDrawingCacheEnabled(true); view.buildDrawingCache(); Bitmap bm = view.getDrawingCache(); ByteArrayOutputStream bytes = new ByteArrayOutputStream(...
2012/12/27
[ "https://Stackoverflow.com/questions/14055690", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1882012/" ]
instead of ImageView try *clickable="true"* and *drawableEnd* ``` <TextView android:id="@+id/textView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:drawableEnd="@drawable/navigation_icon" android:text="Text" android:clickable="true" /> ```
Use the following layout ``` <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:gravity="center" android:padding="2dp" android:background="@android:color/tra...
14,055,690
can i get the whole `linearlayout` or other layouts converted to bitmap. my code is this : ``` LinearLayout view = (LinearLayout)findViewById(R.id.linear_parent); view.setDrawingCacheEnabled(true); view.buildDrawingCache(); Bitmap bm = view.getDrawingCache(); ByteArrayOutputStream bytes = new ByteArrayOutputStream(...
2012/12/27
[ "https://Stackoverflow.com/questions/14055690", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1882012/" ]
After lot of googling, I found a good solution of my problem ``` TextView textView =new TextView(this); SpannableStringBuilder ssb = new SpannableStringBuilder( "Here's a smiley how are you " ); Bitmap smiley = BitmapFactory.decodeResource( getResources(), R.drawable.movie_add ); ...
Use the following layout ``` <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:gravity="center" android:padding="2dp" android:background="@android:color/tra...
14,055,690
can i get the whole `linearlayout` or other layouts converted to bitmap. my code is this : ``` LinearLayout view = (LinearLayout)findViewById(R.id.linear_parent); view.setDrawingCacheEnabled(true); view.buildDrawingCache(); Bitmap bm = view.getDrawingCache(); ByteArrayOutputStream bytes = new ByteArrayOutputStream(...
2012/12/27
[ "https://Stackoverflow.com/questions/14055690", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1882012/" ]
After lot of googling, I found a good solution of my problem ``` TextView textView =new TextView(this); SpannableStringBuilder ssb = new SpannableStringBuilder( "Here's a smiley how are you " ); Bitmap smiley = BitmapFactory.decodeResource( getResources(), R.drawable.movie_add ); ...
instead of ImageView try *clickable="true"* and *drawableEnd* ``` <TextView android:id="@+id/textView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:drawableEnd="@drawable/navigation_icon" android:text="Text" android:clickable="true" /> ```
8,798,985
I have encountered a problem of socket communication on linux system, the communication process is like below: client send a message to ask the server to do a compute task, and wait for the result message from server after the task completes. But the client would hangs up to wait for the result message if the task cos...
2012/01/10
[ "https://Stackoverflow.com/questions/8798985", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1124954/" ]
This problem is solved. using the `tcpdump` to capture the messages flows. I have found that while in the application level, `ObjectOutputStream.writeObject()` method was invoked, in the tcp level, many times `[TCP ReTransmission]` were found. So, I concluded that the connection is possibly be dead, although using th...
The `read()` methods of `java.io.InputStream` are *blocking* calls., which means they wait "forever" if they are called when there is no data in the stream to read. This is completely expected behaviour and as per the published contract in javadoc if the server does not respond. If you want a non-blocking read, use t...
70,973,755
iOS 15 Swift 5.5 Trying to understand preferences, but struggling with GeometryReader I crafted this code reading a tutorial, but it doesn't work correctly. The green box should appear over the red dot, the first one. But it is over the centre one. When I tap on the dot, it moves to the third...it feels like SwiftUI d...
2022/02/03
[ "https://Stackoverflow.com/questions/70973755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3069232/" ]
This is an example using `AsyncValue` - It eliminates the `repository` Have your service.dart file like this: ``` final blogServiceProvider = Provider<BlogService>((ref) => BlogService()); class BlogService { Future<AsyncValue<List<BlogPost>>> getBlogPost() async { try { var dio = Dio(); Response r...
Please best wa create another class to provide data from Api and use drift Package see my screens how i provide data from database (drift is sqlite DB) This is my database class based on sqlite(drift) ``` import 'dart:io'; import 'package:drift/native.dart'; import 'package:mobile_nsk/models/policy/driver.dart'; impor...
2,727,480
Let $(D,\prec) $ be a directed set. Is there a "cofinal chain" in $D $? By chain I mean a $D'\subset D $ such that for all $\lambda,\gamma \in D'$, then $\lambda\prec \gamma $ or $\gamma\prec \lambda $. By cofinal chain I mean a chain $D'$ for which, for every $\gamma\in D $, there is some $\lambda \in D'$ such that $\...
2018/04/08
[ "https://math.stackexchange.com/questions/2727480", "https://math.stackexchange.com", "https://math.stackexchange.com/users/177211/" ]
Take $X$ to be your favorite uncountable set. Now take $D$ to be the finite subsets of $X$, ordered by inclusion. Easily, this set is directed. But there are no chains with order type longer than $\omega$, and so no chain can have an uncountable union, and in particular, no chain is cofinal. (If you choose $X$ wisely...
If such chains always existed, say under AC, directed sets would have no use in ZFC since most constructions involving directed sets could be done using such cofinal chains. But it is not the case. For instance let $\omega\_1$ be ordered by divisibility $|$ under Hessenberg product. For $\alpha,\beta\in \omega\_1$, $\...
46,774,880
I must be doing something wrong, but the following commented code returns false. Note that WP is returning 'admin' as the 'user\_login', but when that user\_login is used for the `get_user_by()` function it simply returns false. Am I missing something? ``` $user = get_userdata(1); // (admin ID is 1) var_dump($user->u...
2017/10/16
[ "https://Stackoverflow.com/questions/46774880", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5433458/" ]
I believe you'll need to use "login" rather by "user\_login" in the get\_user\_by call. See the posssible accepted values of the function here: <https://developer.wordpress.org/reference/functions/get_user_by/>
Try this one it's working ``` $user = get_userdata(1); // admin ID = 1 var_dump($user->user_login); // string(5) 'admin' var_dump(get_user_by('login', $user->user_login)); // return array with data ```
3,098,881
Ive looked and tried but I can't find an answer. In PHP, is it possible to call a class' member function (when that class requires a constructor to receive parameters) without instantiating it as an object? A code example (which gives errors): ``` <?php class Test { private $end=""; function __construct($...
2010/06/23
[ "https://Stackoverflow.com/questions/3098881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/373039/" ]
Just do this (in PHP >= 5.4): ``` $t = (new Test("Hello"))->foo("world"); ```
You can't call an instance-level method without an instance. Your syntax: > > > ``` > echo Test("world")::alert("hello"); > > ``` > > doesn't make a lot of sense. Either you're creating an inline instance and discarding it immediately or the `alert()` method has no implicit `this` instance. Assuming: ``` class...
3,098,881
Ive looked and tried but I can't find an answer. In PHP, is it possible to call a class' member function (when that class requires a constructor to receive parameters) without instantiating it as an object? A code example (which gives errors): ``` <?php class Test { private $end=""; function __construct($...
2010/06/23
[ "https://Stackoverflow.com/questions/3098881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/373039/" ]
I, too, was looking for a one-liner to accomplish this as part of a single expression for converting dates from one format to another. I like doing this in a single line of code because it is a single logical operation. So, this is a little cryptic, but it lets you instantiate and use a date object within a single line...
``` // this does not work: echo Test("world")::alert("hello"); // works, as you are calling not to an object of the class, but to its namespace echo Test::alert("hello"); ```
3,098,881
Ive looked and tried but I can't find an answer. In PHP, is it possible to call a class' member function (when that class requires a constructor to receive parameters) without instantiating it as an object? A code example (which gives errors): ``` <?php class Test { private $end=""; function __construct($...
2010/06/23
[ "https://Stackoverflow.com/questions/3098881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/373039/" ]
Unfortunately PHP doesn't have support to do this, but you are a creative and look guy :D You can use an "factory", sample: ``` <?php class Foo { private $__aaa = null; public function __construct($aaa) { $this->__aaa = $aaa; } public static function factory($aaa) { return new Foo($aa...
Just do this (in PHP >= 5.4): ``` $t = (new Test("Hello"))->foo("world"); ```
3,098,881
Ive looked and tried but I can't find an answer. In PHP, is it possible to call a class' member function (when that class requires a constructor to receive parameters) without instantiating it as an object? A code example (which gives errors): ``` <?php class Test { private $end=""; function __construct($...
2010/06/23
[ "https://Stackoverflow.com/questions/3098881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/373039/" ]
For this you can do a <https://www.php.net/manual/en/reflectionclass.newinstancewithoutconstructor.php> reflect your class and trigger the new instance without constructor. Here a sample code: ``` <?php class Test { private $end=""; function __construct($value) { $this->end=$value; } publ...
``` // this does not work: echo Test("world")::alert("hello"); // works, as you are calling not to an object of the class, but to its namespace echo Test::alert("hello"); ```
3,098,881
Ive looked and tried but I can't find an answer. In PHP, is it possible to call a class' member function (when that class requires a constructor to receive parameters) without instantiating it as an object? A code example (which gives errors): ``` <?php class Test { private $end=""; function __construct($...
2010/06/23
[ "https://Stackoverflow.com/questions/3098881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/373039/" ]
Unfortunately PHP doesn't have support to do this, but you are a creative and look guy :D You can use an "factory", sample: ``` <?php class Foo { private $__aaa = null; public function __construct($aaa) { $this->__aaa = $aaa; } public static function factory($aaa) { return new Foo($aa...
I, too, was looking for a one-liner to accomplish this as part of a single expression for converting dates from one format to another. I like doing this in a single line of code because it is a single logical operation. So, this is a little cryptic, but it lets you instantiate and use a date object within a single line...
3,098,881
Ive looked and tried but I can't find an answer. In PHP, is it possible to call a class' member function (when that class requires a constructor to receive parameters) without instantiating it as an object? A code example (which gives errors): ``` <?php class Test { private $end=""; function __construct($...
2010/06/23
[ "https://Stackoverflow.com/questions/3098881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/373039/" ]
You can't call an instance-level method without an instance. Your syntax: > > > ``` > echo Test("world")::alert("hello"); > > ``` > > doesn't make a lot of sense. Either you're creating an inline instance and discarding it immediately or the `alert()` method has no implicit `this` instance. Assuming: ``` class...
``` // this does not work: echo Test("world")::alert("hello"); // works, as you are calling not to an object of the class, but to its namespace echo Test::alert("hello"); ```
3,098,881
Ive looked and tried but I can't find an answer. In PHP, is it possible to call a class' member function (when that class requires a constructor to receive parameters) without instantiating it as an object? A code example (which gives errors): ``` <?php class Test { private $end=""; function __construct($...
2010/06/23
[ "https://Stackoverflow.com/questions/3098881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/373039/" ]
Unfortunately PHP doesn't have support to do this, but you are a creative and look guy :D You can use an "factory", sample: ``` <?php class Foo { private $__aaa = null; public function __construct($aaa) { $this->__aaa = $aaa; } public static function factory($aaa) { return new Foo($aa...
You can't call an instance-level method without an instance. Your syntax: > > > ``` > echo Test("world")::alert("hello"); > > ``` > > doesn't make a lot of sense. Either you're creating an inline instance and discarding it immediately or the `alert()` method has no implicit `this` instance. Assuming: ``` class...
3,098,881
Ive looked and tried but I can't find an answer. In PHP, is it possible to call a class' member function (when that class requires a constructor to receive parameters) without instantiating it as an object? A code example (which gives errors): ``` <?php class Test { private $end=""; function __construct($...
2010/06/23
[ "https://Stackoverflow.com/questions/3098881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/373039/" ]
Unfortunately PHP doesn't have support to do this, but you are a creative and look guy :D You can use an "factory", sample: ``` <?php class Foo { private $__aaa = null; public function __construct($aaa) { $this->__aaa = $aaa; } public static function factory($aaa) { return new Foo($aa...
``` // this does not work: echo Test("world")::alert("hello"); // works, as you are calling not to an object of the class, but to its namespace echo Test::alert("hello"); ```
3,098,881
Ive looked and tried but I can't find an answer. In PHP, is it possible to call a class' member function (when that class requires a constructor to receive parameters) without instantiating it as an object? A code example (which gives errors): ``` <?php class Test { private $end=""; function __construct($...
2010/06/23
[ "https://Stackoverflow.com/questions/3098881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/373039/" ]
I, too, was looking for a one-liner to accomplish this as part of a single expression for converting dates from one format to another. I like doing this in a single line of code because it is a single logical operation. So, this is a little cryptic, but it lets you instantiate and use a date object within a single line...
For this you can do a <https://www.php.net/manual/en/reflectionclass.newinstancewithoutconstructor.php> reflect your class and trigger the new instance without constructor. Here a sample code: ``` <?php class Test { private $end=""; function __construct($value) { $this->end=$value; } publ...
3,098,881
Ive looked and tried but I can't find an answer. In PHP, is it possible to call a class' member function (when that class requires a constructor to receive parameters) without instantiating it as an object? A code example (which gives errors): ``` <?php class Test { private $end=""; function __construct($...
2010/06/23
[ "https://Stackoverflow.com/questions/3098881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/373039/" ]
Unfortunately PHP doesn't have support to do this, but you are a creative and look guy :D You can use an "factory", sample: ``` <?php class Foo { private $__aaa = null; public function __construct($aaa) { $this->__aaa = $aaa; } public static function factory($aaa) { return new Foo($aa...
For this you can do a <https://www.php.net/manual/en/reflectionclass.newinstancewithoutconstructor.php> reflect your class and trigger the new instance without constructor. Here a sample code: ``` <?php class Test { private $end=""; function __construct($value) { $this->end=$value; } publ...
49,148,842
I am working on a show page based on the `match.params` from react router 4. For some reason, some functions runs 3 times which gives me the first 2 times undefined and the third time the result I want. So I have this Show component which have the props "projects" from the main component. In this show component I do a...
2018/03/07
[ "https://Stackoverflow.com/questions/49148842", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5503094/" ]
Without altering the order of your data, we can do the following: ``` import pandas as pd from io import StringIO data = StringIO('''id,user,timestamp,song 0,user_000001,05-05-09 12:08,The Start of Something 1,user_000001,04-05-09 14:54,My Sharona 2,user_000001,04-05-09 14:52,Caught by the river 3,user_000001,04-05-0...
This works, but I've reordered the data per user and timestamp ascending: ``` df['timestamp'] = pd.to_datetime(df['timestamp'], format='%d-%m-%y %H:%M') df=df.sort_values(['user', 'timestamp']) session = 1000 def counter(clause): global session if not clause: session += 1 return session df[['u', ...
30,669,015
I have a tkinter 'Text' and 'Scrollbar' working fine. In my program in the text window automatically lines will keep on adding. So When a new line of text is inserted and data reached out of limit I would like the text and scrollbar to be scrolled to the bottom automatically, so that the latest line of text is always s...
2015/06/05
[ "https://Stackoverflow.com/questions/30669015", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4946244/" ]
You can cause the text widget to scroll to any location with the `see` which takes an index. For example, to make the last line of the widget visible you can use the index `"end"`: ``` outputwindow.see("end") ``` Here's a complete working example: ``` import time try: # python 2.x import Tkinter as tk exce...
Take a look at `Text.see(...)` method. ``` TextWidget.insert(tk.END, str(new_txt)) TextWidget.see(tk.END) ``` I used this pattern to add (aka `insert`) text `new_txt` to my output window and scroll (`see`) to the bottom (`tk.END`)
30,669,015
I have a tkinter 'Text' and 'Scrollbar' working fine. In my program in the text window automatically lines will keep on adding. So When a new line of text is inserted and data reached out of limit I would like the text and scrollbar to be scrolled to the bottom automatically, so that the latest line of text is always s...
2015/06/05
[ "https://Stackoverflow.com/questions/30669015", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4946244/" ]
You can cause the text widget to scroll to any location with the `see` which takes an index. For example, to make the last line of the widget visible you can use the index `"end"`: ``` outputwindow.see("end") ``` Here's a complete working example: ``` import time try: # python 2.x import Tkinter as tk exce...
although very useful, using Text.see(...) in the above manner defeats the purpose of having a scrollbar. Better would be insert text at "0." instead of tk.END. That way, it initially autoscrolls, but you can drag it down to anywhere and it will stay there (while updating its range as more text is added, but the text yo...
30,669,015
I have a tkinter 'Text' and 'Scrollbar' working fine. In my program in the text window automatically lines will keep on adding. So When a new line of text is inserted and data reached out of limit I would like the text and scrollbar to be scrolled to the bottom automatically, so that the latest line of text is always s...
2015/06/05
[ "https://Stackoverflow.com/questions/30669015", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4946244/" ]
You can cause the text widget to scroll to any location with the `see` which takes an index. For example, to make the last line of the widget visible you can use the index `"end"`: ``` outputwindow.see("end") ``` Here's a complete working example: ``` import time try: # python 2.x import Tkinter as tk exce...
Add this after the insert TextBox.yview(END)
30,669,015
I have a tkinter 'Text' and 'Scrollbar' working fine. In my program in the text window automatically lines will keep on adding. So When a new line of text is inserted and data reached out of limit I would like the text and scrollbar to be scrolled to the bottom automatically, so that the latest line of text is always s...
2015/06/05
[ "https://Stackoverflow.com/questions/30669015", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4946244/" ]
Take a look at `Text.see(...)` method. ``` TextWidget.insert(tk.END, str(new_txt)) TextWidget.see(tk.END) ``` I used this pattern to add (aka `insert`) text `new_txt` to my output window and scroll (`see`) to the bottom (`tk.END`)
although very useful, using Text.see(...) in the above manner defeats the purpose of having a scrollbar. Better would be insert text at "0." instead of tk.END. That way, it initially autoscrolls, but you can drag it down to anywhere and it will stay there (while updating its range as more text is added, but the text yo...
30,669,015
I have a tkinter 'Text' and 'Scrollbar' working fine. In my program in the text window automatically lines will keep on adding. So When a new line of text is inserted and data reached out of limit I would like the text and scrollbar to be scrolled to the bottom automatically, so that the latest line of text is always s...
2015/06/05
[ "https://Stackoverflow.com/questions/30669015", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4946244/" ]
Take a look at `Text.see(...)` method. ``` TextWidget.insert(tk.END, str(new_txt)) TextWidget.see(tk.END) ``` I used this pattern to add (aka `insert`) text `new_txt` to my output window and scroll (`see`) to the bottom (`tk.END`)
Add this after the insert TextBox.yview(END)
30,591,025
I have a problem similar to this one: [SFINAE tried with bool gives compiler error: "template argument ‘T::value’ involves template parameter"](https://stackoverflow.com/questions/7776448/sfinae-tried-with-bool-gives-compiler-error-template-argument-tvalue-invol) I want to define a trait that tells if a complex repres...
2015/06/02
[ "https://Stackoverflow.com/questions/30591025", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1930508/" ]
On the assumption that `IsAoS<T>`'s desired behavior is: * If `IsComplex<T>::value` is `false`, it defaults to `false_type`; * Otherwise, it is an error unless the user provides a specialization. It's straightforward to implement with a `static_assert`; no default template argument needed: ``` template< typename T >...
If I understand correctly, you want: ``` template<class> struct IsComplex_impl {using type = std::false_type;}; template<class T> struct IsComplex_impl<std::complex<T>> {using type = std::true_type;}; template <typename T> using IsComplex = typename IsComplex_impl<T>::type; // Declaration only template<typename T,...
34,481,610
I'm working on an iOS app, that should work fine with both iphones and ipads. As I know we can build the app as universal or convert iphone storyboard into ipad storyboard.What I want to know is, what is the best way from these and, when we launch app to app store, is it a problem to have two storyboards one for iphone...
2015/12/27
[ "https://Stackoverflow.com/questions/34481610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5680499/" ]
Your approach is too complicated. You don't need to examine every array element. The first value is `4`, so `7` is *at least* `7-4` elements away, and you can skip those. ``` #include <stdio.h> #include <stdlib.h> int main (void) { int array[] = {4,5,6,5,4,3,2,3,4,5,6,7,8}; int len = sizeof array / sizeof arr...
A variation of the conventional linear search could be a good way to go. Let us pick an element say `array[i] = 2`. Now, `array[i + 1]` will either be 1 or 3 (odd), `array[i + 2]` will be (positive integers only) 2 or 4 (even number). On continuing like this, a pattern is observable - `array[i + 2*n]` will hold even ...
34,481,610
I'm working on an iOS app, that should work fine with both iphones and ipads. As I know we can build the app as universal or convert iphone storyboard into ipad storyboard.What I want to know is, what is the best way from these and, when we launch app to app store, is it a problem to have two storyboards one for iphone...
2015/12/27
[ "https://Stackoverflow.com/questions/34481610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5680499/" ]
Your approach is too complicated. You don't need to examine every array element. The first value is `4`, so `7` is *at least* `7-4` elements away, and you can skip those. ``` #include <stdio.h> #include <stdlib.h> int main (void) { int array[] = {4,5,6,5,4,3,2,3,4,5,6,7,8}; int len = sizeof array / sizeof arr...
Here is a divide-and-conquer style solution. At the expense of (much) more bookkeeping, we can skip more elements; rather than scanning left-to-right, test in the middle and skip in *both* directions. ``` #include <stdio.h> #include <math.h> ...
34,481,610
I'm working on an iOS app, that should work fine with both iphones and ipads. As I know we can build the app as universal or convert iphone storyboard into ipad storyboard.What I want to know is, what is the best way from these and, when we launch app to app store, is it a problem to have two storyboards one for iphone...
2015/12/27
[ "https://Stackoverflow.com/questions/34481610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5680499/" ]
You can do a linear search with steps that are often greater than 1. The crucial observation is that if e.g. `array[i] == 4` and 7 hasn't yet appeared then the next candidate for 7 is at index `i+3`. Use a while loop which repeatedly goes directly to the next viable candidate. Here is an implementation, slightly gener...
The approach presented by John Coleman is what the interviewer was hoping for, in all probability. If you are willing to go quite a bit more complicated, you can increase expected skip length: Call the target value *k*. Start with the first element's value *v* at position *p* and call the difference k-v *dv* with...
34,481,610
I'm working on an iOS app, that should work fine with both iphones and ipads. As I know we can build the app as universal or convert iphone storyboard into ipad storyboard.What I want to know is, what is the best way from these and, when we launch app to app store, is it a problem to have two storyboards one for iphone...
2015/12/27
[ "https://Stackoverflow.com/questions/34481610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5680499/" ]
The approach presented by John Coleman is what the interviewer was hoping for, in all probability. If you are willing to go quite a bit more complicated, you can increase expected skip length: Call the target value *k*. Start with the first element's value *v* at position *p* and call the difference k-v *dv* with...
``` const findMeAnElementsFunkyArray = (arr, ele, i) => { const elementAtCurrentIndex = arr[i]; const differenceBetweenEleAndEleAtIndex = Math.abs( ele - elementAtCurrentIndex ); const hop = i + differenceBetweenEleAndEleAtIndex; if (i >= arr.length) { return; } if (arr[i] === ele) { retur...
34,481,610
I'm working on an iOS app, that should work fine with both iphones and ipads. As I know we can build the app as universal or convert iphone storyboard into ipad storyboard.What I want to know is, what is the best way from these and, when we launch app to app store, is it a problem to have two storyboards one for iphone...
2015/12/27
[ "https://Stackoverflow.com/questions/34481610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5680499/" ]
Your approach is too complicated. You don't need to examine every array element. The first value is `4`, so `7` is *at least* `7-4` elements away, and you can skip those. ``` #include <stdio.h> #include <stdlib.h> int main (void) { int array[] = {4,5,6,5,4,3,2,3,4,5,6,7,8}; int len = sizeof array / sizeof arr...
``` const findMeAnElementsFunkyArray = (arr, ele, i) => { const elementAtCurrentIndex = arr[i]; const differenceBetweenEleAndEleAtIndex = Math.abs( ele - elementAtCurrentIndex ); const hop = i + differenceBetweenEleAndEleAtIndex; if (i >= arr.length) { return; } if (arr[i] === ele) { retur...
34,481,610
I'm working on an iOS app, that should work fine with both iphones and ipads. As I know we can build the app as universal or convert iphone storyboard into ipad storyboard.What I want to know is, what is the best way from these and, when we launch app to app store, is it a problem to have two storyboards one for iphone...
2015/12/27
[ "https://Stackoverflow.com/questions/34481610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5680499/" ]
The approach presented by John Coleman is what the interviewer was hoping for, in all probability. If you are willing to go quite a bit more complicated, you can increase expected skip length: Call the target value *k*. Start with the first element's value *v* at position *p* and call the difference k-v *dv* with...
Here is a divide-and-conquer style solution. At the expense of (much) more bookkeeping, we can skip more elements; rather than scanning left-to-right, test in the middle and skip in *both* directions. ``` #include <stdio.h> #include <math.h> ...
34,481,610
I'm working on an iOS app, that should work fine with both iphones and ipads. As I know we can build the app as universal or convert iphone storyboard into ipad storyboard.What I want to know is, what is the best way from these and, when we launch app to app store, is it a problem to have two storyboards one for iphone...
2015/12/27
[ "https://Stackoverflow.com/questions/34481610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5680499/" ]
The approach presented by John Coleman is what the interviewer was hoping for, in all probability. If you are willing to go quite a bit more complicated, you can increase expected skip length: Call the target value *k*. Start with the first element's value *v* at position *p* and call the difference k-v *dv* with...
**STEP 1** Start with the first element and check if it's 7. Let's say `c` is the index of the current position. So, initially, `c = 0`. **STEP 2** If it is 7, you found the index. It's `c`. If you've reached the end of the array, break out. **STEP 3** If it's not, then 7 must be atleast `|array[c]-7|` positions ...
34,481,610
I'm working on an iOS app, that should work fine with both iphones and ipads. As I know we can build the app as universal or convert iphone storyboard into ipad storyboard.What I want to know is, what is the best way from these and, when we launch app to app store, is it a problem to have two storyboards one for iphone...
2015/12/27
[ "https://Stackoverflow.com/questions/34481610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5680499/" ]
A variation of the conventional linear search could be a good way to go. Let us pick an element say `array[i] = 2`. Now, `array[i + 1]` will either be 1 or 3 (odd), `array[i + 2]` will be (positive integers only) 2 or 4 (even number). On continuing like this, a pattern is observable - `array[i + 2*n]` will hold even ...
``` const findMeAnElementsFunkyArray = (arr, ele, i) => { const elementAtCurrentIndex = arr[i]; const differenceBetweenEleAndEleAtIndex = Math.abs( ele - elementAtCurrentIndex ); const hop = i + differenceBetweenEleAndEleAtIndex; if (i >= arr.length) { return; } if (arr[i] === ele) { retur...
34,481,610
I'm working on an iOS app, that should work fine with both iphones and ipads. As I know we can build the app as universal or convert iphone storyboard into ipad storyboard.What I want to know is, what is the best way from these and, when we launch app to app store, is it a problem to have two storyboards one for iphone...
2015/12/27
[ "https://Stackoverflow.com/questions/34481610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5680499/" ]
You can do a linear search with steps that are often greater than 1. The crucial observation is that if e.g. `array[i] == 4` and 7 hasn't yet appeared then the next candidate for 7 is at index `i+3`. Use a while loop which repeatedly goes directly to the next viable candidate. Here is an implementation, slightly gener...
A variation of the conventional linear search could be a good way to go. Let us pick an element say `array[i] = 2`. Now, `array[i + 1]` will either be 1 or 3 (odd), `array[i + 2]` will be (positive integers only) 2 or 4 (even number). On continuing like this, a pattern is observable - `array[i + 2*n]` will hold even ...
34,481,610
I'm working on an iOS app, that should work fine with both iphones and ipads. As I know we can build the app as universal or convert iphone storyboard into ipad storyboard.What I want to know is, what is the best way from these and, when we launch app to app store, is it a problem to have two storyboards one for iphone...
2015/12/27
[ "https://Stackoverflow.com/questions/34481610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5680499/" ]
You can do a linear search with steps that are often greater than 1. The crucial observation is that if e.g. `array[i] == 4` and 7 hasn't yet appeared then the next candidate for 7 is at index `i+3`. Use a while loop which repeatedly goes directly to the next viable candidate. Here is an implementation, slightly gener...
Here is a divide-and-conquer style solution. At the expense of (much) more bookkeeping, we can skip more elements; rather than scanning left-to-right, test in the middle and skip in *both* directions. ``` #include <stdio.h> #include <math.h> ...
698,478
I have to run Mac OS on virtual box for a class and it keeps giving me errors stating "VT-x/AMD-V hardware acceleration not available on your system. Certain guests (e.g. OS/2 and QNX) require this feature and will fail to boot without it." If there is a solution, I am not used to windows 8.1 and will need detailed ...
2014/01/08
[ "https://superuser.com/questions/698478", "https://superuser.com", "https://superuser.com/users/287753/" ]
Do you have Hyper-V installed? For example it may have been added if you installed the Windows Phone emulators which come with Visual Studio 2012 & 2013. If so, then there is a known conflict between Hyper-V and VirtualBox - [Hardware Virtualisation support not detected if Hyper-V installed](https://www.virtualbox.org...
As previous replies have said, check if your processor supports VT-x virtualization. If it doesn't, then you just won't be able to run Mac OS on VirtualBox. If that is the case, consider VMWare Player, which is a decent alternative for VirtualBox, and is also free. It is commonly used in computers whose processors don'...
698,478
I have to run Mac OS on virtual box for a class and it keeps giving me errors stating "VT-x/AMD-V hardware acceleration not available on your system. Certain guests (e.g. OS/2 and QNX) require this feature and will fail to boot without it." If there is a solution, I am not used to windows 8.1 and will need detailed ...
2014/01/08
[ "https://superuser.com/questions/698478", "https://superuser.com", "https://superuser.com/users/287753/" ]
***You don't have to uninstall/reinstall HyperV*** I ran into this same issue using the new Visual Studio 2015 Android emulator and Windows Phone emulator, while also trying to run VirtualBox clients. Unfortunately you can't run VBox at the same time as the other emulators; you just have to setup a new boot option and...
As previous replies have said, check if your processor supports VT-x virtualization. If it doesn't, then you just won't be able to run Mac OS on VirtualBox. If that is the case, consider VMWare Player, which is a decent alternative for VirtualBox, and is also free. It is commonly used in computers whose processors don'...
698,478
I have to run Mac OS on virtual box for a class and it keeps giving me errors stating "VT-x/AMD-V hardware acceleration not available on your system. Certain guests (e.g. OS/2 and QNX) require this feature and will fail to boot without it." If there is a solution, I am not used to windows 8.1 and will need detailed ...
2014/01/08
[ "https://superuser.com/questions/698478", "https://superuser.com", "https://superuser.com/users/287753/" ]
For anyone else who may look this up in future. I had the same problem. Turns out virtualization had been disabled in the bios. Check if this is the case. If so, just enable it and the error is gone
As previous replies have said, check if your processor supports VT-x virtualization. If it doesn't, then you just won't be able to run Mac OS on VirtualBox. If that is the case, consider VMWare Player, which is a decent alternative for VirtualBox, and is also free. It is commonly used in computers whose processors don'...
698,478
I have to run Mac OS on virtual box for a class and it keeps giving me errors stating "VT-x/AMD-V hardware acceleration not available on your system. Certain guests (e.g. OS/2 and QNX) require this feature and will fail to boot without it." If there is a solution, I am not used to windows 8.1 and will need detailed ...
2014/01/08
[ "https://superuser.com/questions/698478", "https://superuser.com", "https://superuser.com/users/287753/" ]
Do you have Hyper-V installed? For example it may have been added if you installed the Windows Phone emulators which come with Visual Studio 2012 & 2013. If so, then there is a known conflict between Hyper-V and VirtualBox - [Hardware Virtualisation support not detected if Hyper-V installed](https://www.virtualbox.org...
For anyone else who may look this up in future. I had the same problem. Turns out virtualization had been disabled in the bios. Check if this is the case. If so, just enable it and the error is gone
698,478
I have to run Mac OS on virtual box for a class and it keeps giving me errors stating "VT-x/AMD-V hardware acceleration not available on your system. Certain guests (e.g. OS/2 and QNX) require this feature and will fail to boot without it." If there is a solution, I am not used to windows 8.1 and will need detailed ...
2014/01/08
[ "https://superuser.com/questions/698478", "https://superuser.com", "https://superuser.com/users/287753/" ]
***You don't have to uninstall/reinstall HyperV*** I ran into this same issue using the new Visual Studio 2015 Android emulator and Windows Phone emulator, while also trying to run VirtualBox clients. Unfortunately you can't run VBox at the same time as the other emulators; you just have to setup a new boot option and...
For anyone else who may look this up in future. I had the same problem. Turns out virtualization had been disabled in the bios. Check if this is the case. If so, just enable it and the error is gone
10,315,793
Okay, you may call me a noob but I'm realling confused. My ex classmate paid me to write a program in C. She gave me the task and it said something like "blah blah blah make at least TWO CLASSES, write at least ONE CONSTRUCTOR and rewrite at least ONE METHOD" it says that word by word. And then I told her "this is C+...
2012/04/25
[ "https://Stackoverflow.com/questions/10315793", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1289097/" ]
C doesn't support classes, but we do have **tricky hacky workaround**. Read entire explanation or simply scroll down to code section. struct declaration: ------------------- I declared an `struct` with name **class**. Inside, I put uninitialized `function` with type **void**, name **Print** and one parameter **char**...
C mostly uses functional/structural programming instead of implementing Object Oriented Programming as in languages like C++ , Java , Python etc. which use classes . But in few instances we use classes like in: ```c typedef struct { ShapeClass shape; float width, height; } RectangleClass; ``` Hope it helped.
10,315,793
Okay, you may call me a noob but I'm realling confused. My ex classmate paid me to write a program in C. She gave me the task and it said something like "blah blah blah make at least TWO CLASSES, write at least ONE CONSTRUCTOR and rewrite at least ONE METHOD" it says that word by word. And then I told her "this is C+...
2012/04/25
[ "https://Stackoverflow.com/questions/10315793", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1289097/" ]
No, C doesn't have classes. That said, there are ways of simulating object-oriented programming in C - a quick Google search should yield some useful results.
A classic case of conflicting requirements, it seems :-) The terminology of her requirements *CLASS, CONSTRUCTOR, METHOD* are all C++ terminology, while none of them is C terminology (the closest of which would arguably be *STRUCT, INITIALIZATION, FUNCTION*). Your friend **is** confusing something here. I doubt that h...
10,315,793
Okay, you may call me a noob but I'm realling confused. My ex classmate paid me to write a program in C. She gave me the task and it said something like "blah blah blah make at least TWO CLASSES, write at least ONE CONSTRUCTOR and rewrite at least ONE METHOD" it says that word by word. And then I told her "this is C+...
2012/04/25
[ "https://Stackoverflow.com/questions/10315793", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1289097/" ]
No, C doesn't have classes. That said, there are ways of simulating object-oriented programming in C - a quick Google search should yield some useful results.
C does not have classes. But one can approximate a class by using static globals as private class members, and static functions as private member functions. extern members as public. In this case an entire file could be viewed as a class. Probably this is not what you want.
10,315,793
Okay, you may call me a noob but I'm realling confused. My ex classmate paid me to write a program in C. She gave me the task and it said something like "blah blah blah make at least TWO CLASSES, write at least ONE CONSTRUCTOR and rewrite at least ONE METHOD" it says that word by word. And then I told her "this is C+...
2012/04/25
[ "https://Stackoverflow.com/questions/10315793", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1289097/" ]
C does not have the formal construct of a class. You can produce modules with module-level data that by your own agreement you will not extern anywhere else, or static data, and write functions to get, set, and otherwise manipulate that data. You can even go to the point of using function pointers to manipulate similar...
C mostly uses functional/structural programming instead of implementing Object Oriented Programming as in languages like C++ , Java , Python etc. which use classes . But in few instances we use classes like in: ```c typedef struct { ShapeClass shape; float width, height; } RectangleClass; ``` Hope it helped.
10,315,793
Okay, you may call me a noob but I'm realling confused. My ex classmate paid me to write a program in C. She gave me the task and it said something like "blah blah blah make at least TWO CLASSES, write at least ONE CONSTRUCTOR and rewrite at least ONE METHOD" it says that word by word. And then I told her "this is C+...
2012/04/25
[ "https://Stackoverflow.com/questions/10315793", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1289097/" ]
No, C doesn't have classes. That said, there are ways of simulating object-oriented programming in C - a quick Google search should yield some useful results.
C does not have classes, but you can emulate it with structures and pointers to a function. C99 is a little bit (just a bit) based on C++, so it's easy to reproduce classes with C.
10,315,793
Okay, you may call me a noob but I'm realling confused. My ex classmate paid me to write a program in C. She gave me the task and it said something like "blah blah blah make at least TWO CLASSES, write at least ONE CONSTRUCTOR and rewrite at least ONE METHOD" it says that word by word. And then I told her "this is C+...
2012/04/25
[ "https://Stackoverflow.com/questions/10315793", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1289097/" ]
No, C has no classes per se, only C++ (which started out as "C with classes" back then...). But you can use the standard C library in C++ code, even if it is often not considered good practice (where C++ has its own, higher level constructs, e.g. `cout` vs `printf`). You can sort of emulate the behaviour of classes, i...
C does not have classes. But one can approximate a class by using static globals as private class members, and static functions as private member functions. extern members as public. In this case an entire file could be viewed as a class. Probably this is not what you want.
10,315,793
Okay, you may call me a noob but I'm realling confused. My ex classmate paid me to write a program in C. She gave me the task and it said something like "blah blah blah make at least TWO CLASSES, write at least ONE CONSTRUCTOR and rewrite at least ONE METHOD" it says that word by word. And then I told her "this is C+...
2012/04/25
[ "https://Stackoverflow.com/questions/10315793", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1289097/" ]
No, C doesn't have classes. That said, there are ways of simulating object-oriented programming in C - a quick Google search should yield some useful results.
C mostly uses functional/structural programming instead of implementing Object Oriented Programming as in languages like C++ , Java , Python etc. which use classes . But in few instances we use classes like in: ```c typedef struct { ShapeClass shape; float width, height; } RectangleClass; ``` Hope it helped.
10,315,793
Okay, you may call me a noob but I'm realling confused. My ex classmate paid me to write a program in C. She gave me the task and it said something like "blah blah blah make at least TWO CLASSES, write at least ONE CONSTRUCTOR and rewrite at least ONE METHOD" it says that word by word. And then I told her "this is C+...
2012/04/25
[ "https://Stackoverflow.com/questions/10315793", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1289097/" ]
No, C has no classes per se, only C++ (which started out as "C with classes" back then...). But you can use the standard C library in C++ code, even if it is often not considered good practice (where C++ has its own, higher level constructs, e.g. `cout` vs `printf`). You can sort of emulate the behaviour of classes, i...
C mostly uses functional/structural programming instead of implementing Object Oriented Programming as in languages like C++ , Java , Python etc. which use classes . But in few instances we use classes like in: ```c typedef struct { ShapeClass shape; float width, height; } RectangleClass; ``` Hope it helped.
10,315,793
Okay, you may call me a noob but I'm realling confused. My ex classmate paid me to write a program in C. She gave me the task and it said something like "blah blah blah make at least TWO CLASSES, write at least ONE CONSTRUCTOR and rewrite at least ONE METHOD" it says that word by word. And then I told her "this is C+...
2012/04/25
[ "https://Stackoverflow.com/questions/10315793", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1289097/" ]
No, C doesn't have classes. That said, there are ways of simulating object-oriented programming in C - a quick Google search should yield some useful results.
C doesn't support classes, but we do have **tricky hacky workaround**. Read entire explanation or simply scroll down to code section. struct declaration: ------------------- I declared an `struct` with name **class**. Inside, I put uninitialized `function` with type **void**, name **Print** and one parameter **char**...
10,315,793
Okay, you may call me a noob but I'm realling confused. My ex classmate paid me to write a program in C. She gave me the task and it said something like "blah blah blah make at least TWO CLASSES, write at least ONE CONSTRUCTOR and rewrite at least ONE METHOD" it says that word by word. And then I told her "this is C+...
2012/04/25
[ "https://Stackoverflow.com/questions/10315793", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1289097/" ]
C does not have classes. But one can approximate a class by using static globals as private class members, and static functions as private member functions. extern members as public. In this case an entire file could be viewed as a class. Probably this is not what you want.
C mostly uses functional/structural programming instead of implementing Object Oriented Programming as in languages like C++ , Java , Python etc. which use classes . But in few instances we use classes like in: ```c typedef struct { ShapeClass shape; float width, height; } RectangleClass; ``` Hope it helped.
80,774
I recently switched to a new PC at work, one with two (identical, Dell 23") monitors. I'm running Linux Mint 15 64bit / Cinnamon. Is there a way to set it up in such a way that, instead of both monitors sharing the same huge workspace, they are on separate smaller ones? E.g. left monitor on workspace 1, right monitor o...
2013/06/26
[ "https://unix.stackexchange.com/questions/80774", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/41904/" ]
Short answer: yes, you can do this. I have my (Fedora) desktop set up this way, each monitor is an independent display. It is the same 'desktop', in the X sense, but there are some limitations to typical desktop functionality with this setup versus the 'single desktop spread over two monitors' configuration. [For examp...
Found this on the Ubuntu Forums in a thread titled: [gnome panels on two monitors](http://ubuntuforums.org/showthread.php?t=1417900). *excerpt* I believe what you want is the following: 1. You have to right click the panels on Monitor #1 and choose "New Panel" 2. Then hold Alt and click and drag the new panel to Mon...
80,774
I recently switched to a new PC at work, one with two (identical, Dell 23") monitors. I'm running Linux Mint 15 64bit / Cinnamon. Is there a way to set it up in such a way that, instead of both monitors sharing the same huge workspace, they are on separate smaller ones? E.g. left monitor on workspace 1, right monitor o...
2013/06/26
[ "https://unix.stackexchange.com/questions/80774", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/41904/" ]
Found this on the Ubuntu Forums in a thread titled: [gnome panels on two monitors](http://ubuntuforums.org/showthread.php?t=1417900). *excerpt* I believe what you want is the following: 1. You have to right click the panels on Monitor #1 and choose "New Panel" 2. Then hold Alt and click and drag the new panel to Mon...
The simplest solution is to use Docky on second screen, Docky by default calls apps on screen it is on :)
80,774
I recently switched to a new PC at work, one with two (identical, Dell 23") monitors. I'm running Linux Mint 15 64bit / Cinnamon. Is there a way to set it up in such a way that, instead of both monitors sharing the same huge workspace, they are on separate smaller ones? E.g. left monitor on workspace 1, right monitor o...
2013/06/26
[ "https://unix.stackexchange.com/questions/80774", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/41904/" ]
Short answer: yes, you can do this. I have my (Fedora) desktop set up this way, each monitor is an independent display. It is the same 'desktop', in the X sense, but there are some limitations to typical desktop functionality with this setup versus the 'single desktop spread over two monitors' configuration. [For examp...
The simplest solution is to use Docky on second screen, Docky by default calls apps on screen it is on :)
42,440,070
I have this problem: The GridView I has in the view (shown below) is too long that it doesn't fit entirely in the screen, maybe because one value parameter is too long, and it doesn't follow the text down. This this a screenshot for the GridView: [![enter image description here](https://i.stack.imgur.com/HPKAh.png)](h...
2017/02/24
[ "https://Stackoverflow.com/questions/42440070", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7575968/" ]
`java` **doesn't** supports multiple inheritance. What you are doing is implementing an `interface`. **You can't extend multiple classes in `java` but you can implement multiple interfaces**. An interface is a reference type and it is similar to class. It is a collection of abstract methods. A class implements an int...
Java doesn't support multiple inheritance. What you have currently done is implement multiple interfaces which is absolutely permittable.
22,532,019
I adapted the following code found [here](http://pythonexcels.com/automating-pivot-tables-with-python/) to create a pivot table in my existing excel sheet: ``` import win32com.client as win32 win32c = win32.constants import sys import itertools tablecount = itertools.count(1) def addpivot(wb,sourcedata,title,filters=...
2014/03/20
[ "https://Stackoverflow.com/questions/22532019", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3335936/" ]
As this is the one of the first Google hits when searching for Excel pivot tables from Python, I post my example code. This code generates a simple pivot table in Excel through a COM server, with some basic filters, columns, rows, and some number formatting applied. I hope this helps someone not to waste half a day on ...
Found from [PivotTable.AddDataField method (Excel)](http://msdn.microsoft.com/en-us/library/office/ff823171(v=office.15).aspx) that in `expression .AddDataField(Field, Caption, Function)` only `Field` is required and the other two parameters are optional. I removed them and the code works fine!
21,646,093
So I have a many to many relationship between Users and Photos via the pivot table `user_photo`. I use `belongsToMany('Photo')` in my User model. However the trouble here is that I have a dozen columns in my Photo table most I don't need (especially during a json response). So an example would be: ``` //Grab user #987...
2014/02/08
[ "https://Stackoverflow.com/questions/21646093", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3189288/" ]
You can use belongsToMany with select operation using laravel relationship. ``` public function photos() { return $this->belongsToMany('Photo')->select(array('name', 'date')); } ```
Im assuming you have a column named user\_id. Then you should be able to do the following: ``` public function photos() { return $this->belongsToMany('Photo')->select(['id', 'user_id', 'date', 'name']); } ``` You have to select, the foreign key, else it will have no way of joining it.
21,646,093
So I have a many to many relationship between Users and Photos via the pivot table `user_photo`. I use `belongsToMany('Photo')` in my User model. However the trouble here is that I have a dozen columns in my Photo table most I don't need (especially during a json response). So an example would be: ``` //Grab user #987...
2014/02/08
[ "https://Stackoverflow.com/questions/21646093", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3189288/" ]
You can use belongsToMany with select operation using laravel relationship. ``` public function photos() { return $this->belongsToMany('Photo')->select(array('name', 'date')); } ```
Specifying the exact columns you want for the `Photos` relationship will likely end up biting you in the butt in the future, should your application's needs ever change. A better solution would be to only specify the data you want to return in **that particular instance**, i.e. the specific JSON response you're deliver...
51,581,398
When we are using hive, data is not displayed in perfect table format. Column name and actual data related to column differs in position if the column name is big. How to fix it?
2018/07/29
[ "https://Stackoverflow.com/questions/51581398", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10151665/" ]
You specified the condition in `WHERE` clause for the condition that you required ``` DELETE d FROM mytab d WHERE ( d.x1 = 'b' AND d.act = 0 ) OR d.x1 is null ```
In MySQL use where clause ``` DELETE FROM mytab WHERE x1 = b AND act=0 OR x1 IS NULL;; ``` Just execute this SQL and done. It will delete rows from database matching these conditions.
51,581,398
When we are using hive, data is not displayed in perfect table format. Column name and actual data related to column differs in position if the column name is big. How to fix it?
2018/07/29
[ "https://Stackoverflow.com/questions/51581398", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10151665/" ]
You specified the condition in `WHERE` clause for the condition that you required ``` DELETE d FROM mytab d WHERE ( d.x1 = 'b' AND d.act = 0 ) OR d.x1 is null ```
For deleting rows,use `Delete` statement instead of `select` and the table name and then `where` clause for putting condition ``` Detele t1 from mytab t1 where ( x1=b and act=0 ) OR x1 IS NULL ``` here t1 is alias of table mytab
15,346,793
Hello :) How do i find out which "count"-id the loaded picture has? The loaded picture is: "df5ddc27f7569f83e3867bec71a2cac0.jpg" And my json are: ``` [ {"count":1,"file":"8b6c5592f0378dc8c56e591a7b147826.jpg"}, {"count":2,"file":"a44618c1afe93be486382ceb38536e02.jpg"}, {"count":3,"file":"3c692942d69fba0d1...
2013/03/11
[ "https://Stackoverflow.com/questions/15346793", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1936309/" ]
Yeah, this should be pretty straightforward. Assuming the two are siblings, you can even do this with CSS. **CSS APPROACH** ``` #site-logo { background-image: url(path/to/non-animated-image); } .login-button { /* Login default CSS here */ } .login-button:active ~ #site-logo { background-image: url(path/to/ani...
The link you posted uses CSS3 animations / transitions and a canvas. And it uses a little too much fluf for my taste to achieve such a simple effect on that logo. This is not very efficient, and as Josh Burgess pointed out, you could easily do the same thing with a .gif image. However, I just wanted to highlight some o...
3,442,781
I was using one of my favorite R packages today to read data from a google spreadsheet. It would not work. This problem is occurring on all my machines (I use windows) and it appears to be a new problem. I am using Version: 0.4-1 of RGoogleDocs ``` library(RGoogleDocs) ps <-readline(prompt="get the password in ") shee...
2010/08/09
[ "https://Stackoverflow.com/questions/3442781", "https://Stackoverflow.com", "https://Stackoverflow.com/users/168139/" ]
I no longer have this problem. I do not quite remember the timeline of exactly when I overcame the problem and cannot remember who helped me get here but here is a typical session which works. ``` library(RGoogleDocs) if(exists("ps")) print("got password, keep going") else ps <-readline(prompt="get the password in ") ...
Maybe you don't have the [certificate bundle](http://trac.macports.org/browser/trunk/dports/net/curl-ca-bundle/Portfile) installed. I installed those on OS X. You can also find them on the [curl](http://curl.haxx.se/docs/caextract.html) site
46,415,325
Microsoft has some [decent documentation](https://learn.microsoft.com/en-us/microsoft-edge/extensions/guides/debugging-extensions#content-script-debugging) on debugging Content Scripts for an Edge Extension and the top of the page even includes a [Channel 9 video](https://channel9.msdn.com/Blogs/One-Dev-Minute/Debuggin...
2017/09/25
[ "https://Stackoverflow.com/questions/46415325", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31629/" ]
The answer is no. You only need one. NPM modules can be incorporated into your code several folders down in your project. Take for example a project folder: ``` /root app.js package.json /public index.html /node_modules ... ``` All modules in the `node-module` folder can be used in any proj...
I would always suggest using `git` to synchronize your local files and your files on the EC2 server. To install the same dependency on both your local and cloud, you can save it in your `package.json` e.g. `npm install --save express` And on your server, `npm install` would install all the dependencies listed in `p...
46,415,325
Microsoft has some [decent documentation](https://learn.microsoft.com/en-us/microsoft-edge/extensions/guides/debugging-extensions#content-script-debugging) on debugging Content Scripts for an Edge Extension and the top of the page even includes a [Channel 9 video](https://channel9.msdn.com/Blogs/One-Dev-Minute/Debuggin...
2017/09/25
[ "https://Stackoverflow.com/questions/46415325", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31629/" ]
The answer is no. You only need one. NPM modules can be incorporated into your code several folders down in your project. Take for example a project folder: ``` /root app.js package.json /public index.html /node_modules ... ``` All modules in the `node-module` folder can be used in any proj...
You just need to insert the dependencies in your current project in your `package.json` and make sure that you create a deployment flow that installs it. If you are having trouble to deploy to your EC2 Instance, I would recommend you to start one instance using Amazon EB and use CodeShip to deploy it. Another option...
11,200,518
newbie here, so thanks in advance for help! I have a Wordpress site with multiple taxonomies. I'd like to create a very simple form with two select boxes, one for each taxonomy. Then I'd like to use an HTML form with the get method to display posts matching the criteria they requested from the select boxes. I'm able t...
2012/06/26
[ "https://Stackoverflow.com/questions/11200518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1481578/" ]
**How to get the error EAGAIN?** To get the error EAGAIN, you need to be using Non-Blocking Sockets. With Non-Blocking sockets, you need to write huge amounts of data (and stop receiving data on the peer side), so that your internal TCP buffer gets filled and returns this error. **How to get the error EPIPE?** T...
You could set the receive buffer size to be really small on one side, and send a large buffer on the other. Or on the one side set the send buffer small and try to send a large message. Otherwise the most common test (I think) is to let the server and client talk for a while, and then remove a network cable.
11,200,518
newbie here, so thanks in advance for help! I have a Wordpress site with multiple taxonomies. I'd like to create a very simple form with two select boxes, one for each taxonomy. Then I'd like to use an HTML form with the get method to display posts matching the criteria they requested from the select boxes. I'm able t...
2012/06/26
[ "https://Stackoverflow.com/questions/11200518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1481578/" ]
You can simulate errors using [fault injection](http://en.wikipedia.org/wiki/Fault_injection). For example, [libfiu](http://blitiri.com.ar/p/libfiu/) is a fault injection library that comes with an example project that allows you to simulate errors from POSIX functions. Basically it uses `LD_PRELOAD` to inject a wrappe...
You could set the receive buffer size to be really small on one side, and send a large buffer on the other. Or on the one side set the send buffer small and try to send a large message. Otherwise the most common test (I think) is to let the server and client talk for a while, and then remove a network cable.
11,200,518
newbie here, so thanks in advance for help! I have a Wordpress site with multiple taxonomies. I'd like to create a very simple form with two select boxes, one for each taxonomy. Then I'd like to use an HTML form with the get method to display posts matching the criteria they requested from the select boxes. I'm able t...
2012/06/26
[ "https://Stackoverflow.com/questions/11200518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1481578/" ]
**How to get the error EAGAIN?** To get the error EAGAIN, you need to be using Non-Blocking Sockets. With Non-Blocking sockets, you need to write huge amounts of data (and stop receiving data on the peer side), so that your internal TCP buffer gets filled and returns this error. **How to get the error EPIPE?** T...
You can simulate errors using [fault injection](http://en.wikipedia.org/wiki/Fault_injection). For example, [libfiu](http://blitiri.com.ar/p/libfiu/) is a fault injection library that comes with an example project that allows you to simulate errors from POSIX functions. Basically it uses `LD_PRELOAD` to inject a wrappe...
40,006
I'm trying to chart out a song, just so I have a chord chart to use for comping. It's in 4/4, and most chord changes happen on the strong beats (1 and 3), but there's a couple of places where beat 3 is anticipated (by an 8th note). For reference, the song is "Sultans of Swing" by Dire Straights. Is there any sort of c...
2015/12/05
[ "https://music.stackexchange.com/questions/40006", "https://music.stackexchange.com", "https://music.stackexchange.com/users/3404/" ]
(I don't have enough reputation points yet to comment, so I'll make this an answer instead. Will convert to comments on other answers later, or to edits on other answers, once I have enough cred to ask those answers' authors whether they welcome the edit.) I don't see any convention specified in either the "Concise Di...
Since you're using a stave (don't know why), you can write in the last quaver of the bar previous to the chord to be pushed, with a tie mark across the barline. Write the actual chord over that quaver, thus before the bar. Shortly after that part, there's a syncopated Bb to C part, which really needs writing out in dot...
55,012,413
New to javascript and just trying to make a simple form validation where if the user/pass is valid the box border turns green, and if invalid, it turns red (pictured) [Valid/Invalid](https://i.stack.imgur.com/Qlmd0.png) Here is my HTML: (Form Works, I'm guessing I'm screwing up on the listeners and Handlers) ``` <!D...
2019/03/05
[ "https://Stackoverflow.com/questions/55012413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8812202/" ]
``` "code": 403, "message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup." } } ``` This means that you have exceeded your limit to serve videos from youtube. You need to create an account to be able to show more videos. If you're sure you haven't exceeded your limit/ have an accoun...
Put your Api key in url like "<https://www.googleapis.com/youtube/v3/search?key=YOUR_API_KEY>" ``` axios.get("https://www.googleapis.com/youtube/v3/search?key=Your_Api_Key", { params: { type: "video", part: "snippet", q: searchTerm } }) .then(re...
55,012,413
New to javascript and just trying to make a simple form validation where if the user/pass is valid the box border turns green, and if invalid, it turns red (pictured) [Valid/Invalid](https://i.stack.imgur.com/Qlmd0.png) Here is my HTML: (Form Works, I'm guessing I'm screwing up on the listeners and Handlers) ``` <!D...
2019/03/05
[ "https://Stackoverflow.com/questions/55012413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8812202/" ]
``` "code": 403, "message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup." } } ``` This means that you have exceeded your limit to serve videos from youtube. You need to create an account to be able to show more videos. If you're sure you haven't exceeded your limit/ have an accoun...
Solved this by configure/updating/enabling the settings. The api key worked in the past for me. When returning to use it again, i received a 403 error. The server understood my request, but denied me access to the info. Just go into developers console, go to enable apis, search youtube, and enable it, your key will ...
55,012,413
New to javascript and just trying to make a simple form validation where if the user/pass is valid the box border turns green, and if invalid, it turns red (pictured) [Valid/Invalid](https://i.stack.imgur.com/Qlmd0.png) Here is my HTML: (Form Works, I'm guessing I'm screwing up on the listeners and Handlers) ``` <!D...
2019/03/05
[ "https://Stackoverflow.com/questions/55012413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8812202/" ]
``` "code": 403, "message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup." } } ``` This means that you have exceeded your limit to serve videos from youtube. You need to create an account to be able to show more videos. If you're sure you haven't exceeded your limit/ have an accoun...
for some users, this error might be because of cause sanctions. so try to run your project using a DNS or VPN.
55,012,413
New to javascript and just trying to make a simple form validation where if the user/pass is valid the box border turns green, and if invalid, it turns red (pictured) [Valid/Invalid](https://i.stack.imgur.com/Qlmd0.png) Here is my HTML: (Form Works, I'm guessing I'm screwing up on the listeners and Handlers) ``` <!D...
2019/03/05
[ "https://Stackoverflow.com/questions/55012413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8812202/" ]
Put your Api key in url like "<https://www.googleapis.com/youtube/v3/search?key=YOUR_API_KEY>" ``` axios.get("https://www.googleapis.com/youtube/v3/search?key=Your_Api_Key", { params: { type: "video", part: "snippet", q: searchTerm } }) .then(re...
Solved this by configure/updating/enabling the settings. The api key worked in the past for me. When returning to use it again, i received a 403 error. The server understood my request, but denied me access to the info. Just go into developers console, go to enable apis, search youtube, and enable it, your key will ...
55,012,413
New to javascript and just trying to make a simple form validation where if the user/pass is valid the box border turns green, and if invalid, it turns red (pictured) [Valid/Invalid](https://i.stack.imgur.com/Qlmd0.png) Here is my HTML: (Form Works, I'm guessing I'm screwing up on the listeners and Handlers) ``` <!D...
2019/03/05
[ "https://Stackoverflow.com/questions/55012413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8812202/" ]
Put your Api key in url like "<https://www.googleapis.com/youtube/v3/search?key=YOUR_API_KEY>" ``` axios.get("https://www.googleapis.com/youtube/v3/search?key=Your_Api_Key", { params: { type: "video", part: "snippet", q: searchTerm } }) .then(re...
for some users, this error might be because of cause sanctions. so try to run your project using a DNS or VPN.
69,147,252
``` <img src="https://res.cloudinary.com/dvhhqcxre/image/upload/v1611495185/zenith/tldyffcvvfm9fj51pvjp.jpg"> ``` I want to get rid of the img tag, I just want only the image link
2021/09/11
[ "https://Stackoverflow.com/questions/69147252", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13574659/" ]
```js const image = document.querySelector('img') image.outerHTML = image.src ``` ```html <img src="https://res.cloudinary.com/dvhhqcxre/image/upload/v1611495185/zenith/tldyffcvvfm9fj51pvjp.jpg"> ```
You can use a [`DOMParser`](https://developer.mozilla.org/en-US/docs/Web/API/DOMParser) to parse the string and get the `src` property of the image: ```js const str = `<img src="https://res.cloudinary.com/dvhhqcxre/image/upload/v1611495185/zenith/tldyffcvvfm9fj51pvjp.jpg">`; const res = new DOMParser().parseFromStrin...
8,162,278
**I am getting following errors while deploying GAE application. What will be the reason for that? Stack backtrace below.** ``` Uncaught exception from servlet com.google.apphosting.runtime.HardDeadlineExceededError: This request (0000000000000000) started at 2011/11/17 04:12:01.160 UTC and was still executing at...
2011/11/17
[ "https://Stackoverflow.com/questions/8162278", "https://Stackoverflow.com", "https://Stackoverflow.com/users/930544/" ]
As it says in the stacktrace: ``` HardDeadlineExceededError: This request (0000000000000000) started at 2011/11/17 04:12:01.160 UTC and was still executing at 2011/11/17 04:13:01.204 UTC. ``` Frontend requests to App Engine apps have 60 seconds to complete. If your request takes longer than that, it will be terminat...
You need to optimize your application for quick setup. For example: * Uses a lightweight framework * Reduces classes scanning (discovery) at framework setup * Minimizes operations in ServletContextListener#contextInitialized There is a long way for GAE application optimizations, good luck ;-)
8,162,278
**I am getting following errors while deploying GAE application. What will be the reason for that? Stack backtrace below.** ``` Uncaught exception from servlet com.google.apphosting.runtime.HardDeadlineExceededError: This request (0000000000000000) started at 2011/11/17 04:12:01.160 UTC and was still executing at...
2011/11/17
[ "https://Stackoverflow.com/questions/8162278", "https://Stackoverflow.com", "https://Stackoverflow.com/users/930544/" ]
Finally we sorted the issue by removing `<prop key="hibernate.hbm2ddl.auto">update</prop>` from the hibernate configuration,which was for automatically exporting schema DDL to the database when the SessionFactory is created.
You need to optimize your application for quick setup. For example: * Uses a lightweight framework * Reduces classes scanning (discovery) at framework setup * Minimizes operations in ServletContextListener#contextInitialized There is a long way for GAE application optimizations, good luck ;-)
53,203,011
It's abundantly clear to me that when we want to delete a node in a Linked List (be it doubly or singly linked), and we have to search for this node, the time complexity for this task is O(n), as we must traverse the whole list in the worst case to identify the node. Similarly, it is O(k) if we want to delete the k-th ...
2018/11/08
[ "https://Stackoverflow.com/questions/53203011", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10622251/" ]
It is true that copying data from `i.next` to `i` and then deleting `i` would be `O(1)` assuming that copying the data is also `O(1)`. But even with this algorithm, since deleting the last element is `O(n)`, and a description of a function in terms of big O notation only provides an upper bound on the growth rate of t...
> > It is said that deletion is O(1) in a singly linked list ONLY if you > have a reference to the node prior to the one you want to delete. > However, I don't think this is necessarily the case. If you want to > delete Node i (and you have a reference to Node i), why can't you just > copy over the data from i.nex...
53,203,011
It's abundantly clear to me that when we want to delete a node in a Linked List (be it doubly or singly linked), and we have to search for this node, the time complexity for this task is O(n), as we must traverse the whole list in the worst case to identify the node. Similarly, it is O(k) if we want to delete the k-th ...
2018/11/08
[ "https://Stackoverflow.com/questions/53203011", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10622251/" ]
For a node in the middle of the list you need to modify the *previous* node (so its "next" pointer is pointing to the removed nodes "next"). With a double-linked list it's simple since the node to delete contains a pointer to the previous node. That's not possible with s single-linked list, where you need to iterate o...
The problem with this approach is that it invalidates the wrong reference. Deleting the node shall only invalidate a reference to *that* node, while the references to *any other* node shall remain valid. As long as you do not hold any reference to the list, this approach would work. Otherwise it is prone to failure.
53,203,011
It's abundantly clear to me that when we want to delete a node in a Linked List (be it doubly or singly linked), and we have to search for this node, the time complexity for this task is O(n), as we must traverse the whole list in the worst case to identify the node. Similarly, it is O(k) if we want to delete the k-th ...
2018/11/08
[ "https://Stackoverflow.com/questions/53203011", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10622251/" ]
For a node in the middle of the list you need to modify the *previous* node (so its "next" pointer is pointing to the removed nodes "next"). With a double-linked list it's simple since the node to delete contains a pointer to the previous node. That's not possible with s single-linked list, where you need to iterate o...
Nice question. Simple answer: The alternate solution you are suggesting for singly linked lists is not complete and fails when you are given the last node for deletion. There is no way that you can make the previous to last node point to null. Hence, for a valid solution, the complexity in case of deletion in the sin...
53,203,011
It's abundantly clear to me that when we want to delete a node in a Linked List (be it doubly or singly linked), and we have to search for this node, the time complexity for this task is O(n), as we must traverse the whole list in the worst case to identify the node. Similarly, it is O(k) if we want to delete the k-th ...
2018/11/08
[ "https://Stackoverflow.com/questions/53203011", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10622251/" ]
It is true that copying data from `i.next` to `i` and then deleting `i` would be `O(1)` assuming that copying the data is also `O(1)`. But even with this algorithm, since deleting the last element is `O(n)`, and a description of a function in terms of big O notation only provides an upper bound on the growth rate of t...
Nice question. Simple answer: The alternate solution you are suggesting for singly linked lists is not complete and fails when you are given the last node for deletion. There is no way that you can make the previous to last node point to null. Hence, for a valid solution, the complexity in case of deletion in the sin...
53,203,011
It's abundantly clear to me that when we want to delete a node in a Linked List (be it doubly or singly linked), and we have to search for this node, the time complexity for this task is O(n), as we must traverse the whole list in the worst case to identify the node. Similarly, it is O(k) if we want to delete the k-th ...
2018/11/08
[ "https://Stackoverflow.com/questions/53203011", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10622251/" ]
It is true that copying data from `i.next` to `i` and then deleting `i` would be `O(1)` assuming that copying the data is also `O(1)`. But even with this algorithm, since deleting the last element is `O(n)`, and a description of a function in terms of big O notation only provides an upper bound on the growth rate of t...
I was looking this up as a way to explain it and get references for a blog post. Assuming you have to look up the node, like we do often with arrays and lists to find a value, you can only travel in one direction, and it will take O^n times in double and single link lists to get to the node and retrieve it's address i...