body1
stringlengths
20
4.1k
body2
stringlengths
23
4.09k
Is it possible to run a job for 2 hours at a specific time? So lets say I want to run wget command that calls/hits an endpoint in my web app for 2 consecutive hours in a day. Meaning that every single minute I want to hit this end point for the allocated 2 hour time slot. How do I do this?
This is a about using cron & crontab. You have been directed here because the community is fairly sure that the answer to your question can be found below. If your question is not answered below then the answers will help you gather information that will help the community help you. This information should be edited into your original question. The answer for 'Why is my crontab not working, and how can I troubleshoot it?' can be seen below. This addresses the cron system with the crontab highlighted.
I have a sidebar which might have any number of widgets. I can count the number of widgets that exist in the sidebar. How do I display randomly only one of the widgets in my sidebar at each page load? Use: We have specials which we display as widgets, but we only want to display one widget's content at a time in the footer of the site. re: the count code <?php $the_sidebars = wp_get_sidebars_widgets(); echo count( $the_sidebars['center-footer'] ); ?> re: generating a random widget instance <?php echo rand(1, count( $the_sidebars['center-footer'] )); ?>
My pages have a sidebar with too many widgets, and it looks bad when the content is short and the sidebar is too long. I want to randomize the widgets I'm showing in the sidebar. Meaning I will add all the potential widgets to the sidebar, and it will randomly only display a few. I would also like some control over this, for example to have a few widgets always appear, and only the rest randomized. I tried finding relevant plugins, but the only ones I found just randomized images or posts.. never different types of widgets.
I am running a batch script and outputting the info to a file in the temp folder, (just to learn from). I have an input for a user to select which mapped drive they want their data transferred out of. Here is what I have, it is super easy so I can learn then modify later. Cls @ECHO Off Net use > c:\Temp\Map.txt Net Use Pause :Start ECHO Which Drive letter do you want to back up? ECHO ? - Enter Drive letter ECHO E - Exit SET /P M=Make Choice then press ENTER: IF %M%==E Exit Else goto :here If %M%==e Exit Else goto :here :Here Echo %M% Findstr "OK %M%:" c:\Temp\Map.txt pause What I need is to extract the path name for the drive they select. Like if there are 5 drives, and they want drive S: backed up, output is: OK S: \\10.X.X.X\Deployment\David\Davids_Scripts\bats I would need the \\10.52.8.1\Deployment\David\Davids_Scripts\bats saved so I can put it in a transfer script.
I'm looking to get the result of a command as a variable in a Windows batch script (see for the bash scripting equivalent). A solution that will work in a .bat file is preferred, but other common windows scripting solutions are also welcome.
So I've set up my RecyclerView with API and it's populating the list on the adapter but every time I click on the list item it should open the new activity and pass position through an interface. The click gives me NullPointerException: public class ticketsListAdapter extends RecyclerView.Adapter<ticketsListAdapter.ViewHolder>{ onclicklistner listners; Context context; public ticketsListAdapter(Context context, onclicklistner listners) { this.context = context; this.listners = listners; } @NonNull @Override public ticketsListAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { View view = LayoutInflater.from(context).inflate(R.layout.list_support_tickets,parent, false); return new ViewHolder(view, listners); } @Override public void onBindViewHolder(@NonNull ticketsListAdapter.ViewHolder holder, int position) { holder.item_name.setText("hello"); } @Override public int getItemCount() { return 5; } public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { TextView item_name; public ViewHolder(@NonNull View itemView, onclicklistner listner) { super(itemView); item_name = itemView.findViewById(R.id.tickets_name); item_name.setOnClickListener(this::onClick); } @Override public void onClick(View v) { listners.onItemClick(getAdapterPosition(), item_name); } } public interface onclicklistner{ void onItemClick(int position, View v); } } Log cat & Debug output: E/AndroidRuntime: FATAL EXCEPTION: main Process: com.kalyani.aura, PID: 21421 java.lang.NullPointerException: Attempt to invoke interface method 'void com.kalyani.aura.adapters.ticketsListAdapter$onclicklistner.onItemClick(int, android.view.View)' on a null object reference at com.kalyani.aura.adapters.ticketsListAdapter$ViewHolder.onClick(ticketsListAdapter.java:60) at com.kalyani.aura.adapters.-$$Lambda$hRD_GBr-hvL2HaQtFW31sqkj_0o.onClick(Unknown Source:2) at android.view.View.performClick(View.java:7125) at android.view.View.performClickInternal(View.java:7102) at android.view.View.access$3500(View.java:801) at android.view.View$PerformClick.run(View.java:27336) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7356) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) Fragment Where Recycler view Implemented public class support_fragment extends Fragment { FloatingActionButton create_support; ticketsListAdapter.onclicklistner listner; RecyclerView recyclerView; ticketsListAdapter ticketsListAdapter; @Nullable @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_support, container, false); create_support = view.findViewById(R.id.create_support); recyclerView = view.findViewById(R.id.support_recycler); recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); recyclerView.setHasFixedSize(false); ticketsListAdapter = new ticketsListAdapter(getContext(), listner); recyclerView.setAdapter(ticketsListAdapter); create_support.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent i = new Intent(getContext(), Support_main_activity.class); startActivity(i); } }); listner = new ticketsListAdapter.onclicklistner() { @Override public void onItemClick(int position, View v) { Toast.makeText(getContext(), "Test", Toast.LENGTH_SHORT).show(); } }; return view; } }
What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?
The enzyme reaction condition, $E + S \leftrightarrow ES \rightarrow E + P$ uses $\kappa_{1}$ (forward reaction), $\kappa_{-1}$ and $\kappa_{2}$ as the rate constants. E: Enzyme S: Substrate P: Product What is the relationship between $\kappa_{1}$, $\kappa_{-1}$ and $\kappa_{2}$ to yield Michaelis's constant: $\kappa_{m}$ = ($\kappa_{-1}$ + $\kappa_{2}$) / $\kappa_{2}$ ? I understand that $\kappa_{m}$ = $S$ at $1/2 \times V_{max}$, however I do not understand the relationship of the rate constants based on the enzyme reaction condition. This question has been marked as a repeat of the question "How does pH affect Michaelis' constant". I am not asking for any affect with pH, just a proof for the mathematical relationship of the factors shown above.
I have been trying to confirm the Km of a substrate (which is 34 +/- 4 mM). This value was obtained in 50 mM MOPS, pH 6.3. I conducted my kinetics assay in a buffer of pH 7 and obtained a Km value in the 21.5. According to this , Fig. 2C, the normalized specific activity of the enzyme is about 70% at pH 6.3 and about 47% at pH 7. If I divide 34 mM at pH 6.3 by 0.7 (which should get me the optimum Km at the optimum pH of 5.5) and then multiply by 0.48, then I get 23 mM. However, the paper says Km is between 30 - 38 mM, so if I divide 30 and 38 separately by 0.7 and multiply by 0.47, I get 20 and 25.6 mM respectively. Because my value falls within this range, this then must mean that I have the right enzyme and the same result as the paper. So my questions are: When the paper says Km is "34 +/- 4 mM", can I assume that means the Km can be anywhere between 30 - 38 mM? I'm surprised to see how wide the range is. I assumed Km is usually just one value with a deviation of at most 0.1. Do pH change Km values? I understand that pH changes the shape(s) of the enzyme and/or substrate. Therefore that must affect how much it wants to bind to the substrate. If the enzyme's desire to bind to a substrate decreases due to increase in pH, for example, that would mean more substrates are needed to surround the enzyme, thus increasing Km. If pH does change Km, is this how I determine the Km value of a different pH value if the Km value at another pH is already known? I know that specific activity and Michaelis constant are different, but how much product can be converted per minute depends on how much the enzyme likes to bind to a substrate, which is represented by the Michaelis constant. Did my reasoning and calculation arrive at the right conclusion? If not, how is the calculation done?
I found a sentence in the web. If I were you. If I was you Which one is correct? Must we use "were" just with you/we/they? is something wrong here?
If I was... If I were... When is it correct to use "If I was" vs. "If I were" in standard English?
If you type in "pikachu curve" or other famous fictional characters on wolfram alpha it generates a function to trace out the curve that resembles the character. See . Does anyone know how these curves are generated? It seems that this has been done for several characters so I doubt that they worked out the details by hand. Related:
How do people come up with equations of curves to draw out complex objects? Some popular examples would include: & . This explains the rationale for the batman curve nicely. But other than trial and error, I can't see a reasonable way of drawing the much more complicated PSY curve.
I want to grant only a login who is under an active directory user group to view server state in sql server. How can i do it?
I would like to use integrated security with my internal application which is all on a domain. Unfortunately, I've never been able to get this to work well. I would like to assign an entire Exchange (Active Directory) Group a role in SQL Server for read/write access to certain tables. That way I wouldn't have to create an operator whenever someone is hired or delete an operator whenever someone is fired. Is this possible? What steps would I take to do this?
How can you predict which verbs take which type of infinitive as their complements? For example, is the to before open here mandatory, forbidden, or optional? The Gold Monetization Scheme will be revamped to enable people open a hassle-free gold deposit account. The Gold Monetization Scheme will be revamped to enable people to open a hassle-free gold deposit account. In other words, does the verb enable: take only a bare-infinitive complement the way let does? take only a to-infinitive complement the way allow does? take an optional to before its infinitive complement the way help does? How can you tell which verb does which thing?
Why can't you say: "I insist you to do that!" After all, you can say: "I want you to do that!" What's the difference between these two verbs, that they need to be used in sentences with different structures?
I created a boot able flash drive using this procedure: I then used this to upgrade Ubuntu to the current version. After the upgrade, I can not get the windows boot loader to come up no matter what hard drive I try to boot from and the Ubuntu boot loader only shows Ubuntu where as the previous version would also give Windows as an option. What do I need to do to fix this?
I installed Windows on my computer, followed by an installation of Ubuntu. However, now I'm unable to boot into my Windows install. What can I do to fix this?
I am formatting a dictionary like so: for index, team_id in dataframe.get('team_id').items(): format_redis[str(team_id)] = { 'x': float(dataframe['x'][index]), 'y': float(dataframe['y'][index]), 'z': float(dataframe['z'][index]), 'n': float(dataframe['n'][index]) } Now I'd like to pass a condition for adding the value, like: ... {'x': float(dataframe['x'][index]) if str(dataframe['home'][index] == 'home', 'y': float(dataframe['y'][index]) if str(dataframe['home'][index] == 'away'} But this syntax is not valid. Which one is the right one?
If Python does not have a ternary conditional operator, is it possible to simulate one using other language constructs?
I want to make a game in Unity3D and I am planning to launch it to Android using the free license. However, if the game becomes a huge success and earns more than $100k, does (a) unity take the money for the pro license by themselves? or (b) do I need to pay for pro license myself? If (b) is applicable, how do I upgrade to the pro license and make sure my app is integrated with the pro license not the free version?
If an indie game developer makes more than $100,000 using the free version of Unity, what happens to the money that goes over $100k? How will Unity people come to know how much money they are making? What precautions should I take just in case a game is a great success?
In the first book of the Harry Potter series we are told that Harry has piles of galleons inside his vault at Gringotts. Why didn't Harry draw a few gold coins from his safe and sold them in the muggle world to earn some money? That way he could've improved his quality of life in the muggle world quite a bit I know the subject has been approached in other questions, but the closest answer I got was what would happen if Harry bought silver in the muggle world and sold it for gold in the magic world. I want to know what would happen exactly in this case.
This is a follow-up question to One reason Aunt Petunia mistreated Harry was that she did not know he was rich. If she knew, she would naturally have treated this golden goose nicely. Her retirement would be secured if Harry financially supported her in old age. Why didn't Harry tell Aunt Petunia he was rich? Surely every boy wants to be treated nicely by his family.
I have two activities lets say Level Activity and Result Activity, so what happens is when I go from level -> level1 -> result activity I check if the score is > 4 if it is I unlock the next level in level activity by simply removing an imageview on a button in level activity by doing something like this in Result Activity SharedPreferences pref = getSharedPreferences("MyPrefs", Context.MODE_PRIVATE); final int score111 = pref.getInt("score111", 0); v1.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View v) { startActivity(new Intent(ResultActivity2.this,Lyricswho.class)); if (score111 >= 4) { Intent act2= new Intent(ResultActivity2.this,Lyricswho.class); act2.putExtra("hideImageView", true); startActivity(act2); } } }); } and then in Level activity if(score111 >=4 ){ hideImageView = getIntent().getExtras().getBoolean("hideImageView"); if (hideImageView) { v.setVisibility(View.INVISIBLE); } } It works fine for the first time but when I restart the app by closing it down and go to Level Activity it crashes and goes back to previous activity. The reason as I have figured out is the hideImageView gives null pointer error when I restart the app because it satisfies the condition that is score is greater then 4 (which previously it doesn't because the score is 0 so the code doesn't go in if condition) but there is nothing in hideImageView so it throws null exception. I tried using boolean variable so that if condition is ran only once but then my imageview appears again so I can't use that. How can I solve this problem? Been stuck there for days.
What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?
Suppose $A$ is a finite alphabet. Let's call a word $w \in A^*$ $n$ -universal iff it contains every word from $A^n$ as a subword. What is the minimal possible length of an $n$-universal word over $A$? $|A| = m$. It is definitely $\geq m^n + n - 1$ , because a word of length $m \geq n$ has $m - n + 1$ subwords of length $n$. I think, that $|A|^n + n - 1$ is quite likely to be the exact answer, but do not know how to prove it. It holds, however, for the following particular cases: $m = 1$: $a^n$ $n = 2, m = 2$: $abbaa$ $n = 3, m = 2$: $abbbaaabab$ $n = 2, m = 3$: $ccacaabbcba$
Suppose you have a computer with a password of length $k$ in an alphabet of $n$ letters. You can write an arbitrarly long word and the computer will try all the subwords of $k$ consecutive letters. What is the smallest word that contains all combinations of $k$ letters as subword? (i.e. the fastest way to hack the computer :) ) The smallest word that contains $n^k$ subwords of size $k$ has length $k-1+n^k$ and based on some easy cases, we would like to prove that it is in fact possible to find a word of such length that contains all possible passwords. The problem can be translated into a problem in graph theory, by taking as vertices all words of length $k$. We tried $k=2$, where you can prove the conjecture by induction. For $n=2$ and small $k$ it also works.
I'm trying to understand occurrence of ConcurrentModificationExceptionin below program. import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; public class ConcurentHashMapExample { public static void main(String[] args) { Map<String,String> myMap = new ConcurrentHashMap<String,String>(); myMap.put("1", "1"); myMap.put("2", "1"); myMap.put("3", "1"); myMap.put("4", "1"); myMap.put("5", "1"); myMap.put("6", "1"); System.out.println("ConcurrentHashMap before iterator: "+myMap); Iterator<String> it = myMap.keySet().iterator(); while(it.hasNext()){ String key = it.next(); if(key.equals("3")) myMap.put(key+"new", "new3"); } System.out.println("ConcurrentHashMap after iterator: "+myMap); myMap = new HashMap<String,String>(); myMap.put("1", "1"); myMap.put("2", "1"); myMap.put("3", "1"); myMap.put("4", "1"); myMap.put("5", "1"); myMap.put("6", "1"); System.out.println("HashMap before iterator: "+myMap); Iterator<String> it1 = myMap.keySet().iterator(); while(it1.hasNext()){ String key = it1.next(); if(key.equals("3")) myMap.put(key+"new", "new3"); } System.out.println("HashMap after iterator: "+myMap); } } Exception: ConcurrentHashMap before iterator: {1=1, 2=1, 3=1, 4=1, 5=1, 6=1} ConcurrentHashMap after iterator: {1=1, 2=1, 3=1, 4=1, 5=1, 3new=new3, 6=1} HashMap before iterator: {1=1, 2=1, 3=1, 4=1, 5=1, 6=1} Exception in thread "main" java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextNode(Unknown Source) at java.util.HashMap$KeyIterator.next(Unknown Source) at ConcurentHashMapExample.main(ConcurentHashMapExample.java:39) My doubt is why ConcurrentHashMap takes care of any new entry in the map at runtime whereas HashMap throws ConcurrentModificationException ? I'm not able to understand this reason "Iterator on Collection objects are fail-fast i.e any modification in the structure or the number of entry in the collection object will trigger this exception thrown by iterator. My understanding says, myMap is pointing to two different objects sequentially, then how this error could happen ? Am I wrong ? Please help to understand why its happening and reason for that. What is fail-fast as well ? Thanks
We all know you can't do the following because of ConcurrentModificationException: for (Object i : l) { if (condition(i)) { l.remove(i); } } But this apparently works sometimes, but not always. Here's some specific code: public static void main(String[] args) { Collection<Integer> l = new ArrayList<>(); for (int i = 0; i < 10; ++i) { l.add(4); l.add(5); l.add(6); } for (int i : l) { if (i == 5) { l.remove(i); } } System.out.println(l); } This, of course, results in: Exception in thread "main" java.util.ConcurrentModificationException Even though multiple threads aren't doing it. Anyway. What's the best solution to this problem? How can I remove an item from the collection in a loop without throwing this exception? I'm also using an arbitrary Collection here, not necessarily an ArrayList, so you can't rely on get.
I am a Vietnamese Refugee and do not carry a Vietnamese passport. I do however carry a Vietnamese Certificate of Visa Exemption (permission to enter Vietnam) and a green card (to re-enter USA). I have a three hour layover in Narita and would like to know if allowed to transit without a passport. If you know, please let me know where you found out. I've been searching high and low and calling everyone I could think of and no one has a certain answer.
I will be transferring between two international flights at Tokyo Narita airport. I'm scheduled to depart the same day I arrive. I am planning to stay within the airport during the layover. Does anyone know if I will require a transit visa at Narita?
I'm currently writing a blog about web development. I'm unsure of when to capitalize a job title and the industry. Are the following sentences correct? As an experienced Front-End Developer...... Having worked alongside other developers....
Would you capitalize the job title in the following sentence? I am writing this letter in regard to Joe Brown who is applying for the director of teaching and learning position in the XYZ School District.
Basically, every time I boot Ubuntu, no desktop loads, I just see the wallpaper. I don't know if its something to do with my graphics card (Nvidia GTX 970)? Someone help.
When I login, nothing happens. I am presented with my desktop wallpaper. No Dash, no Launcher, nothing.
what is the regular expression for the language above {0,1} that does not contain the subword 000? Thank you for your help!!
I need to identify the set of all possible strings over $\sum$ {a, b} that do not contain the substring aaa. I have becoming more familiar with regular-language and languages explored in Automata Theory, and have been defining a particular language through regular-expressions. I am having a hard time trying to find the set of substrings {a, b} = $\sum^*$ (where {a, b} = $\sum$) where the strings found in $\sum^*$ do not contain the substring aaa. Any advice on how to generate the regular-expression that will define this language would be helpful.
I have a shapefile and I need to crop/clip it based on a rectangle of particular latitude and longitude using QGIS. If it is possible, how do I do that?
I need to clip a large and very detailed shapefile in QGIS showing environmental data similar to a temperature map. Is there something like the very simple crop tool like in Adobe Photoshop where you can drag a rectangle over an area of interest and crop the shapefile to this area only? I do have an additional shapefile of neighborhoods/districts that I could also use for cropping but I do not know how to specify "extract a shp/kml only within the borders of district X, row xxxxx in the attribute table of districts.shp" How can I extract the data primitively within a rectangle of choice or per district? I need smaller pieces from the large map that has been provided by an environmental geo-institute to be implemented into an mobile Application (Android) to view the quite heavy data in a lighter way. I made some screenshots of the data and posted them here: . You can see the districts and the data layers. I need to have every district as a separate file / separately export every dataset per district to KML.
Does rooting your phone inevitably erase all of your data? Im not sure. If so I will have to make a back up. I tried rooting once but I bricked my phone. Thankfully, I fixed it.
If I root my android phone (just so I can get access to Wifi Tethering, etc.) will that erase anything on the phone (apps, data, etc.)? Will it change anything other than the ability to run app(s) as rooted?
This may be a strange question; but I've read and re-read the chapter in my textbook on what exactly a branch of a logarithm is and am having trouble understanding. What is a branch of a logarithmic function? And what is a branch cut- how does it relate to the analyticity of a function?
I know this is the most typical example of branches and I think I don't get the concept... Could you help me by giving a detailed development leading to all the required branches? It'd help me understanding more complicated examples... Thank you very much, this concept really is hard to understand for me...
I am a newbie and my first server seems to have been hacked. I am not sure how to clean it. There are processes hogging the CPU that am not the owner of. All the 12 CPUs are almost all running at 100%. Kindly see htop screen shot I have run a netstat and below is a summary of the output sudo netstat -anolp Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name Timer tcp 0 0 127.0.0.1:9001 0.0.0.0:* LISTEN 4869/java off (0.00/0/0) tcp 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN 15327/mongod off (0.00/0/0) tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 4124/mysqld off (0.00/0/0) tcp 0 0 127.0.0.1:9100 0.0.0.0:* LISTEN 24415/node_exporter off (0.00/0/0) tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 16039/nginx -g daem off (0.00/0/0) tcp 0 0 127.0.0.1:8080 0.0.0.0:* LISTEN 5824/config.ru off (0.00/0/0) tcp 0 0 127.0.0.1:9168 0.0.0.0:* LISTEN 24370/ruby off (0.00/0/0) tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 13595/sshd off (0.00/0/0) tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2370/master off (0.00/0/0) tcp 0 0 127.0.0.1:9121 0.0.0.0:* LISTEN 24450/redis_exporte off (0.00/0/0) tcp 0 0 127.0.0.1:9090 0.0.0.0:* LISTEN 24429/prometheus off (0.00/0/0) tcp 0 0 127.0.0.1:9187 0.0.0.0:* LISTEN 24421/postgres_expo off (0.00/0/0) tcp 0 1 my.ser.ver.ip:41037 172.247.116.47:2017 SYN_SENT 26521/mbb on (57.32/6/0) tcp 0 0 my.ser.ver.ip:45599 124.112.1.160:29135 ESTABLISHED 32265/DDosClient off (0.00/0/0) tcp 0 0 127.0.0.1:9001 127.0.0.1:54729 ESTABLISHED 4869/java keepalive (2412.64/0/0) tcp 0 0 my.ser.ver.ip:49366 31.222.161.239:8080 ESTABLISHED 14106/hald-daemon off (0.00/0/0) tcp 0 0 my.ser.ver.ip:57275 163.172.204.219:443 ESTABLISHED 20238/wDHnu keepalive (45.40/0/0) tcp 0 0 127.0.0.1:9001 127.0.0.1:54909 ESTABLISHED 4869/java keepalive (2445.40/0/0) tcp 0 0 my.ser.ver.ip:56654 45.125.34.159:6969 ESTABLISHED 27006/XDTQK off (0.00/0/0) I tried killing them using kill with their PID one by one but after some time they came up again. So I checked my cron, and there were some entries there that I didn't do so I clear them as well. I compared the crons with a new box I just launched. I disabled the root login, created another sudoer with pem file instead. Now I need to find a way to clean this once and for all and I lack experience. Can anyone please help me out? Thanks in advance
A few weeks ago, my machine (lets call it "main") was logged into wirelessly from an unauthorized host, probably using ssh. I did not detect the intrusion until a few days ago, and my machine is completely shut down. I found the login using this line from last: myusername pts/1 ipad Tue Oct 15 22:23 - 22:25 (00:02) Needless to say, not only does no one in my family own an iPad, but almost none of my friends do, either. This makes me suspect that whoever was behind this changed the hostname of their machine. Additionally, I discovered this line in the last output on another machine of mine ("secondary"): myusername pts/2 :0 Tue Oct 15 22:23 - 22:23 (00:00) This line coincides with the timestamp from main, which has password-less ssh access (through keys) to secondary. Is it possible that whoever broke in to main has also rooted secondary? How can I prevent this from happening again? Are there logs that I can look through to determine exactly how main was accessed (I am the only user on the system and have a very strong password)? Is it at all possible that this is just a weird bug that occurred? Should I, and where should I start looking for rootkits and/or keyloggers? In short, what should I do?
I have a page to show my product, now i want to load further posts using "infinite scroll".
How do I enable infinite scroll (either with the infinite-scroll plugin OR the built in infinite scroll jetpack) on the "Thoughts" Wordpress theme? I'm a total noob at editing this stuff so if you are kind enough to help please keep it very simple as if I do not know anything.
Please explain how I can install wine64
Can someone please explain how I can install in the following ways? By using the package manager? By downloading and installing a pre-built package?
So I'm trying to get more space into my termux to download and use I'm trying to mount the folder onto the SD does anyone know how to already or done it? I've seen that it isn't possible but I don't see why wouldn't it be especially with root
Can I mount /data/data/com.termux/ folder on external sd card? My phone is rooted Android 10 and running low of internal storage. As I read from mounting to /sdcard requires permission to mount because /sdcard is emulated from /data/media/0 and /data/data/ is not. And from it can mount /data/data/com.termux/ using ln -s because ext4 support links while fat doesn't. I don't know how /data/data/ directory works but is it possible to mount /data/data/com.termux/files/home/ directory to external sd card without formatting it as adoptable storage or making ext4 partition?
Let $a,b,c>0$; $a^2+b^2+c^2=3$. Prove that: $$\sum\limits_{cyc} \sqrt{a^2+3b^2}\geq \sqrt{12(a+b+c)}$$ I have got stuck at this problem. Any soluion is welcome.
Let $a$, $b$ and $c$ be non-negative numbers such that $(a+b+c)^2(a^2+b^2+c^2)=27$. Prove that: $$\sqrt{a^2+3b^2}+\sqrt{b^2+3c^2}+\sqrt{c^2+3a^2}\geq6$$ A big problem here around $(a,b,c)=(1.6185...,0.71686...,0.4926...)$. In this case we get $\sum\limits_{cyc}\sqrt{a^2+3b^2}-6=0.000563...$. My trying. Let $a^2+3b^2=4x^2$, $b^2+3c^2=4y^2$ and $c^2+3a^2=4z^2$, where $x$, $y$ and $z$ are non-negatives. Hence, we need to prove that $$\sum\limits_{cyc}\sqrt{x^2-3y^2+9z^2}\leq\frac{\sqrt7(x+y+z)^2}{\sqrt{3(x^2+y^2+z^2)}}$$ Let $k$ and $m$ be non-negatives, for which $x-ky+mz>0$, $y-kz+mx>0$, $z-kx+my>0$ and $1-k+m>0$. By C-S $\left(\sum\limits_{cyc}\sqrt{x^2-3y^2+9z^2}\right)^2\leq(1-k+m)(x+y+z)\sum\limits_{cyc}\frac{x^2-3y^2+9z^2}{x-ky+mz}$. Thus, it remains to prove that $$(1-k+m)\sum\limits_{cyc}\frac{x^2-3y^2+9z^2}{x-ky+mz}\leq\frac{7(x+y+z)^3}{3(x^2+y^2+z^2)}$$ It's a sixth degree, but I didn't find a values of $k$ and $m$, such that the last inequality will be true. By this way we can prove that $\sum\limits_{cyc}\sqrt{a^2+2b^2}\geq3\sqrt3$ is true, but it's not comforting. Also I tried to use Holder, but without success. Thank you!
I want to solve this limit without the use of L'Hôpital's rule: $$\lim_{x\to 0} \frac{e^x-1-x}{x^2}.$$
Is it always possible to find the limit of a function without using or ? For example, $$\lim_{x\to0}\frac{\tan x-x}{x^3}$$ $$\lim_{x\to0}\frac{\sin x-x}{x^3}$$ $$\lim_{x\to0}\frac{\ln(1+x)-x}{x^2}$$ $$\lim_{x\to0}\frac{e^x-x-1}{x^2}$$ $$\lim_{x\to0}\frac{\sin^{-1}x-x}{x^3}$$ $$\lim_{x\to0}\frac{\tan^{-1}x-x}{x^3}$$
I found some posts about this matter but they don't have an updated review for 2015. I wish to purchase a SIM card - something like prepaid card for just one month or two for vacations - for use in France & UK. I'd like something like internet oriented. Do you know any company selling such services that you can recommend?
I'm going to travel to Paris in two weeks for 5 days. I'd like to buy a prepaid SIM card for my phone, no calls or SMS needed - only data is sufficient. I've looked through French mobile operators and found nothing really acceptable. For example, in Finland I bought SIM card for €5 with 3GB of data. So, the question is - what is the best SIM card for me, assuming that 1GB is enough (considering the prices) and that I am actually will be able to use it (I've read that some operators turn on mobile data only after 5 days which is unacceptable for me considering that I'll be there for 5 days only)?
He's been here quite a couple of times. Would this be a natural thing to say? How many times would you say that "quite a couple of times" are? (I know there's no precise answer to it)
Today I said some event was a couple of weeks away. A native speaker from Australia corrected me and said, no it's at least three weeks away. What followed was a discussion as to whether a couple always means two, or if it can mean more than two. What does a couple, in particular a couple of weeks, mean to a native speaker? According to : Two partners in a romantic or sexual relationship. Two of the same kind connected or considered together. (informal) A small number. According to : two people or things of the same sort considered together: 'a couple of girls were playing marbles' [treated as singular or plural] two people who are married or otherwise closely associated romantically or sexually: 'in three weeks the couple fell in love and became engaged' 'a honeymoon couple' [informal] An indefinite small number Yet my colleague — a native speaker — insists that a couple never means three, although there can be a small error bar on the two. We asked one other native speaker who agrees with him, yet three non-native speakers point at the above-mentioned sources to claim they're wrong. But it's a bit tricky for non-native speakers to claim native speakers are wrong. Note that both native-speakers are from Australia/New Zealand.
On all distributions of ubuntu and linux that I use don't let me type in the password to use sudo what do I do what happens is that when I try to use the sudo command I cant type the password.
When I'm about to install a program in the terminal it wants the password: [sudo] password for xxx: But when I start to type my password nothing happens. What should I do?
Let's say I'm going to write an article why I think a new GUI Library needs to be developed. Is there any place to do this? It would be a longer blog style article, so not something what IMHO belongs on Stack Overflow. But for obvious reasons I don't want to start just another blog. So do I have to wait for a DiscussionOverflow.com or is there already something like it?
Stuff like polls, recommendations based on subjective constraints, puzzles, webcomics etc. do not belong on the serious main SE sites, where professionals should be considered at work and having just a few spare minutes ("code's compiling") to answer questions, so they should not be distracted by such things. However, I'd also like to have a home for these things still using the SE engine. For the reason I mentioned before, this needs to be a separate place though. Let's call it four.[sitename-here].com.
What is $$\sum_{i=0}^{\log n}i\cdot 2^i\:?$$ I know it's $O(n\cdot\log n)$ but how do you calculate this sum?
How can I evaluate $$\sum_{n=1}^\infty\frac{2n}{3^{n+1}}$$? I know the answer thanks to , but I'm more concerned with how I can derive that answer. It cites tests to prove that it is convergent, but my class has never learned these before. So I feel that there must be a simpler method. In general, how can I evaluate $$\sum_{n=0}^\infty (n+1)x^n?$$
Software Updater on Ubuntu 16.04 doesn't show Ubuntu 18.04 update. I have checked and all settings are good. What do I need to do?
I'm following the , but on launching the upgrade tool I get this response: Checking for a new ubuntu release No new release found Am I doing something wrong? Is there a workaround?
I'm new Latex, I want to use make a table, and it works fine. the problem that I have is the position of table in the document : \chapter{chapter description } \section{section name } \subsetion{subsection} here should the text be displayed \begin{table} \begin{tabularx}{\textwidth}{p{0.3\textwidth}|c|c|c} \end{tabularx} \caption{Table Name \label{tab:table_label}} \end{table} the pdf result hasn't the right order, I get first the table and that the \chapter and section , subsection I don't what I'm doing wrong any idea ? thanks in advance
How to influence the position of float environments like figure and table in LaTeX? This is a general question and should collect useful answers for all users. I hope we can use this as a reference
When I use my removeOrder() method it successfully takes the order from the list and then I have to use my save() method which runs this code. I get thrown out with a null pointer exception because the method doesn't complete when there are 0 items in the list. I need some help figuring this one out please. I understand why i'm getting the null pointer exception, printWriter is null and my method wont iterate over the orderList if there are no orders in the list so it goes to out.close() and it can't close with a null value. I just need help figuring out the best way to possibly do a if statement to make it work the way I want it too. private void writeToFile(List<Order> orderList) throws FlooringMasteryDaoFileException { //PrintWriter out = null; LocalDate date; //if (orderList.size() >= 1) for (Order dateOrder : orderList) { // iterate over my orderList and then get the date from each Order, then format that date to a string. date = dateOrder.getDate(); String stringDate = formatDate(date); try { out = new PrintWriter(new FileWriter("order_" + stringDate + ".txt")); } catch (IOException e) { throw new FlooringMasteryDaoFileException("Could not save order data."); } for (Order currentOrder : orderList) { if (currentOrder.getDate().isEqual(date)) { out.println(currentOrder.getOrderNumber() + DELIMETER + currentOrder.getCustomerName() + DELIMETER + currentOrder.getTaxRate() + DELIMETER + currentOrder.getProduct() + DELIMETER + currentOrder.getArea() + DELIMETER + currentOrder.getMaterialCost() + DELIMETER + currentOrder.getLaborCost() + DELIMETER + currentOrder.getTax() + DELIMETER + currentOrder.getTotal() + DELIMETER + currentOrder.getDate()); } } out.flush(); } out.close(); }
What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?
I have just started working as a manual/black-box tester in a QA team. I am currently learning about testing techniques/practices from others. What are some good resources which i can use to make a good foundation in software testing? please link reference material including websites , blogs, free courses etc.
For QA workstations preparation (Windows-based PCs) our IT department uses typical batch deployment tools. I'm not at all interested in the details of such process, but IT guys ask me: What typical set of software you need for everyday manual testing tasks? We could include these in our deployment so that you guys could save more time for testing, not for environment prep & tuning. Sure thing we do test various range of projects, from web applications to standalone solutions, and each application requires its own set of tools for manual testing, e.g.: Browsers Virtualization utilities DB clients Screens capturing tools FTP clients XML editors etc. However, and that's for sure - there's a list of tools every QA MUST have installed on its PC, regardless of project types under testing. My area of experience is mostly standalone / complex web apps, that's why my vision on the task is a bit subjective. So, your suggestions of what are tools / software an average QA specialist can't live without will be highly appreciated. 2 assumptions: Manual testing is a point of interest. Let's limit the list to not more than 15 (better 10) items. Thanks in advance!
Is there a Gedit plugin that shows an overview map of the current file at the right side to help scroll through the text? I am using Gedit 3.38.1 in Ubuntu 21.04. Here is an example of the overview map in VisualStudio Code. Does Gedit have something similar?
I recently installed Ubuntu 20.04. Everything works fine. I wanted to customize gedit, but I was surprised that the minimap option is not available anymore. How to get it back? OS: Ubuntu 20.04 Gnome Version: 3.36.2 Windowing System: X11 gedit version: 3.36.2
I was searching for google drive and its installation instructions in ubuntu 12.04, I tried sudo apt -get install , but didn't find google drive application on ubuntu repo. Is there any alternative or hack to install google drive on ubuntu 12.04
I'd like to install a client for Xubuntu (12.04). I'm getting non-English Google results, and I didn't find in the Xubuntu repositories. Does anyone know of a client that works well for Ubuntu or it's supported derivates (or installation instructions for grive?)
What is the integration of $$\int x^x dx$$ And how can I understand whether an integration is possible or not? Is there any rule to understand whether a function is integrable or not?
I'm trying to find $\int x^x \, dx$, but the only thing I know how to do is this: Let $u=x^x$. $$\begin{align} \int x^x \, dx&=\int u \, du\\[6pt] &=\frac{u^2}{2}\\[6pt] &=\dfrac{\left(x^x\right)^2}{2}\\[6pt] &=\frac{x^{2x}}{2} \end{align}$$ But it's certain that this isn't the correct way to evaluate that, and the answer must be wrong.
im facing this question, and I was hoping some of you might help out: Write a function that accepts an iterable and a positive number n. The function returns a new iterator that gives values from the original in tuples of length n. Pad missing values with 'None' if needed for the very last tuple. for example: for x in bunch_together(range(10),3): print(x) return values are (0, 1, 2) (3, 4, 5) (6, 7, 8) (9, None, None) This is what I come up with so far: def bunch_together(iterable,n): tup = tuple() for item in iterable: for i in range(n): tup += (i,) yield tup but this obviously doesn't work because I didnt accounted for the range at all(the output as of now looks something like this: (0, 1, 2) (0, 1, 2, 0, 1, 2) (0, 1, 2, 0, 1, 2, 0, 1, 2) ...#(goes on) I could either create a generator of build an iterator (as in building a class composed of init iter and next) Thanks for the help!
I have a list of arbitrary length, and I need to split it up into equal size chunks and operate on it. There are some obvious ways to do this, like keeping a counter and two lists, and when the second list fills up, add it to the first list and empty the second list for the next round of data, but this is potentially extremely expensive. I was wondering if anyone had a good solution to this for lists of any length, e.g. using generators. I was looking for something useful in itertools but I couldn't find anything obviously useful. Might've missed it, though. Related question:
I got rectangle light source on the right and face with emission shader on the left. Viewport is set to "rendered" mode. As i understand on the right the light is visible, but it's source - is not. On the left - vice versa. How can i get both parameters visible?
The closest I can get to making mesh lights affect their environment in Blender Eevee is giving them an Emission material and turning on "Bloom". But this isn't emitting proper light, it just looks like it is, but it doesn't light the surroundings whatsoever. I would like to be able to light a scene with meshes without having to put point lamps everywhere just to make them emit light.
I accidentally ran a chmod 754 ./ when I was at the root directory on the server which runs Ubuntu 18.04. Now I cannot use commands like sudo or pkexec, nor can I change anything. What should I do? Does it affect other user?
I accidently ran sudo chmod 755 -R / instead of sudo chmod 755 -R ./ I stopped it after few seconds, but now there is some problems such as sudo: must be setuid root How can I revert permissions back?
To show that $\frac{d}{dx}:A \to L^2 (a,b) $ is not continuous, where $$A=\left\{u \in L^2 (a,b): \frac{du}{dx} \in L^2 (a,b) \right\} $$ I'm trying take a map's sussection that $|du_n|>c_n|u_n|$ but I cant find.
If we define $D$ as the set of functions $f \in L^2 (\mathbb{R})$ such that $f' \in L^2 (\mathbb{R})$ too, then it can be shown (I think) that the linear operator $\frac{d}{dt}: D \rightarrow L^2 (\mathbb{R})$ is not bounded with respect to the norm on $L^2 (\mathbb{R})$, which is $||f|| = \sqrt{\int_{-\infty}^{\infty}|f(t)|^2 dt}$. But I'm having trouble proving this. What I'd like to do is find a sequence $(f_n)$ in $D$ with $||f_n||=1$ $\forall n \in \mathbb{N}$ but with $||f_n '||$ increasing and becoming arbitrarily large with $n$. I understand that if we were working with the space of continuous functions on $\mathbb{R}$ instead of $L^2 (\mathbb{R})$, with the nice supremum norm, we could just use $f_n (t) = \sin(nt)$, but that won't work here. I tried the sequence $f_n(t) = \sqrt{\frac{\sin(nt)}{t}}$ because that's got a handy $L^2$-norm of $\sqrt{\pi}$ for all $n\in\mathbb{N}$, but its derivative isn't in $L^2 (\mathbb{R})$ so I feel stuck. I think I'm approaching the problem correctly, but the norm in question here isn't easy to work with -- is there a simple sequence I could use?
How do we specifically get to 3.14 from axioms through logic to that particular transcendental number being the case? I'm guessing it's the sum of an infinite series. But how do we go from "there's a circle" to "this particular infinite series describes the ratio of the diameter to the circumference", other than getting out a tape measure, and noticing that the series seems to produce the same number (sans any proof). I'm looking for the proof of why the circumference/diameter = 3.14... specifically.
When I was a child I was taught $\pi$ (Circumference/Diameter) is an irrational number and can be approximated to $22/7$ but $= 3.(142857)(\ldots)$. But where does this value comes from? In short How do I derive $\pi$?
Let's say I have an array [2, 3], and I want to pass that into a function. Not as function([2, 3]), as function(2, 3). Is there anyway to do that, like function(pass(array))?
In the following method definitions, what does the * and ** do for param2? def foo(param1, *param2): def bar(param1, **param2):
Our professional, personable staff is committed to providing you the best services and support. Shouldn't it be: Our professional, personable staff is committed to providing you with the best services and support.
Does provide need the preposition with, or is it truly ditransitive? Kindly provide us with your best quotation Kindly provide us your best quotation. He provided directions. He provided us directions. He provided us with directions.
I just wanted to point out that the hats feature is fixed on some pages while scrolling in the iPhone app.
When visiting my profile on the mobile app, my hat scrolls with the page: It doesn't stay linked to my icon at the top. I'm on an iPhone 6+ running iOS 9.2 and version 1.4.1 of the SE app.
Currently the link rendering of a link in a text area of careers renders as all black without an underline. At the very minimum this sucks for computer users and is completely worthless for people who print out the pdf. I propose two features: Links should be rendered as blue with an underline (or at least blue!) Links should (maybe optionally?) be rendered back to markdown when printed, and (again maybe optionally?) shortened, for the print version.
Don't know if it's intentional or not, but hyperlinks are colored like a normal text in the generated PDF on careers.stackoverflow.com, which makes them indistinguishable.
I am fairly new to C++ and I am trying to decode the piece of code shown below. In particular for the BaseSetAssoc::BlkType* line, I am not sure what the asterisk means in this case. I would appreciate some insight. BaseSetAssoc::BlkType* NMRU::accessBlock(Addr addr, bool is_secure, Cycles &lat, int master_id) { // Accesses are based on parent class, no need to do anything special BlkType *blk = BaseSetAssoc::accessBlock(addr, is_secure, lat, master_id); if (blk != NULL) { // move this block to head of the MRU list sets[blk->set].moveToHead(blk); DPRINTF(CacheRepl, "set %x: moving blk %x (%s) to MRU\n", blk->set, regenerateBlkAddr(blk->tag, blk->set), is_secure ? "s" : "ns"); } return blk; }
Why are pointers such a leading factor of confusion for many new, and even old, college level students in C or C++? Are there any tools or thought processes that helped you understand how pointers work at the variable, function, and beyond level? What are some good practice things that can be done to bring somebody to the level of, "Ah-hah, I got it," without getting them bogged down in the overall concept? Basically, drill like scenarios.
This happens every few days: I wake up in the morning, try to unlock my phone with Touch ID, and it prompts me for my password. The length and complexity of my password and my drowsiness in the morning make for an unpleasant combination. Why does this keep happening? Detailed information: I am using an iPhone 6 (64 GB), running iOS 9.3.2, though this has been an issue for several versions now (at least as far back as 9.3.0). It happens regardless of whether or not I charge my phone at night. It is not caused by iOS updates, because I always manually update iOS. It sometimes happens in the daytime, but seems to be more common after not using my phone for 6+ hours (due to being asleep). I have my "Require Passcode" setting set to "Immediately". I am using a custom alphanumeric code, not a custom numeric code or a 4-digit numeric code. I have Touch ID enabled. Other than when this issue rears its ugly head, it works perfectly.
Occasionally, when unlocking my iPhone or iPad, I get the following message: Your passcode is required to enable Touch ID Now this is not after a number of failed attempts or turning the device off. The device was used within the last 12 hours. Two of the devices are less than 2 months old, and one is a year old. Everything is up to date. It appears to be happening more-or-less at random. Does anybody know why this message might appear?
Maybe this question is a duplicate, but I'm not finding it in my searches. There are several acronyms in several websites, such as: MMA, MWE, ... I visit several sites, but as I visit some of these sites infrequently, I do not know what some people are commenting on. Is there a glossary of this in the Help Center?
What are the common phrases, words, abbreviations that are used on Stack Overflow, Server Fault, Super User, Meta Stack Overflow, and the other Stack Exchange sites? This is meant to be a very quick overview, not an in-depth tutorial. When considering whether a term ought to be included, please use this test: New user comes in and posts on day 1. What terminology or jargon are they likely to run into (comments, support, system messages, etc.) that cannot be understood from the context without prior experience with the site (that is, clear only if known). For example: "This is a dupe. Flag a diamond mod to close or migrate to SU." Huh? Can these instruction be made clear from the glossary? Is it clear for those for whom English is a second language? Please: Edit the existing answer Insert relevant links to more detailed information on the term/phrase/abbreviation Add only factual information Keep it very, very brief, terse, and to the point Delete your own comments once they become irrelevant (integrated into the glossary) Use the Edit Summary box to note reasons for your edit, not comments Please avoid: Opinion Using abbreviations, terms, and phrases inside a description Unverified information Uncommon terms, abbreviations, phrases Long descriptions Unnecessary detail - link to the relevant FAQ instead Citations or examples of usage Inside jokes that are not common on all of the trilogy () Common Internet jargon (that is, , , , etc.) unless usage here differs significantly Recurring discussion: While the experiment to keep meta-discussion in the comments is going well (that is, deleting them once consensus is reached) it is clear that some discussions will be recurring, and we'll have to keep a record around so people new to the glossary can understand the consensus already reached. Add a new answer if you believe a new issue is likely to come up repeatedly. For instance, discussion about what terms to include, whether the glossary should be broken up to make linking easier, or formatting issues might be best discussed in new answer/comment posts.
My has been renamed. After that iOS app shows extra items in the achievements list: Web achievements list contains only one rep item per question in separate time interval: App Version: 1.6.2.5 Device: iPad Air 2 (Wi-Fi) OS Version: Version 10.2 (Build 14C92)
Step to reproduce Answer a question; Answer gets accepted or upvoted; Receive notification in the app; Change the title of the question; Notification is duplicated with updated title. Expected behavior When going into notifcations you should see only one entry for that reputation event. Actual behavior You get two notification entries. In the screen notice the two entries for the same question, the one related to EF. After answering I have changed the name to make it more searchable for future questions and i've noticed it. App Version: 1.6.1.2 Device: iPhone 6s OS Version: Version 10.1.1 (Build 14B100)
How do we prove that $$\lim_{n \rightarrow \infty} \dfrac{\displaystyle\sum_{r=1}^{n} r^a}{n^{a+1}}=\frac{1}{a+1}$$? This type of terms appear in problems on limits, but I am unable to prove this. Please help me out.
What is the result of the next limit: $$ \lim_{n \to \infty} \frac{ \sum^n_{i=1} i^k}{n^{k+1}},\ k \in \mathbb{R} $$ Why (theorem)?
Posting , but for windows 8 instead. In Windows XP, Backspace (aka ←) key leads you to the parent folder, but in Windows 8 it just goes back in history. How do I make it work like in the old days? The answer given from K.A (very complete & simple btw, kudos to him) doesn't work on Windows 8. I get an error message saying Error at line 1. Line Text: ÿÞ# Error: This line does not contain a recognized action. The program will exit. How can it be getting to work On Windows 8?
In XP i used backshift for going one folder upwards. In Win7 they changed that to Alt+ArrowUp and backshift means now go back in folder history. Is there some way to use good old backshift for going upwards? I don't need the back functionality..
I'm struggling with a little problem. I want to recreate some kind of overlay effect, but I cannot get close to it. I hope some pros among you know how this overlay was created... Note: I have tried all the blending modes of Photoshop but none of them could give me what I wanted. The closest blending mode seems to be the multiply but it actually removes the orange color from the tiles, which I don't want. Here are the images, if you want to try to recreate the effect on your own: If you are not able to replicate this effect with Photoshop or something else, do you maybe know, what kind of blending/filter or whatever could have been used to recreate this effect? I have also tried with a temperature shift, since it looks like the blue is added to all the colors without destroying too much of the original color (we can still guess that the tiles were orange), but It doesn't seems to be the way to go either Note: I've showed a simpler problem since the second picture contains only one color. I'd like to be able to use any kind of overlay image
I would like to use the overlay effect used on the screenshot(s) below. I've tried experimenting with several Blending modes but keep missing the mark. I'm sure this has a very easy answer but I'm having trouble recreating the effect on my own. Here are a few more images for further context: Thanks in advance for your help.
I'm now stuck with writing a piece of code to look up individual pixel values on a raster image. This piece of code mainly executes two tasks: (1) converting world coordinates to raster coordinates (I use a package named "Affine" to do that); (2) then computing pixel offsets and figuring out which column and row the pixel is located at. The major problem I'm facing now is that the code didn't return the correct column and row that the pixel is located at. import sys, gdal, numpy from affine import Affine # coordinates to get pixel values for lons = [-122.265373, -122.429139, -68.123095] lats = [37.873090, 37.783640, 44.981935] # open the raster file ds = gdal.Open('data/nlcd_compressed.tif') if ds is None: print 'Could not open the raster file' sys.exit(1) # get raster size cols = ds.RasterXSize #161190 rows = ds.RasterYSize #104424 bands = ds.RasterCount #1 # get georeference info transform = ds.GetGeoTransform() # (-2493045.0, 30.0, 0.0, 3310005.0, 0.0, -30.0) xOrigin = transform[0] # -2493045.0 yOrigin = transform[3] # 3310005.0 pixelWidth = transform[1] # 30.0 pixelHeight = transform[5] # -30.0 # convert global coords to raster coords aff = Affine.from_gdal(-2493045.0, 30.0, 0.0, 3310005.0, 0.0, -30.0) x_coords, y_coords = aff*(numpy.array(lons), numpy.array(lats)) # converted coordinates xValues = [-2496712.96119, -2496717.87417, -2495088.69285] yValues = [3308868.8073, 3308871.4908, 3308655.54195] band = ds.GetRasterBand(1) # 1-based index #bandtype = gdal.GetDataTypeName(band.DataType) #Byte #data = band.ReadAsArray(0, 0, cols, rows) #value = data [122, 37] #127 data = band.ReadAsArray(xOffset) # loop through the coordinates for i in range(len(lons)): x = xValues[i] y = yValues[i] # compute pixel offset xOffset = int((x - xOrigin) / pixelWidth) yOffset = int((y - yOrigin) / pixelHeight) # get individual pixel values data = band.ReadAsArray(xOffset, yOffset, 1, 1) value = data[0, 0] print value
I am working on a computational model of the abundance of wild pollinators across a landscape. The model itself is complete, and I am now struggling with a post-processing step. I have my GDAL pollinator supply raster that looks something like this (lighter colors mean higher pollinator visitation to a pixel): And I have an OGR shapefile of points representing sample locations on the landscape: I'm trying to run some analysis on the pixels under these points, but to do so, I need to be able to extract the value of a pixel under a point. Is it possible to extract the value of a pixel under a point using only OGR and GDAL through Python? I would prefer to avoid reading the entire raster into memory through ReadAsArray(), as my output rasters are very, very large (too large to fit into memory). I noticed , which is similar, but requires a command-line call.
Is it possible to get syntax highlighting for .gitignore files when using cat? Update: Tried sudo apt-get install python-pygments as suggested by @rovo but when using comments in the .gitignore it stops working. Sample .gitignore (does not work): # JetBrains IDEs .idea Sample .gitignore (works): .idea
Sometimes I quickly want to view the contents of a file from the command line. For this I of course use , but it is often source files in , or simple . For these files it would be handy if cat could give some color markup to the files, so that it reads more easy. Can cat do such a thing?
Should the administration section of a website have the same look & feel as the other parts of the website? I'm building a SAAS application and all of the public-facing parts of the website (home page, blog, about us, etc) share a HTML/CSS look & feel. I now need to add HTML/CSS to the admin section of the website (the bit that someone gets access to once they have signed up so that they can configure the SAAS options). Should the admin section share the same look & feel as the website proper? Is there any reason not to have a completely difference layout and colour scheme? Is it better to keep the same look so that users know they are still in the application or have a different look to differentiate the admin from the public-facing pages?
Lets say we have an app that performs something like surveys. There are two primary types of users, administrative users who set up and build the surveys, (who are actually the customers), and the 'public' users being surved, who will also have accounts and profiles. Here is my question. Considering how few views exist on the public end, and how different the function; is it appropriate to have a mildly different look and feel from the administrative areas? What kinds of value does this visual shift between the experiences hold? Or should the two kinds of users get the same basic look and feel? Is there value to the two ends being visually consistent? I caught myself preparing to go through the extra work of making a different look and feel for the public, but then realized there a good arguments on either side.
I'am solving Euler's project and right now triyn to solve 9 task. The solution I've found is in 3 nested loops: for ai in range(1, 100): for bi in range(1, 100): for ci in range(1,100): if ai + bi + ci == 25 and ai * ai = ci: break but when last if find the solution for-loops continues and I wanna break all of them. Is it posible? I thougt about using some flags but it's additional check for each step and makes execution longer.
Given the following code (that doesn't work): while True: #snip: print out current state while True: ok = get_input("Is this ok? (y/n)") if ok.lower() == "y": break 2 #this doesn't work :( if ok.lower() == "n": break #do more processing with menus and stuff Is there a way to make this work? Or do I have do one check to break out of the input loop, then another, more limited, check in the outside loop to break out all together if the user is satisfied?
I wanted to plot the density for this data: hist(res) As seen the max and min are -1 and 1... But when I use plot(density(res)) As it can be seen the density is being plotted for values higher than 1 and lower than -1, why is that? It is as if the density() function works wrong?
On the , there is this line: $p(\mathrm{height}|\mathrm{male}) = 1.5789$ (A probability distribution over 1 is OK. It is the area under the bell curve that is equal to 1.) How can a value $>1$ be OK? I thought all probability values were expressed in the range $0 \leq p \leq 1$. Furthermore, given that it is possible to have such a value, how is that value obtained in the example shown on the page?
I have yaml file with have parameter like this caCertificates: {} and I want replace it with below contents caCertificates: hike.crt: | -----BEGIN CERTIFICATE----- MIIFOzCCAyOgAwIBAgIUIyHpTZS7DmOv1wOXytwFAZZTJmYwDQYJKoZIhvcNAQEL BQAwJTEjMCEGA1UEAxMaTUYgUkUgQ0Egb24gVmF1bHQgN2M3ODM2NDYwHhcNMjEw NDA3MTExMDIxWhcNMzEwNDA1MTExMDQwWjAlMSMwIQYDVQQDExpNRiBSRSBDQSBv biBWYXVsdCA3Yzc4MzY0NjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIB ALwivEBn9LmCc15++MbGCLoUnAbTLY60/XH8lLBa8O3u0Ay7uLIId+9P1PaWo1nP Ku5lYrScrczlElEKcKhTl3W54llGe7HoDsnkJRerX9gDeAMpJm099INovneTU73E YVtZdAB+PN8VM1/noZz2xX1MtEmoJ52tWDUnl4lyFbCY2sSsgAX5wzk9rHpzzGKF E1Lt6s8Df6j6Z1uJ4GIMuBKKYvAtyRYl/aznVLMmNaOO2SS6/PhF3QgwQsO3mRIZ s+IpHDiyOmiMM7tFYE8VD7I4S30+8oH18w6d0geXTvT7SybDRO2EDXXUalIsRzyJ xyH23vAmjcelYiBpHGICEOoi0eeJg+DyQB8i5gnqOMFiOC3fRRg+w4dZvOk0uQy/ E3jMgDwJ1Xu6gcGE7SveQTyRoxq3AbAGcEHorfFp9iKKs7Y/2WSv/SsRUnDfa8kE OGmTvhiZoizRPkBeir6LEznf3cdG3NCYyZ/uU8vHtL+LxQ6yjIn6yC0BCNSR6d2t rcoOaZahr8nYn8VlukGUFS2x0szcVBEiiOgbtc35yHA6+MNafenwslg+CFjCvQzr U/CSHuKD6+KyowwLAX4g0i42NvOz4lKhnvCqKodXlIMPG5FRLYILZl6jAlVn7YPm oLfF7cvlMYjscufXD+0fP1O20CDdmVgBNIb0LVttS32rAgMBAAGjYzBhMA4GA1Ud DwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBSOtPatITjgddDk 5+0/dlUaPDW9nDAfBgNVHSMEGDAWgBSOtPatITjgddDk5+0/dlUaPDW9nDANBgkq hkiG9w0BAQsFAAOCAgEAbV64Ejz/VDSE0t+yaWlu283QCEvGkAImajpsAYNwrfnz U8w8bJMMKR0yknAwZCJOIloLHvP6CgHMKrDjc4CcbuoSVnKEjo7DbjbNjEaA9wWg Bbvo9Lw4MwwKkWkatFnlcxyh0SDQzYBp7CCK4CG5NYZTq7Rr1cfTNLkYu9p9sxxe 8ER6ST5bPnfPZeVUELXoLRfgMycylBzEvbEv71S+CLOP3ACj4FGXSzFCYQtlqS8+ U/B5vhHUvNYPwXUOScutMo402CSeB9oYN5bGTK6Uqln/viZc0bAgzATiZS+tT4qP k47PIsODRjnc5Xe9IyuAeIG2yvedvn/rhz0+e7RAx0sVwi3AhwdFbfRkM0nCuHYx Jys9HpI6+4oBR/+S61THTvP9s0vygr6/2PXHYocsqTUdTtUryyxelCRQygdXuHU8 TsuYMiKStR/lAXEEnKQOvUV3xyDWoHGwsjGWkR4kAzUigGuQPWgpbCVBgGFnbSM1 v8ZmLFPfVbRJNVPlDkxFluSedFdkvvVJmBG68eqQNBwIdDVqKebHES/vp3c1PYB4 TA9LBiJQIvROTw4ZPtMOe7EuZrN5ybWIxZninFvJwoDqJHpb4s1qCy7Ru9CzsYqx ERx3xliLnFgGPtMIrNofvsSq4u7+/rPExYaF8vfkBtF3r50LFiy9EbqzHQtORdY= -----END CERTIFICATE----- I want to read a file called RE-ca.crt and replace it with caCertificates: {}
I'm trying to execute this command sed -i -e "s/BASE_64/$BASE_64/" FILE_NAME where $BASE_64 is a base 64 representation of a file content. sed gives me an error since the string is too long. Argument list too long How is it possible to avoid this error?
Scheduled turning the device off and on has apparently been discontinued in Android 8. Edit: At least for my device thats the case. Given that it was one of my favorite functionalities in android 7, I would like to retain it through the update to 8.1. Is there a similar function on 8.1 or an app i can use to emulate it? Taskr and Automateit require root access to be able to shut down the device.
Is there any way to schedule timer to power on and off device? Example daily power on at 8am and power off at 10pm.
The following link recommends against using loops in shells. Why is this? Here is an example loop I just happened to be looking at when I came across that answer: find /etc/postinstall -name '*.sh' | while read script do echo Running $script ... $script mv $script $script.done done
Is using a to process text generally considered bad practice in POSIX shells? As , some of the reasons for not using shell loop are conceptual, reliability, legibility, performance and security. This explains the reliability and legibility aspects: while IFS= read -r line <&3; do printf '%s\n' "$line" done 3< "$InputFile" For performance, the while loop and are tremendously slow when reading from a file or a pipe, because the reads one character at a time. How about conceptual and security aspects?
Here is a MWE: \documentclass{article} \usepackage{pgf} \usepackage{pgfplots} \usetikzlibrary{math} \begin{document} \tikzmath{ int \foo; \foo = random(-16,10); print {Foo value: \foo.}; } \tikzmath{ int \foo; \foo = random(2,10); print {Foo value: \foo.}; } \end{document} Please note the beginning of first line. Is this behavior normal?
\documentclass{minimal} \usepackage{tikz} \begin{document} \pgfmathparse{random(-5,5)} \pgfmathresult \end{document} Works, but I have a .0.0 that not supposed to be here.
I remember what I believe is a short story, possibly by Isaac Asimov, where in a not-so-strange human (?) civilization bureaucracy suddenly goes over efficient at performing its duties. This results in a Kafkaesque nightmarish life for all citizens who face constant harassment, something which is not too far from what many of us experience in modern all-connected world. E.g., they suddenly receive unwanted benefits which get removed in the following day (early in story) or hour (later), if I remember correctly. It seems to me the pace of that all was going exponentially, but the end was rather an anti-climactic one, where everything returns to the "normal" state of things of not being able to get things done from administrations. I believe this was in the style of Asimov's short stories, it could be Ray Bradbury or even French writer Marcel Aymé though. I've read it in the 90s, but I'd say it was written long before that, in the 1920s-60s range.
I read a sci-fi novel or novella about a man that worked for a government department whose job it was to slow things down so the people didn't get run over by the government. Any ideas of the title? I think there was a lot of subterfuge between the agents. It's on the edge of my memory.
Somebody asked this and I think it's quite interesting as I couldn't figure out how to evaluate this but the Wolfram Alpha says its limit is $\frac e2$. $$\lim_{x\to0}\frac{e-(1+x)^\frac1x}{x}$$ Could someone help here?
Find the following limit: $$\lim_{x\to 0}\frac{(1+x)^{1/x}-e}{x} \tag{1}$$ The following is my approach, although is full of incorrect assumptions (statements etc). $$f(x)= \lim_{h\to 0}(1+x+h)^{1/(x+h)}\\$$ From here we can say $f(0) = e$. $$\ln(f(x)) = \lim_{h\to 0}\frac{1}{x+h}\ln(1+x+h)$$ Near $x=0$, we can use the series of logarithm: $$\ln(f(x)) = \lim_{h\to 0}\frac{1}{x+h}\left(x+h-\frac{(x+h)^2}{2}...\right)$$ Differentiating we get: $$\frac{f'(x)}{f(x)} = \lim_{h\to 0}-\frac{1}{2} +\frac{x+h}{3} ... \tag{2}$$ Now we note that $(1)$ is actually $f'(0)$ (?) and so from $(2)$ we get: $$f'(0) =\frac{-1}{2} f(0) = \frac{-e}{2}$$ While the answer is seemingly correct, the method is absolutely not. It looks like this is fluke than anything else. I also tried computing taylor series of $(1+x)^{1/x}$ near $x=0$ but couldn't do it.
I have 2 strings and I want to find all locations of one string within another. String.find works but not regex. sub: (dont want to) call in str1: i cant (dont want to) call in str1.find(sub) returns 7 but [(m.start(0), m.end(0)) for m in re.finditer(sub,str1)] returns empty list
I am tired of always trying to guess, if I should escape special characters like '()[]{}|' etc. when using many implementations of regexps. It is different with, for example, Python, sed, grep, awk, Perl, rename, Apache, find and so on. Is there any rule set which tells when I should, and when I should not, escape special characters? Does it depend on the regexp type, like PCRE, POSIX or extended regexps?
In linear programming we find a feasible region , is this region always convex? . if a concave region is found where objective is minimization , I think then a solution exists . Advance thanks. someone deleted the answer of my previous post , although i wasn't sure about the answer of 1st question , and no one is replying in that post , as i am in hurry so i re-posted it to get a answer. Thanks
So I know that in general the simplex method for linear and convex quadratic programming can require exponential time. But assuming a positive semidefinite quadratic program that is solvable by the simplex method, then the problem is definitely in P, right? The reason I ask: I am working on getting a handle on complexity theory. And I think I found a reduction from a problem to a positive semidefinite quadratic problem BUT the solution is only valid if the returned optimum is at a vertex of the feasible region. So that leaves out solving it with an interior point method since the minimum can be trivially obtained at the center of the feasible region and maybe at other points too. Since the simplex method operates on vertices, then I know that once the optimum is found, then it is at a point I actually care about. Assuming the reduction is proper and always results in a correct answer: is reduction to the simplex method a sufficient condition for proving membership in P? OR does someone have a good reference to efficient exterior point methods for this class of problem? Is there another method for quadratic programs that I am overlooking? OR am I basically stuck with proving that the number of iterations is polynomial for this specific program? Is this question better suited to a different stack exchange site?
I have (normal user) access to a SunOS 5.10 machine. /usr/bin/which is broken (it blocks). Clearly something is wrong on the system, but not having root access limits drastically what I can do. I have tried copying my which from Ubuntu, but that depends on features not available on SunOS 5.10. $ md5sum /usr/bin/which a39bb82e9e354c5b99e9e235a53c48d9 /usr/bin/which $ uname -a SunOS solaris 5.10 Generic_147147-26 sun4u sparc SUNW,Sun-Fire-V210 Solaris $ bash --version GNU bash, version 4.3.33(1)-release (sparc-sun-solaris2.10) Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software; you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Where can I find a which command that will work on this old system?
When looking for the path to an executable or checking what would happen if you enter a command name in a Unix shell, there's a plethora of different utilities (which, type, command, whence, where, whereis, whatis, hash, etc). We often hear that which should be avoided. Why? What should we use instead?
Weyl's spinor and Dirac's spinor What is the difference between the two from a mathematical point of view? So are there different mathematical definitions of spinor? Is it correct to say that the Weyl spinor appears in the Weyl equation and the Dirac spinor in the Dirac equation? What is the physical meaning of the two equations instead? The Dirac equation describes the relativistic electron (spin 1/2) while the Weyl equation describes the relativistic fermions (including spin 1/2). What is the difference? Is it correct to say that a Weyl spinor is an element of the vector space C2 on the field C? (C is the complex field)
To get to the point - what's the defining differences between them? Alas, my current understanding of a spinor is limited. All I know is that they are used to describe fermions (?), but I'm not sure why? Although I should probably grasp the above first, what is the difference between Dirac, Weyl and Majorana spinors? I know that there are similarities (as in overlaps) and that the Dirac spinor is a solution to the Dirac equation etc. But what's their mathematical differences, their purpose and their importance? (It might be good to note that I'm coming from a string theory perspective. Plus I've exhausted Wikipedia here.)
Here how my terminal look, it's ugly. and I want to restore it to the Purple background with the gray test color. Like the default installation.
I fooled around with the colors and stuff, in the terminal, and now want to go back to the maroon and white default config of the the terminal. What files do I have to delete?
how can i call class name from extend class without implements in this class method (i want extend this function from parent class) and without call new class. If i call class name like this: abstract class foo { public static function get_name(){ return get_class(); //or return __CLASS__; } } class bar extends foo {} echo bar::get_name(); i get: foo expect: bar
I have two classes: Action and MyAction. The latter is declared as: class MyAction extends Action {/* some methods here */} All I need is method in the Action class (only in it, because there will be a lot of inherited classes, and I don’t want to implement this method in all of them), which will return classname from a static call. Here is what I’m talking about: Class Action { function n(){/* something */} } And when I call it: MyAction::n(); // it should return "MyAction" But each declaration in the parent class has access only to the parent class __CLASS__ variable, which has the value “Action”. Is there any possible way to do this?
$$f(A\cup B)=f(A)\cup f(B)$$ My attempt: Suppose that $f(A\cup B) \neq f(A) \cup f(B)$, then $f(A\cup B)$ has a variable $x$ that is neither in $A$ nor $B$; however, $A\cup B$ implies that $x$ must me in either $A$ or $B$, thus we have a contradiction. Yeah... it's terrible, but I have no intuition as to how to prove this in any other way. Also, the proofs I saw in the lectures were sometimes as unconvincing as this one I just came up with. It's like they're saying this is this because it is so. How do you develop the skills and intuition to solve these kind of problems? Also, you have to know it is true before proving it. How do you even know it is true just by looking at it?
$f(S \cup T) = f(S) \cup f(T)$ $f(S)$ encompasses all $x$ that is in $S$ $f(T)$ encompasses all $x$ that is in $T$ Thus the domain being the same, both the LHS and RHS map to the same $y$, since the function $f$ is the same for both. Can you post the solution?
todolist = [] def add_item(item): todolist = todolist + [item] def main(): add_item(1) print(todolist) if __name__ == '__main__': main() I am trying to make a function called add_item() which works like append() and I am not allowed to use any built in functions. I keep getting an UnboundLocalError. How would I fix this?
How can I create or use a global variable in a function? If I create a global variable in one function, how can I use that global variable in another function? Do I need to store the global variable in a local variable of the function which needs its access?
What I try to do is to bind an onchange event to an element which is not appended. But this is what I tried: var $container = rule.$el.find('.rule-value-container'); var html = `<input class="form-control" type="number" name="${ name }_0" step="any" min="0">`; console.log($(html)); $(html).on('change', function(e) { console.log('test', e); }) $container.html(''); $container.append(html); } But this is not working how can I bind an on change event to an element which is not appended yet?
I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off. This happens on page ready and works just fine. The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound. I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.
I have read several line-breaking inside align environment but I fail to deal with the bracket {}. LaTex seems not recognize \left\{ and \right\} belong to the same equation when I break the line. \begin{align*} s_{percent-log} (y,y') &= \frac{1}{3} \left\{ \frac{\min[\log(0+1),\log(1+1)]}{\max[\log(0+1),\log(1+1)]} \\ & \qquad + \frac{\min[\log(5+1),\log(4+1)]}{\max[\log(5+1),\log(4+1)]} \\ & \qquad + \frac{\min[\log(2+1),\log(2+1)]}{\max[\log(2+1),\log(2+1)]} \right\} \\ &\approx 0.46387 \\ d_{percent-log} (y,y') &\approx 0.53613 \end{align*}
I have a very long equation that must be separated into two lines, and it has several pairs of nesting \left \right delimiters. Unfortunately, it seems that they need to be on the same line in order for them to work. Also I'm using the align environment because I need the aligning functionality. Is there a way to have the size of delimiters automatically adjusted over multiple lines?
I want to make div (this will be container). In this div I have navbar and another div (this is background img). My container has 100vh. Navbar doesn't have height. Now I want to make "rest of this 100vh" this background div. My main html looks like: <!doctype html> <html lang="pl"> <head> <meta charset="utf-8"> </head> <body> <div class="head-container"> <header> <img class="logo" src="css/873438.jpg" alt='logo' /> <nav> <ul class="nav_links"> <li><a href="#">Home</a></li> <li><a href="#">About</a></li> <li><a href="#">Contact</a></li> </ul> </nav> <a class="cta" href="#"><button>Add post</button></a> </header> <div class="background"> </div> </div> </body> </html> And now my CSS file *{ margin: 0; padding: 0; } .head-container{ height: 100%; width: 100%; } .background { height: 100vh; background-color: gray; } Background div has 969 px height, like my whole window. I want to make 100vh for whole these 2 divs. What am I doing wrong?
I am working on a web application where I want the content to fill the height of the entire screen. The page has a header, which contains a logo, and account information. This could be an arbitrary height. I want the content div to fill the rest of the page to the bottom. I have a header div and a content div. At the moment I am using a table for the layout like so: CSS and HTML #page { height: 100%; width: 100% } #tdcontent { height: 100%; } #content { overflow: auto; /* or overflow: hidden; */ } <table id="page"> <tr> <td id="tdheader"> <div id="header">...</div> </td> </tr> <tr> <td id="tdcontent"> <div id="content">...</div> </td> </tr> </table> The entire height of the page is filled, and no scrolling is required. For anything inside the content div, setting top: 0; will put it right underneath the header. Sometimes the content will be a real table, with its height set to 100%. Putting header inside content will not allow this to work. Is there a way to achieve the same effect without using the table? Update: Elements inside the content div will have heights set to percentages as well. So something at 100% inside the div will fill it to the bottom. As will two elements at 50%. Update 2: For instance, if the header takes up 20% of the screen's height, a table specified at 50% inside #content would take up 40% of the screen space. So far, wrapping the entire thing in a table is the only thing that works.
I think my CMS might force me to have URLs that look like these: domain.com/products/new-products/ domain.com/products/used-products/ Instead of: domain.com/new-products/ domain.com/used-products/ Assume that I was trying to optimize for "new products" and "used products". Will having the URLs my CMS might be forcing on me be bad for SEO? I could do something like this: domain.com/products/new/ domain.com/products/used/ (but I don't think these are optimizing for "new products" and "used product" due to the ordering of the key words)
I'm working for a website to convert the website URL to an SEO friendly URL. I plan to use this: example.com/category-name/pageid-123-page-name I looked at some similarly categorized, highly ranked websites. They have the same structure, except for one thing. In one case, the URL format was example.com/category-name/pageid-123-page-name.html Another was example.com/category-name/pageid-123-page-name.php Now I know the text in URLs help with SEO. Is it more helpful to have a file extension? If yes, which one is better? Or if my current plan is okay, will it be better with a / at the end?
I'm asked to find: $$\int_{-\infty}^\infty \frac{\ln(x^2+1)}{1+x^2} dx $$ Attempt Considering $$ \oint \frac{\ln(z^2+1)}{(z+i)(z-i)} dz $$ So first I find the branch points of the function. This function has a simple pole at $z=i$ and an essential singularity at $z=-i$. Using this contour: By residue theorem, $$\int_\gamma + \int_AB + \int_BC = 2\pi i \times \text{Residue} $$ $$ \text{Residue} = \frac{\ln(2i)}{2i} = \frac{\pi}{4} - \frac{i}{2}\ln(2) $$ Taking the semi-circle to infinity, $\int_\gamma \rightarrow 0$ by Jordan's Lemma. $$\int_{-\infty}^0 \frac{\ln(-|x| + i)}{1+x^2} dx + \int_0^{\infty} \frac{\ln(x+i)}{1+x^2} dx = 2\pi i \left[ \frac{\pi}{4} - \frac{i}{2}\ln(2) \right] $$ $$ \int_{-\infty}^0 \frac{\ln (i - |x|) + i\pi}{1+x^2} dx + \int_0^{\infty} \frac{\ln(x+i)}{1+x^2} dx = 2\pi i \left[ \frac{\pi}{4} - \frac{i}{2}\ln(2) \right] $$ $$ \int_{\infty}^0 \frac{\ln (i - x) + i\pi}{1+x^2} dx + \int_0^{\infty} \frac{\ln(x+i)}{1+x^2} dx = 2\pi i \left[ \frac{\pi}{4} - \frac{i}{2}\ln(2) \right] $$ I have a hunch that the first integral must become $+\int_0^{\infty}$ for it to combine with the second integral to give $\int_0^\infty \frac{\ln(1+x^2)}{1+x^2}\,dx$ then we take the real part on the right. But I can't seem to show this..
How would I go about evaluating this integral? $$\int_0^{\infty}\frac{\ln(x^2+1)}{x^2+1}dx.$$ What I've tried so far: I tried a semicircular integral in the positive imaginary part of the complex plane, excluding the negative real axis, but had trouble calculating the residue at $z=i$ (perhaps there is a way of doing this that I don't know of). After that didn't work, I tried a rectangular box integral from $\epsilon$ to $R$, from $R$ to $R+i/2$, from $R+i/2$ to $-S+i/2$, from $-S+i/2$ to $-S+i\epsilon$, from $-S+i\epsilon$ to $-\epsilon+i\epsilon$ and finally a semicircle around the origin, radius $\epsilon$. Any help would be appreciated.
I have the scheduler class, when I was about to set the Apex scheduler, I noticed that I can only select the time which will be every hour but i need to run it every 5 minutes, can you give me some ideas to achieve this? This is my scheduler class global class CaseBreachTAT_Scheduler implements Schedulable{ global void execute(SchedulableContext sc) { CaseBreachTAT_Batch CaseBT_B = new CaseBreachTAT_Batch(); database.executebatch(CaseBT_B); } }
Using the salesforce GUI it seams impossible to schedule a job every 15 minutes. Or more than once a day.
so if a very un-bouncy object hits the floor and crashes into it rather than bouncing, where does most of the energy go? Does it simply turn into heat from friction? Or does it go into the Earth's movement by an imperceptible amount?
Suppose we have an object in space. say gravity is negligible, and the thing has a rocket on both sides. the thing fires one rocket for, say, 5 seconds. now it's moving. The object has kinetic energy. Now the other rocket fires for 5 seconds. Then it's stationary. where does the energy go? I know that some of the energy from the rockets would just go into space as heat and kinetic energy of the hydrogen particles flying out, but how does there seem to be more energy in the situation if the first rocket just goes for 10 seconds than if one goes for 5 and the other goes for 5?
Say I am using a t statistic, the (two-tailed-t test) p-value as i understand is given as pr(t$\geq$|t| |null is true), why cant it be that pr(t=t|null) or at least some small relative frequency in an infinitesimal distance around t, such as f(t)dt ?
After taking a statistics course and then trying to help fellow students, I noticed one subject that inspires much head-desk banging is interpreting the results of statistical hypothesis tests. It seems that students easily learn how to perform the calculations required by a given test but get hung up on interpreting the results. Many computerized tools report test results in terms of "p values" or "t values". How would you explain the following points to college students taking their first course in statistics: What does a "p-value" mean in relation to the hypothesis being tested? Are there cases when one should be looking for a high p-value or a low p-value? What is the relationship between a p-value and a t-value?
I need to show that the following is an abelian group: $$x*y = \frac{x+y}{xy+1}$$ on the set $\{x \in \Bbb R \,|\, -1 < x < 1\}$. I have been working on this problem, trying to show closure. I know that we need to show that $|x+y|<|xy+1|$ for all $x, y \in (-1,1)$. Can I assume that the max value that the expression yields is $1$ if we take $x=1$ and $y=1$? And the lowest value that is possible is when $x=-1$ and $y=1$? Or am I going about this the wrong way?
I have to prove that the result of $x * y \in G$ so $\frac{x+y}{1+xy} \in (-1, 1)$. So $x > -1$ and $y > -1$ at the same time $x < 1$ and $y < 1$. If I multiply the first 2 expressions I obtain $xy < 1$ which is true, and if I sum up the last 2 I get $x + y < 2$. At this point I am not sure if I am doing well. How should I continue this problem?
I created a flash drive with 12.04 Ubuntu on it, because I want to try it and explore it. I can't get my computer to boot from the drive. I used the suggested pendrive program to format the drive. I opened my boot menu when i started my computer and it didn't have the option to boot from the flash drive. Is there anything I can do or should I just give up and burn it to a disk?
I have a laptop with Ubuntu installed as the only OS. I also have a USB stick with a Windows 7 installation on it. I want to install Windows from the USB stick on my laptop but when I try to restart the laptop to get access to BIOS, I can't seem to find the command for it, its like it skips everything and just says Ubuntu and then takes me to the login screen. How do I change the boot priority to USB in Ubuntu?
How do I get the naked domain for my site that is typed into a browser (example.com) to automatically redirect to www.mywebsite.com. Would this be done on the internal IIS web server or through the registration service DNS settings? I use Register.com and I tried asking their technical support, but they did not answer my question with a usable solution.
We have a website that has two URLs (one for the US side and another for the Canadian side which is then broken into Canadian English and Canadian French). For the purposes of my question, I will write as: www.us_url.com (US) www.canada_url.ca/ca_en/ (Canadian English) www.canada_url.ca/ca_fr/ (Canadian French) To make sure people are on the correct site, what do I do if they go to the US URL with Canadian English content (e.g. www.us_url.com/ca_en/canada.asp) but I want to make sure the URL is the Canadian one (e.g. www.canada_url.ca/ca_en/canada.asp) so it shows up properly in Google Analytics. We're using IIS 7 and classic ASP.
If $A$ is matrix of $k\times k$ , then is it necessary that $Ax, A^2x , A^3x ...... A^kx$ will be linearly dependent ? $x$ is a vector and $A$ contains all real entries
Problem: Let $A\in M_{n\times n}(\mathbb R)\,$ be a matrix and suppose that a positive number $k\,$ exists such that $A^k = 0\,$ and $A^{k-1} \neq 0$. Suppose that $x=\left[ \begin{matrix} x_1 \\ \vdots \\ x_n \end{matrix} \right]$ is a vector in $\mathbb{R^n}$ such that $A^{k-1} x \neq 0$. Prove that the $k\,$ vectors $\,x,Ax,\dots,A^{k-1}x\,$ are linearly independent. My attempt: Suppose $x + Ax + \dots + A^{k-1}x = 0$. Multiply both sides with $A^{k-1}$. Then we have $A^{k-1}x + A^k (x + Ax + \dots + A^{k-2}x) = 0 \Leftrightarrow A^{k-1}x = 0 \Leftrightarrow x = 0$ which implies $x + Ax + \dots + A^{k-1}x\,$ is linear independent. This problem looks quite easy but I want my proof to be checked. Is it correct?
In the profile settings page, I clicked "change picture" on the picture tab, clicked "upload picture", and encountered this nonsense when trying to upload. In particular, when I clicked the "drag and drop" area, nothing happened, and no errors appeared in the console. Same issues with the "link from the web" and similar. (Note: the dark theme has no effect. I tried disabling that also.) For reference, I was going to change it to .
When I try to upload an image, I'm presented with the following dialog box, The dialog box does not allow uploading either from my computer or by posting a link. This happens only on Chrome browser (running on Windows). Clearing cache and cookies, and restarting computer do not resolve. Is this just my computer? Or is this a site-wide bug? Additional info: Clicking on 'click' to upload does nothing. Dragging an image onto dialog redirects me to the file location on my computer. Clicking 'Add picture' redirects me to http://[SE-domain].com/upload/image?https=true. UPDATE: A Norton extension for Chrome was the source of the problem.
This is a relatively large project, but I'll try to put all necessary things here. /** Removes the record with Key k from the dictionary. It throws a DictionaryException if the record is not in the dictionary. */ public void remove(Key k) throws DictionaryException{ deleteNode = findNode(k); if (deleteNode == null) throw new DictionaryException("Error: Record doesn't exist in the dictionary!"); else{ //check if children are leafs if(deleteNode.getLeftChild() == null || deleteNode.getRightChild() == null) //set it to itself replace = deleteNode; else //otherwise replace with successorNode replace = successorNode(deleteNode); //store left child if it exists if (replace.getLeftChild() != null) child = replace.getLeftChild(); //else, store right else child = replace.getRightChild(); //check if both nodes are null if (child != null) child.setParent(replace.getParent()); //else replace the node that needs to be deleted else{ //replace left child of parent if(replace == replace.getParent().getLeftChild()) replace.getParent().setLeftChild(child); //else replace right else replace.getParent().setRightChild(child); } //store information of the replacing node, within the deleteNode if (replace != deleteNode) deleteNode.setRoot(replace.getRecord()); } } This method has an null-pointer error on the parent stuff. I'm not sure how to go about dealing with it. This is an Ordered Dictionary stored in a BST. Nodes consist of Records which consist of (Key,data) where Key is (name,type). Essentially a Record is ((name,type),data). I can provide more information if necessary. I've been stuck here for a quite while any help is appreciated!
What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?
Is it possible to change the line style in a tikz figure in the same \draw command? I am looking for something like: \documentclass[tikz]{standalone} \begin{document} \begin{tikzpicture} \draw[style1] (0,0) -- ++(1,0) **CHANGE STYLE** -- ++(1,0); \end{tikzpicture} \end{document} The main motivation is that I don't want to loose the relative coordinate as I go on with a long \draw command.
Is it possible to draw thick curve between (2,2) (4,3). Remaining portion must be thin. \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw [blue] plot [smooth] coordinates {(0,0) (2,2) (4,3) (5,5) (0,10)}; \end{tikzpicture} \end{document}
I heard you have to go to a guild or be at like level thirty-something. So how do I find that guild?
The game is released for a few days now. I have heard that you can turn into thoses beasts. I have a few questions about that How do you turn into werewolf/vampire ? On the chat people said they can bite others but who bite them first? How long does the effect last ? Are there any cons ? Maybe if your are a vampire you take damage from the sun like in older Elder Scrolls ?
Here is an example when I were to define one more request initiate_call() ..it should combine all the oututs of the following calls and comebine returns from each and output one final ret. what is the best way to structure this. def makeA(): return {"name": "steve"} def makeB(): return {"street": "new York"} def makeC(): return {"city": "NY"} final ret to be like {"name": "steve", "street": "new york", "city": "NY"}
I have two Python dictionaries, and I want to write a single expression that returns these two dictionaries, merged (i.e. taking the union). The update() method would be what I need, if it returned its result instead of modifying a dictionary in-place. >>> x = {'a': 1, 'b': 2} >>> y = {'b': 10, 'c': 11} >>> z = x.update(y) >>> print(z) None >>> x {'a': 1, 'b': 10, 'c': 11} How can I get that final merged dictionary in z, not x? (To be extra-clear, the last-one-wins conflict-handling of dict.update() is what I'm looking for as well.)
I want to parse floating-point numbers from scratch in C. But I found there is an obviously error because of the storage of float/double in computers is not precise enough. Here is my code for parsing, regardless of the conditions that involves negative sign: void parseFloat(double *coe, int *exp){ char c = 0; double digit = 10; *coe = 0, *exp = 0; int state = 0; while((c = getchar_unlocked()) !='\n'){ if(c == '.'){ state = 1; continue; } if(c == 'e'){ state = 2; continue; } if(state == 0){ *coe = *coe * 10 + c - '0'; }else if(state == 1){ *coe += (c - '0') / digit; digit *= 10; }else if(state == 2){ *exp = *exp * 10 + c - '0'; }else{ *coe = 0, *exp = 0; break; } } return; } And it got the totally intolerable wrong result because of the addition of trivial mistakes made by each loop step in parsing process: input -> output 5.699141892149156e76 -> 5.699141892149156341 76 9.205357638345294e18 -> 9.2053576383452959675 18 So is there any decent method for parsing floating-point numbers more precisely? And how did the build-in library like scanf("%f", &fpn) implement it? Thanks a lot!
Consider the following code: 0.1 + 0.2 == 0.3 -> false 0.1 + 0.2 -> 0.30000000000000004 Why do these inaccuracies happen?
I got a Schengen visa from french embassy date: from 7th February /2019 until 8th March /2019 with 15 days duration of stay my travel plan will be as following : i will arrive in Paris on the 23rd of February by emirates airlines and i plan to leave Paris on the 7th of March and will arrive in Cairo on 8th of March and my visa valid until the 8th of March my question : Is my travel plan on point because i don't want to overstay and leave the Schengen area n good terms and i also don't want to get into arguments with the airlines boarding staff Thanks in advance
Valid for: Schengenstater (Issued by Sweden) valid From: 26-09-16 to 16-10-16 Type of Visa: C Number of Entries: 1 Duration of Stay: 6 days 1st entry in Greece on 10-10-16 and exit on 13-10-16 2nd entry in Belgium on 13-10-16 and exit on 14-10-16 3rd entry in Norway on 14-10-16 and exit on 16-10-16 My stay at Schengen countries in total of 6 Days (from 10-10-16 to 16-10-16). This is how the calculation or I am over staying? Please Advise.
I defined an Enum. I also have 2 methods: method 1 - will get the enum type - enum default type is int so it will print System.Int32 method 2 - will have switch case that compare the enum type with simple number - so in case the enum is int the switch case need to be compile with not problem and without any casting. But this code does not compile and I get two errors ( the error point on the case 1 and case 2 in the switch case ) Cannot implicitly convert type 'int' to 'Color'. An explicit conversion exists (are you missing a cast?) Someone can explain why I get an error even if the Color type is int ? To compile this code I need to make casting to the Color to int. The code: public enum Color { RED, // 0 BLUE, // 1 GREEN // 2 }; Color color = Color.BLUE; private void boo(object sender, EventArgs e) { string str = Enum.GetUnderlyingType( color.GetType() ).ToString(); // it will print 'System.Int32' System.Console.WriteLine(str); } // the switch case make the compile error - but the color is int private void foo() { switch( color ) { case 0: { } break; case 1: { } break; case 2: { } break; } }
This is my code: internal enum WindowsMessagesFlags { WM_EXITSIZEMOVE = 0x00000232, WM_DISPLAYCHANGE = 0x0000007e, WM_MOVING = 0x00000216, } protected override void WndProc(ref Message m) { switch(m.Msg) { case (int)WindowsMessagesFlags.WM_DISPLAYCHANGE: FixWindowSnapping(); break; case (int)WindowsMessagesFlags.WM_EXITSIZEMOVE: SaveWindowProperties(); break; case (int)WindowsMessagesFlags.WM_MOVING: KeepProperLocation(ref m); break; } } Is there anyway to prevent the casting?
A typical introduction to the Metropolis--Hastings algorithm, and hence to Markov chain Monte Carlo techniques in general, starts with the following assumptions on some probability distribution $P(x)$ which we'd like to sample from. We are perfectly able to evaluate $P(x)$, or perhaps more accurately some multiple $C \cdot P(x)$ for some fixed $C$, though I don't quite see why you wouldn't just normalise and put $C = 1$. However, it is very hard to sample from $P(x)$; so hard, that we'd rather sample from some other distribution thousands of times for the sake of getting a sample of $P(x)$ via Markov chain methods. I'd like to see an actual, real-life example in which such a scenario comes up. How can it be easy to evaluate $P(x)$ but hard to sample from it? I'd be interested in seeing a real-life situation involving say weather, diseases, neurons, air flow, whatever it is, that leads to a situation in which MCMC methods are a natural thing to ask for.
My understanding is that when using a Bayesian approach to estimate parameter values: The posterior distribution is the combination of the prior distribution and the likelihood distribution. We simulate this by generating a sample from the posterior distribution (e.g., using a Metropolis-Hasting algorithm to generate values, and accept them if they are above a certain threshold of probability to belong to the posterior distribution). Once we have generated this sample, we use it to approximate the posterior distribution, and things like its mean. But, I feel like I must be misunderstanding something. It sounds like we have a posterior distribution and then sample from it, and then use that sample as an approximation of the posterior distribution. But if we have the posterior distribution to begin with why do we need to sample from it to approximate it?
Problem: Find $$\lim_{n\to \infty} \left[\frac{1}{n^k}(1^k+2^k+...+n^k)-\frac{n}{k+1}\right].$$ We solve this problem by taking $x_n=(k+1)(1^k+2^k+...+n^k)-n^{k+1}$ and $y_n=n^k(k+1)$ then by Stolz's theorem we have that $$\lim_{n\to \infty}\frac{x_{n}-x_{n-1}}{y_{n}-y_{n-1}}=\frac{(k+1)n^{k}-(n)^{k+1}+(n-1)^{k+1}}{(k+1)[n^{k}-(n-1)^k]}$$ $$=\frac{(k+1)/n-1+(1-1/n)^{k+1}}{\frac{k+1}{n}[1-(1-1/n)^k]}$$ $$=\frac{(k+1)/n-1+(1-1/n)^{k+1}}{\frac{k+1}{n^2}[(1-1/n)^{k-1}+(1-1/n)^{k-2}+...+1]}$$ $$=\frac{nk+n-n^2+n^2(1-1/n)^{k+1}}{(k+1)[(1-1/n)^{k-1}+(1-1/n)^{k-2}+...+1]}$$ I am not sure how to proceed from here and thus any hints will be much appreciated.
Suppose $a \in \mathbb{R} ,a>1$ Is there an idea to compute the limit below ? $$\lim_{n \to \infty}\left( \frac{1^a+2^a+3^a+...+n^a}{n^a}-\frac{n}{a+1} \right)$$ I tried it for $a=1,2,3$ but I get stuck in general form . Can someone help me ? Thanks in advance.
How do I get the line break inside a pin node to work in TikZ? \node[pin={\angle+0.5*\percent*3.6:hi\\there}] at (120:3) {}; I tried align=center but didn't work as a typical node.
I just found the pin option to drawing, and it looks useful in some of the things I want to draw. How do I format it though? I've tried pin=[red]60:{Hey!} and I get the error Cannot parse this coordinate. \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{shapes,arrows,positioning} \begin{document} \begin{tikzpicture}[node distance=2cm,>=latex, every node/.style={ font=\sffamily\scriptsize }, circtext/.style={draw,circle,minimum size=8pt,inner sep=2pt}, dot/.style={draw,circle,fill=black,minimum size=0.6mm,inner sep=0pt} ] { \node[rectangle, fill=green!10!white!90!black, minimum width=6cm, minimum height=3cm] at (2,0){}; \node[circtext, fill=yellow](A) at (0,0) {A}; \node[circtext, fill=yellow, right=of A](B){B}; \draw[->] (A) -- node[dot, pos=0.5, pin=[red]60:{Hey!}](C){}(B); } \end{tikzpicture} \end{document} The default style looks like it's a gray thin arrow, and I want to change it to a black thin dotted line with no arrow. update: I figured out how to add style to the pin node: pin={[red]60:Hey!}] But I can't figure out how to change the linestyle though.
I recently found out that my MacBookPro11,4 is "leaking electricity" somewhere. At first it seemed like a minor tingle. Then i tried to see if it gets worse if i touched a good conductor (a radiator) and the laptop at the same time. It got a lot worse. From tingle to a continuous surge that for some could be quite unbearable. How "normal" is this ? How dangerous is this to people? How damaging is this to the laptop itself? What exactly causes this? Is fixing this covered by standard warranty?
I have no idea why. But apple have not earthed the stubbly plug for the macbook pro transformer. So on the short lead the only way the charger is earthed is when I touch it or the macs unibody which gives you a sort of vibrating feeling on your palms. When I went to the genius bar to complain about it they said that it was completely 'normal'. Where their definition of normal is that every MacBook does it. I have had 4 MacBooks and all have done it. The genius did say that he though he has seen a few earthed 3pin plugs. So my question is where can I pick one up? or how could we force apple to earth the stubby plugs and recall them?