summary
stringlengths
15
147
text
stringlengths
1
19.3k
answer
stringlengths
32
22.6k
labels
float64
0.33
1
answer_summary
stringlengths
5
164
FlotChart - Showing the distribution on hourly basis regardless of timestamp
I would like to have a flotchart that depicts the distribution of all data (x axis represents the values from 0 to 10, y axis for hour only starting from 7am to 7pm). I could not figure out how I should set the configuration of flotchart in this regard. Here is the json sample of my Dataset : [1409558400000, 7.45],[1409562000000, 5.71], [1409565600000, 7.50], [1409569200000, 7.63], [1409576400000, 3.14], [1409644800000, 7.45],[1409648400000, 5.71], [1409652000000, 7.50], [1409655600000, 7.63], [1409662800000, 3.14], [1409731200000, 7.45],[1409734800000, 5.71], [1409738400000, 7.50], [1409742000000, 7.63], [1409749200000, 3.14]] ; And here is the code for flotchart; The problem with this is that it sorts all the series based on their timestamps. I do not want that. I would like them to fit in based on their "hour" parameter only. Anyone knows if only hour on the x-axis without sorting the data series is possible with flotchart ? $("#a-dag").click(function() { console.log("a dag filtering will be applied..."); $.plot("#placeholder", [d], { series: { lines: { show: true }, points: { show: true } }, grid: { hoverable: true, clickable: true, markings: [{ yaxis: { from: 0, to: 4 }, color: "#F2CDEA" }, { yaxis: { from: 4, to: 7 }, color: "#D7EEE1" }, { yaxis: { from: 7, to: 12 }, color: "#F2CDEA" }] }, xaxis: { mode: "time", twelveHourClock: true, }, yaxis: { min: 0, max: 12 } }); });
Just convert your timestamps to hours, for example like this: $.each(d, function (index, datapoint) { datapoint[0] = (new Date(datapoint[0])).getHours(); }); (If you want values with AM / PM change accordingly.) And of course remove the mode: "time" from your options. See this fiddle for the changed code.
0.888889
"time" from your options
Database table structure for storing SSO information for FB or Google+
I have a web application that I would like to add single sign on capability using user's Facebook or Google+/Google App account. I have a USERS table that stores users login information. All users are required to have a record in this table no matter if they signed up using FB or Google+. I am trying to figure out the information that I need to store in the database in order to link USERS table records to FB or Google information. Facebook documentation states: the app should store the token in a database along with the user_id to identify it. So should I create a table called SSO_LOOKUP with following columns: USER_ID // user's id that links to my USER table PROVIDER_ID // user's FB or Google account id PROVIDER_TYPE // indicates if it is Google, FB, Twitter, etc. ACCESS_TOKEN
Technically speaking all you really need to store is the Refresh Token and some kind of flag type identifier that tells you if its a Facebook or Google Refresh Token. Then you can query the API for what ever information you need. Storing the User Id would be a good idea becouse if they logout then reauth you will still know who it is even though the refresh token has changed. anything else is kind of over kill really as you will be getting that information back from the API anyway when you make your calls. You could if you want store there Name and most recent picture that might be nice to display before you have fetched there information. Then update any changes to your data after you access the API for the first time. But its basically up to you how you want to design things, and what kind of application we are talking about here.
0.888889
Refresh Token and a flag type identifier .
CMOS 4066 Question
This is my first post here and I have a question about a CMOS circuit I have been designing for I while using the 4066 (I'm a noob to digital electronics). I am using a 4066 to pass random pulses I generated by feeding a noise generator with two two outputs (the generator is connected to a JFET amp and then clamped with diodes to two different dc voltages) into a 4050 (one buffer for each noise gen output). The pulses work perfectly. The only problem is, when the 4066 is not enabled, about 1 volt of the pulses pass through each switch. I was wondering if there was any way to fix that! Here is my circuit:
As noted, adding a resistor to the desired "idle state" voltage will cause the output to swing to that voltage when the 4066 is disabled. If one would like the output to stay at its present voltage when the 4066 is disabled, and if one is driving a high-impedance load, one may instead use a capacitor. If a capacitor is used, then while the 4066 is enabled the cap voltage will swing toward the input, and when it is disabled it will tend to stay more or less where it is (though it will likely drift away from its present voltage at some speed). The larger the cap, the more slowly the cap will switch to the desired voltage, but the more slowly it will drift away. Feeding the output of the 4066 into an op amp wired as a voltage follower may also slow down the drift. I'm not sure exactly what you are intending your circuit for, but some kinds of "random computer noise" were historically generated by feeding a noise source through an analog switch which was turned on briefly about 5-10 times/second, and then a cap; the voltage on that cap was then used to control the frequency of an oscillator.
0.888889
Adding a resistor to the desired "idle state" voltage will cause the output to swing to that voltage when the 4066
How to call hook in template.php after login from any user in drupal 7?
I am using below code to get the user login gender information & store in SESSION, I want to call below code after login, I already try this hook function bartik_user_login(&$edit, $account) {}but its not working. Please help. Thanks if (user_is_logged_in()) { global $user; $uid = user_load($user->uid); $profile_main = profile2_load_by_user($uid, 'main'); $field_iam = field_get_items('profile2',$profile_main,'field_i_am_field'); $_SESSION['i_am']=$field_iam[0][value]; echo $_SESSION['i_am']; }
You should use this hook in a custom module. You should also not tamper with core code as the Bartik theme directly. Also take a look at this: How do I save session data for the anonymous users?
0.888889
How to save session data for anonymous users?
Is there a way to deform a model and then have the mesh stay that way, even without an armature?
I want to 3D print several pawns. I need them to be in different poses, but be the same general character. I can achieve this by re-meshing the posed object with another object, but I would like a less time consuming way. How do I pose a mesh using an armature, then have the mesh stay that way, even without the armature which needs to be deleted for my print? preferably this would create a new mesh that I could print as my pawn(s).
Yes, you can apply the armature modifier. This will fix the mesh into it's pose, so you probably want to do this on a duplicate of the model.
1
Apply the armature modifier to the mesh
Is it safe to disable cache flushing on a SSD with "power loss protection"?
I have an Intel 320 SSD which is supposedly able to flush its cache during a power loss. From Storage Review: Rarely seen in a consumer SSD, Intel uses an array of capacitors to make sure data gets saved to the drive in the event of an unsafe shutdown as the result of power loss. From Intel: The Intel SSD 320 Series contains hardware- and firmware-based power-loss data protection features. The SSD includes a power-fail detection circuit, which sends a signal to the ASIC controller in the SSD indicating there is an imminent drop in power level. Triggered by this, SSD firmware disconnects the input power from the SSD. The SSD then relies on its on-board power-loss protection capacitance to provide enough energy for the SSD firmware to move data from the transfer buffer and other temporary buffers to the NAND. Does it mean I can safely turn off "Windows write-cache buffer flushing"? My primary motivation is to improve performance, although I'm aware that this might not make a big change for desktop workload.
As it turns out, intel is one of the few ssd brands which you will want to have flushing enabled. http://www.tomshardware.com/reviews/ssd-performance-tweak,2911-15.html
0.888889
flushing enabled intel
Modified exponential distribution in R
I would like to make my own probability density function in R to simulate some things from a paper. It is somehow similar to exponential distribution but what i really want to do is to redefine the exponential distribution into a "modified" one... Is there such a way to do this? Thanks. I want to simulate this: b(x) = {(µ/p)(e ^ (-(µx-q)/p) , x > q(xbar) and 0 otherwise } xbar is an x with a line above it, mean, average
I believe you can do what you want with ?sample . Use your known distribution function b(x) to generate a vector of probabilities, say bprob , then sample(x,size, replace=TRUE,prob=bprob) There are some very interesting methods for generating samples from arbitrary distributions. See for example, Normal RandomNumbers:UsingMachine AnalysisTo Choosethe BestAlgorithm W. H. PAYNE WashlngtonState University (somewhere on the web), or Numerical Recipes in C The Art of Scientific Computing Second Edition William H. Press,Saul A. Teukolsky et al, chapter 7.3
1
Use known distribution function b(x) to generate vector of probabilities, say bprob .
Why is the result not 1?
int m = 0; m += m++; System.out.println(m); prints to 0 but i thought m will be post incremented and finally be 1. Would someone please explain. Note: i know how post increment works (atleast i think i do :P). But what i am trying to figure out is that when i say m + = m++ lets assume it means m = m + m++ which will evaluate m++ after sending the value of m, 0 in this case, and evaluate to m = 0 + 0 then increment the value of m because of the post increment. now if post increment has occured, why is m not 1
ANSWER: An assignment evaluates side effects before performing the assignment. m += m++; is equivalent to temp = m + m++; ; m is now 1, but temp is 0 m = temp; ; m is now 0 again
0.666667
ANSWER: An assignment evaluates side effects before performing the assignment
Split dataset based on the first column
I have a dataset which I want to split based on the first column. The data looks like this AA = {{"Symbol", "Full Name", "Date", "Open", "High", "Low", "Close", "Adj Close", "Volume", "Type"}, {"KO", "The Coca-Cola Company", {2013, 7, 19, 0, 0, 0.}, 40.88, 41.1, 40.79, 41.09, 41.09, 1.14011*10^7, "Stock"}, {"KO", "The Coca-Cola Company", {2013, 7, 18, 0, 0, 0.}, 40.86, 41.07, 40.74, 40.81, 40.81, 9.7088*10^6, "Stock"}, {"KO", "The Coca-Cola Company", {2013, 7, 17, 0, 0, 0.}, 40.55, 40.98, 40.31, 40.84, 40.84, 1.85131*10^7, "Stock"}, {"KO", "The Coca-Cola Company", {2013, 7, 16, 0, 0, 0.}, 39.78, 40.5, 39.5, 40.23, 40.23, 3.35756*10^7, "Stock"}, {"KO", "The Coca-Cola Company", {2013, 7, 15, 0, 0, 0.}, 41.05, 41.25, 40.93, 41.01, 41.01, 1.14184*10^7, "Stock"}, {"KO", "The Coca-Cola Company", {2013, 7, 12, 0, 0, 0.}, 41.03, 41.13, 40.73, 41.03, 41.03, 1.06864*10^7, "Stock"} {"MCD", "McDonald", {2013, 7, 19, 0, 0, 0.}, 100.2, 100.41, 99.53, 100.27, 100.27, 4.5083*10^6, "Stock"}, {"MCD", "McDonald", {2013, 7, 18, 0, 0, 0.}, 100.48, 100.77, 99.99, 100.18, 100.18, 3.4016*10^6, "Stock"}, {"MCD", "McDonald", {2013, 7, 17, 0, 0, 0.}, 100.05, 100.35, 99.3, 100.1, 100.1, 5.3774*10^6, "Stock"}, {"MCD", "McDonald", {2013, 7, 16, 0, 0, 0.}, 100.18, 101.12, 99.47, 100.88, 100.88, 4.4062*10^6, "Stock"}, {"MCD", "McDonald", {2013, 7, 15, 0, 0, 0.}, 101.6, 101.73, 100.7, 100.75, 100.75, 4.4807*10^6, "Stock"}, {"MCD", "McDonald", {2013, 7, 12, 0, 0, 0.}, 100.59, 101.81, 100.5, 101.58, 101.58, 4.7668*10^6, "Stock"}, {"MCD", "McDonald", {2013, 7, 11, 0, 0, 0.}, 100.75, 100.96, 99.76, 100.79, 100.79, 4.0641*10^6, "Stock"}} I've been able to do it: Split[AA, First[#1] === First[#2] &] But I do not understand the theory behind it. This is how far I got Split[list, test] treats pairs of adjacent elements as identical whenever applying the function test to them yields True. From this I get that Split is a function where AA is my list, and that it splits the data into groups when the test yields true. But I get confused here. First[#1] === First[#2] & First[{a, b, c}] a Based on this I get that it picks the first element of the list within the list, in my case "KO" This means that when First[#1] equals First[#2], it yields true. However, I don't understand the function of #. How does this predicate function work? Does it take Row 1 column 1 = Row 2 column 1 --> False Row 2 column 1 = Row 3 column 1 --> True Row 3 Column 1 = Row 4 column 1 --> True ... and then group all the True and all the False together and create seperate lists? Same function again: I'm just not sure what #1 does in the list and what #2 does in the list and why & needs to be added at the end. Same function as above ---> Split[AA, First[#1] === First[#2] &]
You seem to be on the right track but having some trouble with the anonomous function syntax. I highly recommend you read up on this as it's a very useful concept. Essentially #1+#2& is shorthand that translates into Function[{arg1,arg2},arg1+arg2]. So a good place to start is the documentation for Function. Now to the problem at hand. I understand it you want to sort your list such that you get one list containing all entries starting with "KO", and one with all the entries starting with "MCD", and so forth. In that case you should not be using Split on it's own. Since it only sorts out runs of identical elements. eg Split[{a,a,b,a,a}]=> {{a,a},{b},{a,a}} So what you need to do is to first sort your list, and then split it. Now it happens to be the case that there are convinient functions for sorting and splitting based on the output of a function, so you don't actually need the First[#1]==First[#2]& syntaxt that you find confusing. Still I would again highly recommend you read up on it. Anyways, here's an example of code that solves your problem: sortedAA = SortBy[AA, First]; splitAA = SplitBy[sortedAA, First]; First we sort the list so that all entries with the same first element apear in order eg. SortBy[{a,a,b,a,a},First] => {a,a,a,a,b}, then we split this into sublists, eg. Split[{a,a,a,a,b}] => {{a,a,a,a},{b}}.
0.888889
How to sort anonomous function syntax?
How to fix the order in which text appears in an axis label (V7)
One of the AxesLabel is "$:\text{log}|\Phi8b(u)|\color{Red}{\text{Red}}$". Question: How to make it like: "$\color{Red}{\text{Red}}:\text{log}|\Phi8b(u)|$"?. My Mathematica commads: Φ8[u_] := Sin[u]; Φ8b[u_] := Sin[u] + 1/10; Plot[{Log[Abs[Φ8[u]]], Log[Abs[Φ8b[u]]]}, {u, 0, 2*Pi}, PlotStyle -> {{Thick, Blue}, {Thick, Red, Dashed}}, AxesLabel -> {u, {Style["Blue", {Blue, Bold}]*":log|Φ8(u)|", Style["Red", {Red, Bold}]*" :log|Φ8b(u)|"}}]
I am not sure what the ultimate aim is but for motivation: p = Plot[{Log[Abs[\[CapitalPhi]8[u]]], Log[Abs[\[CapitalPhi]8b[u]]]}, {u, 0, 2*Pi}, PlotStyle -> {{Thick, Blue}, {Thick, Red, Dashed}}, PlotLegends -> LineLegend["Expressions"]]; rp = ReplacePart[ p, {2, 1, 2} -> Inner[Style[#1, #2] &, p[[2, 1, 2]], {Blue, Red}, List]]
1
p = Log[Abs[CapitalPhi]8b[u]]]
What does "pie" mean in the following sentence?
I once saw a sentence: I will go to a restaurant for pie. Native speakers didn't correct this sentence. I don't know why. I would say "I will go to a restaurant to eat a pie". But maybe that sentence was right. Could you please explain to me what that (first) sentence means?
The preposition for is probably used to show the purpose. for (#8) -used to show purpose or function Maybe, a similar sentence would be - I'll go to a garden for a jog. If you go a to restaurant for something, the most common word that could be used there is some dish, isn't it? to eat pie surely makes better sense but this one could be an informal or formal way of speech. Let natives write their views.
1
The preposition for is probably used to show the purpose or function
Who should pursue a Ph.D degree?
I am asking myself the question "Should I do PhD or should I leave academia and go for an industrial career?" My life-goal is being a professor. And I love to do research. PhD is surely a bite that not everyone can chew. But I wonder who can chew it? I never was good at tests and exams. My BSc. GPA was 2.84/4.00 but finished my MSc. with 3.50/4.00 However, currently I am working on a conference paper and I feel like even that is too much for me. It has been nearly 3 months and still, the paper draft is to be improved (not the wording but the content). I am surely a hard-worker but not always. Sometimes, I let go of my work and absorbed in other stuff (composing, amateur radio etc). If this period is too wide, I have to spend double effort to warm-up and remember where I left. I don't know how things work in PhD. It usually is 5-6 years. It is the one of two most-challenging milestones in academic career (the other is getting the title Assoc. Prof). Should I completely be a "nerd" and work on my thesis systematically (something I could never make in my entire life) or working periodically but with extra effort is still sufficient? So, here's my question: If I say "I'm considering to do PhD" and ask your advice, what would you ask me? What kind of skills/characteristics do you look for a potential academician? I know it is way too late for me to ask this kind of question, as a person who almost finished his master's degree. But better lose the saddle than the horse.
You sound a lot like me when I was thinking about doing a PhD, albeit you aim to be a professor, and while I like the idea I'm not so fussed about the administrative side of being in a university. If you have a tendency to concentrate on whatever is the most interesting thing in front of you, then I would very strongly advise proceeding if and only if you find a good, hands-on supervisor. Ask their previous doctoral students how often they met with them in the first few years - some supervisors will see you once a month or so, others I have heard meet their students individually or collectively several times a week. In the UK, PhDs are usually 3 years. And the rough schedule is that for the first year you look at one or more problems, trying to understand how you might make some progress. In the second year, you make some small advance on one project and try in vain to develop the project into a more concrete thesis. In the third year you accept that your small advance was all you are going to get, and write it up. The slow pace of progress in the second year commonly causes distress or apathy. In order to complete such a project, you either need to be personally very disciplined or be part of a team (you, your supervisor, perhaps some peers) that can keep you honest - remember that rubber-ducking is a vital part of academic work; most academics in the UK will congregate in the department kitchen once or twice a day just to talk to other academics, because often just explaining yourself gets you closer to a solution. Similarly, you need people to ask you where you've got to so that you don't just disappear off for a month because you're faced with something annoying and your symphony suddenly seems fascinating. I struggled with this; my supervisor was hands-off, my peers were in very different fields (I was a theorist among experimentalists for a start) and I didn't really understand my own character enough to see what was happening. One of my peers had a supervisor who used to take students through rigorous textbooks, and expect them to grasp whole chapters to be quizzed on - the sound of it terrified me, but in retrospect the foundations are well worth laying. Instead I often disappeared down dead-ends because I was unaware of entire fields of research, and just didn't have the terminology or context to find them. So, in sum, you have some well-placed concerns, but the answer is not just whether you are capable of a PhD but whether you are in the context of your supervisor, peers and department.
1
In the UK, PhDs are usually 3 years - but not in the context of your supervisor, peers and department
Instrinsic definition of concave and convex polyhedron
Is it possible to distinguish a concave polyhedron from a convex one by mesurements made only on its surface, without a reference to the 3d space around it?
No. Consider (a) a pyramid atop a cube (convex), and (b) a cube with a pyramidal piece cut out of one face (not convex). As intrinsic surfaces, these are isometric.
1
Consider a pyramid atop a cube (convex)
Another instructor is pushing me out of the classroom right after my class ends
I am a graduate student in math in my final year, and for several years have been teaching at my department as a lecturer. This semester, in the same lecture hall there is another lecture that starts 20 minutes after my class ends. It's taught by another instructor from my department. I usually have many students coming to office hours and there are also students asking questions immediately after lecture. Due to other activities, I cannot have office hours right after the lecture this semester and can only stay for about 15 minutes to answer questions. Many times in the past I had a similar situation and never had any issues with it. This semester the instructor who is teaching right after often arrives 20-15 minutes before her class starts and tells me immediately that I have to go with my students somewhere else. I make sure to leave the blackboard clean and take all my stuff away from the instructor's desk before she arrives, but I do believe that I have a right to stay in the classroom after my lecture for at least 5-10 minutes. There is no vacant classroom around, and I don't have time to go with students to my office, which is in a different building. Last time the instructor told me in front of my students that I don't understand "simple things" and that I am "playing games". When I was talking to one of my students, she stood very close to us and clearly demonstrated that she wanted us out. I tried to explain her that I couldn't go anywhere else due to my time constraints, but she didn't want to listen to me. I really don't understand what "simple" things she meant and what "games" I am playing. We leave the board clean. She doesn't need to set up a projector. She can still talk to her students before her class starts, if she wants to (even though it seems like her students don't ask her any questions before their class). So, I don't see how I cause any disruption. I had met this woman many times before this semester, but we never talked. I didn't see her talking to other instructors/students much, and she seems to be quite reserved and a bit neurotic. She doesn't want to have any conversation with me regarding the issue. I felt really offended after last class when she said those things to me in front of my students. What would you do in my case? Added later: There are no official rules regarding classroom occupancy between classes. Instructors are supposed to use common sense and be reasonable. For me using 50% of the break time seems reasonable to answer questions after lecture seems reasonable. I agree that for some people it may not. I don't block the entrance to the classroom. A few students from the next class who come earlier always go ahead and take their seats as soon as my students start leaving the room. I also had one of the students from the next class listening to my explanation to one of those after-class questions and asking me further questions before their class (which is the same class as I am teaching, just a different section). Maybe the instructor got jealous, I don't know. The entrance to the classroom is from its front (not back), so I do stay in the front. But it is a big lecture hall, and there is a plenty of space in front of the room (the board itself consists of 8 huge panels). Also, during my career as a grad.student who is also teaching for the department, I have had several observations from experienced professors who are considered to be great teachers at the department and are in charge of undergraduate teaching policy. In my evaluations the fact that there are always several students approaching me with questions after class considered as very positive, meaning that students find me approachable. Thank you everyone for answers.
I think the logic behind the post is quite confusing. You should tell your students directly that discussion can only happen during office hour, and mention that there is another class afterwards. And you can extend your office hour (in a different day, say) by some period of time or move it if you wish, this can always be discussed with department secretary. You suggested that: Many times in the past I had a similar situation and never had any issues with it. as well as In my evaluations the fact that there are always several students approaching me with questions after class considered as very positive, meaning that students find me approachable. and many other reasons claiming your behavior is tolerable and okay by your standards. But these justifications is simply not related to the fact that she finds it uncomfortable because you did not end up the class on time. Since you are aware of that, you should do something concrete to resolve this issue. For example you can cover more background in the lecture time available, and encourage students to come to your office hour for longer 1-1 discussions. My impression for after class discussions is totally opposite to yours; the fact students coming after you after class usually means you did not explain the material well enough during class or unclear during the grading process. Your course should be in the format like "Calculus III, 2:00-3:00pm, Room 31A, Darwin building". If the description did not mention an extra 15 minutes for afterclass discussion, then it means you do not have it. As what the other instructor does when she comes to your classroom is totally irrelevant. In my experience a student (not even an instructor or dept chair) can knock at your classroom door and friendly to ask you get out without giving any specific reasons. They might need the room for group projects or whatever. The fact you are late should be compelling evidence against you already. You also suggested that Last time the instructor told me in front of my students that I don't understand "simple things" and that I am "playing games". When I was talking to one of my students, she stood very close to us and clearly demonstrated that she wanted us out. I tried to explain her that I couldn't go anywhere else due to my time constraints, but she didn't want to listen to me. I really don't understand what "simple" things she meant and what "games" I am playing. I think you should think from her point of view, that your class should end up on time. The fact that you have time constraints, etc is irrelevant to her. If you think these are legitimate reasons to justify your behavior, to her you were simply being immature and using poor excuses. You may have your disagreement and ask for support from senior faculty in the department as Prof. Clark suggested, but her position is very clear. If she demonstrated you need to get out, then you need to get out even if this is the final exam. Unless you have a student with disability that needs extra time, etc I think there is no point arguing further on this issue.
1
Is your behavior tolerable and okay by standards?
Questions on mass-production soldering
Wave soldering I am trying to understand how wave soldering works. Unfortunately the Wikipedia article has has left me unsure about the process: Is the entire board with its components quasi-immersed in liquid solder while it passes through the wave? (If not, the following question probably make no sense.) If the board cuts into the wave, how is the wave maintained? Why does this not leave superflous solder residue on the board? Double-Sided SMT soldering How are double sided boards with SMT components soldered? How is it prevented that the components on one side fall off?
wave soldering For wave soldering the PCB passes over a bath of molten solder where the solder is pushed up so that it strikes along the bottom side of the PCB. You'll need a solder resist mask to prevent to have solder over all the copper. Note that also SMDs can be wave soldered, but then the orientation of the parts is important. Some parts have to be placed perpendicular to the wave direction. Fine pitch parts like 0.4 mm QFPs can't be wave soldered because all the pins will be shorted, but QFPs with a higher pitch can. They need "solder thieves", which are solder pads at the end of a row of pins to gather residual solder. A QFP may have to be placed at a 45° angle, and will have the solder thieves at one of the corners: The wave direction is important during PCB layout and panelization, and the production engineer should get clear instructions on it. reflow soldering SMDs for two-sided placement are glued on one side. After solder paste is applied with a stencil a glue dot machine places glue dots for the parts (at an incredible rate of more than 10 per second). Then the parts are placed, the panel is flipped over, and the other side gets solder paste and component placement.
0.777778
Wave soldering SMDs can't be wave soldered
Dimension of a quotient ring
What is the Krull dimension of $B=A[x,y,z]/\langle xy + 1, z + 1\rangle$, given $A$ is a Noetherian commutative ring?
Your first ring $B$ is just $A[x^{\pm1}]$, the ring of Laurent polynomials with coefficients in $A$, which is the localization of $A[x]$ at the powers of $x$. It follows from this that $\dim B\leq\dim A+1$. On the other hand, if $\def\p{\mathfrak p}\p$ is a prime in $A$ then $\mathfrak pB$ is a prime of $B$, easily seen to be the set of Laurent polynomials with coefficients in $\p$. If $\p_0\subsetneq\cdots\subsetneq\p_r$ is a chain of prime ideals in $A$, then $\p_0B\subsetneq\cdots\subsetneq\p_rB\subsetneq \p_rB+(x-1)B$ is a chain of prime ideals of $B$ one prime longer. Conclusion: $\dim A[x^{\pm1}]=\dim A+1$.
0.777778
ring of Laurent polynomials with coefficients in $p$
Etiquette for closing your own questions
For all of my questions I have received great answers. I have implemented the answers in code and they work. I now feel compelled to close the questions because I don't believe there are more or better answers out there. Should you close your questions that you feel have been answered sufficiently? Would allowing more people to answer dilute the existing, good answers? Return to FAQ index
I agree with Euro except for this. The answer will truly not change (for example, because it's linked to legacy technology that won't ever be updated) On occasion, products like this go opensource and thus the development keeps going so even if it's legacy, you may want to keep it open just it case. Besides all the new stuff will go to the bottom of the 'vote sorted' list anyway.
1
Euro is a 'vote sorted' solution to opensource
MySQL does not work fine with UTF-8
I added this rows to my-default file, restarted server, recreated schema, table and data in the tables, but my cyrillic data still looks like '????'. Now I have a new user and such config, but utf8 still does not work. [mysqld] init-connect=SET NAMES utf8 character-set-server=utf8 character-sets-dir=/usr/share/mysql/charsets default-character-set=utf8 [mysql] character-sets-dir=/usr/share/mysql/charsets default-character-set=utf8 [mysqladmin] character-sets-dir=/usr/share/mysql/charsets default-character-set=utf8 [mysqlcheck] character-sets-dir=/usr/share/mysql/charsets default-character-set=utf8 [mysqldump] character-sets-dir=/usr/share/mysql/charsets default-character-set=utf8 [mysqlimport] character-sets-dir=/usr/share/mysql/charsets default-character-set=utf8 [mysqlshow] character-sets-dir=/usr/share/mysql/charsets default-character-set=utf8 #end
This will probably do the trick. You need to perform a small query directly before you do INSERT or UPDATE. In my db-class it looks like this, which is to be adapted to your needs. $charset needs to be "utf8" $db->query('SET CHARACTER SET "' . $charset . '";'); $result = $db->query($query); I call the function like this $result = $ddlab->db->db($sql,'utf8'); Good luck !
0.833333
INSERT or UPDATE a small query
6A Current Source
Hi I am designing a 6A current source. I know how to design a current source I am just looking for suggested materials that can handle the full 6A. The op amps and transistors that I have now are more on the milliamp side so I just am looking for something beefier.
Greg hit the nail on the head. If you go to digikey, you can use their filtering tools to get what you want. Start with "transistor" followed by NPN or PNP, depending on what you want. Then filter on the current you need. I'm sure you'll find some options. If you're looking for something super simple and don't care about power loss, look for a transistor in a TO-3 package along with a good size heat sink and hardware for mounting. A SMPS is a good idea if it's in your price range. While these are great, they can be a pain and/or very expensive for the hobbyist. Sometimes digikey will also sell assembled demo boards, which can be a good compromise between cost and efficiency.
0.888889
Using digikey filters to get what you want.
display error message under payment method if "COD " is not available
i am using this following code to restrict the "cash on delivery" payment method based on pin code. /app/code/core/Mage/Payment/Model/Method/Cashondelivery.php Please check code here now if cash on delivery payment method is not visible means i want to display "cod is not available" under payment method. please help me to find solution.
You referral link can only remove the code from payment list at check payment step.If you set error message at session (Mage::getSingleton('core/session')->addError(Mage::helper('payment')->__('Code is not avaliable.'))) on function isAvaliable it can be shown on next step. According my concept it will be good idea to do something at methods.phtml where all payment method has been listing during the checkout. <?php $isCodeAvalibale=0; foreach ($this->getMethods() as $_method): $_code = $_method->getCode(); if($_code =='cashondelivery'): $isCodeAvalibale=1; endif; endforeach; if($isCodeAvalibale==0): echo Mage::helper('payment')->__('Code is not avaliable.')); endif; ?>
0.888889
How to remove code from payment list at check payment step?
Return value in bash script
I am working with a bash script and I want to execute a function to print a return value: function fun1(){ return 34 } function fun2(){ local res=$(fun1) echo $res } when I execute func2 it does not print "34". Can anybody help me?
Functions in Bash are not functions like in other language; they're actually commands. So functions are used as if they were binaries or scripts fetched from your path. From the perspective of your program logic there should be really no difference. Shell commands are connected by pipes (aka streams), and not fundamental or user-defined data types, as in "real" programming languages. There is no such thing like a return value for a command, maybe mostly because there's no real way to declare it. It could occur on the man-page, or the --help output of the command, but both are only human-readable and hence are written to the wind. When a command wants to get input it reads it from its input stream, or the argument list. In both cases text strings have to be parsed. When a command wants to return something it has to echo it to its output stream. Another oftenly practiced way is to store the return value in dedicated, global variables. Writing to the output stream is clearer and more flexible, because it can take also binary data. For example, you can return a BLOB easily: encrypt() { gpg -c -o- $1 # encrypt data in filename to stdout (asks for a passphrase) } encrypt public.dat > private.dat # write function result to file As others have written in this thread, the caller can also use command substitution $() to capture the output. Parallely, the function would "return" the exit code of gpg (GnuPG). Think of the exit code as a bonus that other languages don't have, or, depending on your temperament, as a "Schmutzeffekt" of shell functions. This status is, by convention, 0 on success or an integer in the range 1-255 for something else. To make this clear: return (like exit) can only take a value from 0-255, and values other than 0 are not necessarily errors, as is often asserted. When you don't provide an explicit value with return the status is taken from the last command in a Bash statement/function/command and so forth. So there is always a status, and return is just an easy way to provide it.
1
Functions in Bash are not functions like in other languages .
Does one need a visa to visit Antarctica?
What is the status of Antarctica in terms of visa regulation? Does one need a visa to visit Antarctica? If so, which country does issue such a visa?
From http://www.lonelyplanet.com/antarctica/practical-information/visas: No single government controls Antarctica, so visitors do not need visas to go there. But with the ratification of the Antarctic Treaty’s Protocol on Environmental Protection in 1998, all visitors who are citizens of countries that are signatories of the Antarctic Treaty must have a permit to visit Antarctica. Cruise ship passengers are covered under the permits applied for by the cruise company. Yacht passengers and crew, and anyone visiting Antarctica by air, should check with their national government to make sure they have their paperwork in order. If you are uncertain about your status, check with your tour operator.
1
No government controls Antarctica, so visitors do not need visas to go there
native-activity sample project won't compile if I change file exteension to .cpp
I've compiled the native activity sample and it runs fine. When I switch from main.c to main.cpp I get a compiler error $ /cygdrive/c/android-ndk-r7/ndk-build make: *** No rule to make target `jni/main.c', needed by `obj/local/armeabi/objs/native-activity/main.o'. Stop. I changed the make file to main.cpp. I'm new to Android and Linux. I'm using Cygwin.
Check your Android.mk file looking for main.c and change it to main.cpp LOCAL_SRC_FILES := main.c must be: LOCAL_SRC_FILES := main.cpp
0.777778
LOCAL_SRC_FILES := main.c
In Android, how do I position an image on top of another to look like a badge?
Please see below: I tried using Absolute layout, but that's deprecated. I appreciate your help, thanks.
RelativeLayout is a great option. <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" > <ImageView android:id="@+id/icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="5dp" android:scaleType="centerCrop" android:src="@drawable/iconImage" /> <ImageView android:id="@+id/badge" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignRight="@+id/icon" android:layout_alignTop="@+id/icon" android:src="@drawable/badge" /> If you actually want a badge with a dynamic number/text, then you can make the second ImageView a TextView (or a ViewGroup such as LinearLayout or RelativeLayout) and give it a background drawable and set the text to what you want.
1
RelativeLayout xmlns
Critique Requested on PHP Pagination Class
I did most of my PHP coding back with PHP 4, and among the projects I did was a popular pagination class. I've been meaning to bring it up to date with PHP 5 and OOP practices. I've also been working on updating my database code, using PDO over the deprecated mysql* functions. What I'd like from you is your input and feedback about my updates. Pagination Class class Paginator{ public $items_per_page; public $total_items; public $current_page; public $num_pages; public $mid_range; public $limit; public $limit_start; public $limit_end; public $return; public $querystring; public $ipp_array; public $get_ipp; public $get_page; public function __construct($total,$mid_range=7,$ipp_array=array(10,25,50,100,'All')) { $this->total_items = $total; $this->mid_range = $mid_range; $this->ipp_array = $ipp_array; $this->items_per_page = (isset($_GET['ipp'])) ? $_GET['ipp'] : $this->ipp_array[0]; $this->get_ipp = isset($_GET['ipp']) ? $_GET['ipp'] : NULL; $this->get_page = isset($_GET['page']) ? (int) $_GET['ipp'] : 1; $this->default_ipp = $this->ipp_array[0]; if($this->get_ipp == 'All') { $this->num_pages = 1; } else { if(!is_numeric($this->items_per_page) OR $this->items_per_page <= 0) $this->items_per_page = $this->ipp_array[0]; $this->num_pages = ceil($this->total_items/$this->items_per_page); } $this->current_page = (isset($_GET['page'])) ? (int) $_GET['page'] : 1 ; // must be numeric > 0 if($_GET) { $args = explode("&",$_SERVER['QUERY_STRING']); foreach($args as $arg) { $keyval = explode("=",$arg); if($keyval[0] != "page" And $keyval[0] != "ipp") $this->querystring .= "&" . $arg; } } if($_POST) { foreach($_POST as $key=>$val) { if($key != "page" And $key != "ipp") $this->querystring .= "&$key=$val"; } } if($this->num_pages > 10) { $this->return = ($this->current_page > 1 And $this->total_items >= 10) ? "<a class=\"paginate\" href=\"$_SERVER[PHP_SELF]?page=".($this->current_page-1)."&ipp=$this->items_per_page$this->querystring\">Previous</a> ":"<span class=\"inactive\" href=\"#\">Previous</span> "; $this->start_range = $this->current_page - floor($this->mid_range/2); $this->end_range = $this->current_page + floor($this->mid_range/2); if($this->start_range <= 0) { $this->end_range += abs($this->start_range)+1; $this->start_range = 1; } if($this->end_range > $this->num_pages) { $this->start_range -= $this->end_range-$this->num_pages; $this->end_range = $this->num_pages; } $this->range = range($this->start_range,$this->end_range); for($i=1;$i<=$this->num_pages;$i++) { if($this->range[0] > 2 And $i == $this->range[0]) $this->return .= " ... "; // loop through all pages. if first, last, or in range, display if($i==1 Or $i==$this->num_pages Or in_array($i,$this->range)) { $this->return .= ($i == $this->current_page And $this->get_page != 'All') ? "<a title=\"Go to page $i of $this->num_pages\" class=\"current\" href=\"#\">$i</a> \n":"<a class=\"paginate\" title=\"Go to page $i of $this->num_pages\" href=\"$_SERVER[PHP_SELF]?page=$i&ipp=$this->items_per_page$this->querystring\">$i</a> \n"; } if($this->range[$this->mid_range-1] < $this->num_pages-1 And $i == $this->range[$this->mid_range-1]) $this->return .= " ... "; } $this->return .= (($this->current_page < $this->num_pages And $this->total_items >= 10) And ($this->get_page != 'All') And $this->current_page > 0) ? "<a class=\"paginate\" href=\"$_SERVER[PHP_SELF]?page=".($this->current_page+1)."&ipp=$this->items_per_page$this->querystring\">Next</a>\n":"<span class=\"inactive\" href=\"#\">Next</span>\n"; $this->return .= ($this->get_page == 'All') ? "<a class=\"current\" style=\"margin-left:10px\" href=\"#\">All</a> \n":"<a class=\"paginate\" style=\"margin-left:10px\" href=\"$_SERVER[PHP_SELF]?page=1&ipp=All$this->querystring\">All</a> \n"; } else { for($i=1;$i<=$this->num_pages;$i++) { $this->return .= ($i == $this->current_page) ? "<a class=\"current\" href=\"#\">$i</a> ":"<a class=\"paginate\" href=\"$_SERVER[PHP_SELF]?page=$i&ipp=$this->items_per_page$this->querystring\">$i</a> "; } $this->return .= "<a class=\"paginate\" href=\"$_SERVER[PHP_SELF]?page=1&ipp=All$this->querystring\">All</a> \n"; } $this->return = str_replace('&','&',$this->return); $this->limit_start = ($this->current_page <= 0) ? 0:($this->current_page-1) * $this->items_per_page; if($this->current_page <= 0) $this->items_per_page = 0; $this->limit_end = ($this->get_ipp == 'All') ? (int) $this->total_items: (int) $this->items_per_page; } public function display_items_per_page() { $items = NULL; natsort($this->ipp_array); // This sorts the drop down menu options array in numeric order (with 'all' last after the default value is picked up from the first slot if(is_null($this->get_ipp)) $this->items_per_page = $this->ipp_array[0]; foreach($this->ipp_array as $ipp_opt) $items .= ($ipp_opt == $this->items_per_page) ? "<option selected value=\"$ipp_opt\">$ipp_opt</option>\n":"<option value=\"$ipp_opt\">$ipp_opt</option>\n"; return "<span class=\"paginate\">Items per page:</span><select class=\"paginate\" onchange=\"window.location='$_SERVER[PHP_SELF]?page=1&ipp='+this[this.selectedIndex].value+'$this->querystring';return false\">$items</select>\n"; } public function display_jump_menu() { $option=NULL; for($i=1;$i<=$this->num_pages;$i++) { $option .= ($i==$this->current_page) ? "<option value=\"$i\" selected>$i</option>\n":"<option value=\"$i\">$i</option>\n"; } return "<span class=\"paginate\">Page:</span><select class=\"paginate\" onchange=\"window.location='$_SERVER[PHP_SELF]?page='+this[this.selectedIndex].value+'&ipp=$this->items_per_page$this->querystring';return false\">$option</select>\n"; } public function display_pages() { return $this->return; } } Sample Instantiation <?php include('paginator.class.php'); try { $conn = new PDO('mysql:host=localhost;dbname=test', 'user', 'pass'); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $num_rows = $conn->query('SELECT COUNT(*) FROM City')->fetchColumn(); $pages = new Paginator($num_rows,9,array(15,3,6,9,12,25,50,100,250,'All')); echo $pages->display_pages(); echo "<span class=\"\">".$pages->display_jump_menu().$pages->display_items_per_page()."</span>"; $stmt = $conn->prepare('SELECT City.Name,City.Population,Country.Name,Country.Continent,Country.Region FROM City INNER JOIN Country ON City.CountryCode = Country.Code ORDER BY City.Name ASC LIMIT :start,:end'); $stmt->bindParam(':start', $pages->limit_start, PDO::PARAM_INT); $stmt->bindParam(':end', $pages->limit_end, PDO::PARAM_INT); $stmt->execute(); $result = $stmt->fetchAll(); echo "<table><tr><th>City</th><th>Population</th><th>Country</th><th>Continent</th><th>Region</th></tr>\n"; foreach($result as $row) { echo "<tr><td>$row[0]</td><td>$row[1]</td><td>$row[2]</td><td>$row[3]</td><td>$row[4]</td></tr>\n"; } echo "</table>\n"; echo $pages->display_pages(); echo "<p class=\"paginate\">Page: $pages->current_page of $pages->num_pages</p>\n"; echo "<p class=\"paginate\">SELECT * FROM table LIMIT $pages->limit_start,$pages->limit_end (retrieve records $pages->limit_start-".($pages->limit_start+$pages->limit_end)." from table - $pages->total_items item total / $pages->items_per_page items per page)"; } catch(PDOException $e) { echo 'ERROR: ' . $e->getMessage(); } ?> Live Demos Demo 1 Demo 2 Areas of Concern I noticed in my query that if I try to execute the SQL with: $stmt->execute( array(':start'=>$pages->limit_start,':end'=>$pages->limit_end) ); I get an error unless I also use $conn->setAttribute(PDO::ATTR_EMULATE_PREPARES, FALSE);. However I can get around that if I use bindParam instead: $stmt->bindParam(':start', $pages->limit_start, PDO::PARAM_INT); $stmt->bindParam(':end', $pages->limit_end, PDO::PARAM_INT); $stmt->execute(); Should I be using $conn->setAttribute(PDO::ATTR_EMULATE_PREPARES, FALSE); or the separate bindParam calls?bindParam seems like a decent solution, whereas using ATTR_EMULATE_PREPARESseems a little hacky. Within the class, am I setting the visibility (public, private, protected) of my parameters and methods properly? If you see anything that jumps out at you like "what in the world was he thinking?", you can assume that I was dealing with something I hadn't done before. Any tips or suggestions overall would be appreciated.
Okay, I’m going to list anything and everything that came in my mind while reading your code. Start documenting your code for better maintainability Validate every and any user input Use proper camelCase notation for property and method names Separate your code into more methods (especially in __construct) Keep everything protected unless you have a good reason to keep it private or expose it with public Use single or double quotes throughout your code, but don’t mix it (consistency) Enclose your variables in {} if you embed them in strings Use single quotes for your HTML if you use double quotes for creating the string (prevent escaping mistakes) Use namespace’s (even if you don’t need them now) An example class: <?php /*! * My license */ namespace \Fleshgrinder; /** * Example class for Code Review at Stack Exchange. * * @author Fleshgrinder <[email protected]> */ class ExampleClass { /** * The example class's example property. * * @var mixed */ protected $camelCasePropertyName; /** * Instantiate new example class. * * @var string $param1 * Example parameter 1. * @var string $param2 [optional] * Optional example parameter 2. * @throws \RuntimeException */ public function __construct($param1, $param2 = "foo") { if ($param2 == "foo") { $this->camelCasePropertyName = $this->camelCaseMethodName(); } elseif ($param2 == "bar") { throw new \RuntimeException("No bar!"); } else { $this->camelCasePropertyName = $param1; } } /** * Get <var>$str</var> wrapped in <code>span</code> HTML element. * * @param string $str * The string to wrap. * @return string * The wrapped string. */ protected function camelCaseMethodName($str) { return "<span class='foo'>{$str}</span>"; } } Example regarding creation of methods that help to understand the code better (see comments): <?php // No comments to keep it short, but always write comments! class Database extends FictivePHPDBClass { public function __construct($user, $password, $host, $port, $database) { $this->setUser($user); $this->setPassword($password); $this->setHostname($host); $this->setPort($port); $this->connect(); $this->selectDatabase($database); } protected function setUser($user) { if (empty($user) || !is_string($user)) { throw new \IllegalArgumentException("Username cannot be empty."); } $this->user = $user; } protected function setPassword($password) {} protected function setHostname($hostname) {} protected function setPort($port) {} protected function connect() { $phpDB = parent::connect($this->user, $this->password, $this->hostname, $this->port); if ($phpDB->errorCount > 0) { throw new \Fleshgrinder\Exception\DatabaseException("Couldn't connect to {$this->hostname} database."); } $this->connection = $phpDB; } protected function selectDatabase($database) { if (empty($database) || !is_string($database)) { throw new \IllegalArgumentException("Bla bla ..."); } if (!($this->connection instanceof \FictivePHPDBClass)) { throw new \LogicException("Bla bla ..."); } $this->connection->selectDatabase($database); if ($this->connection->errorCount > 0) { throw new \Fleshgrinder\Exception\DatabaseException("Bla bla ..."); } } } That's stuff you often see in OO PHP code, wrapping some other classes and trying to make some real OO code out of them. But what I really want to show you is the fact that the methods are short, easy to understand because of that and that you already know what each method does only by reading their name.
0.888889
OO PHP code is short, easy to understand
Dealing with digital circuits and their associated switching speed?
When designing a digital one-minute counting circuit I came across a difficult problem. Basically, I designed the circuit to drive the (normally HIGH) clock of the 10s slot low if the 1s slot's current state was 9 (actually, just if the first and last bits are HIGH -> 1001) The devices I am using are positive edge, so when the 1s slot returns to zero the condition is no longer satisfied - therefore the clock returns to a HIGH state and increments the 10s slot. The problem is that I was getting double clock problems(7->8 transition and the designed clock mechanism). It turns out that there was just enough delay in the switching between 7 -> 8 (0111 -> 1000) that the first/last bit HIGH condition is satisfied: i.e., some combination occurs in the transition period to register a logical HIGH at the output 1001 1011 1101 1111 The temporary solution to the problem I came up with was to actually keep the clock for the 10s slot LOW until the condition where the 1s slot equals 0 (0000) is satisfied(So, essentially clock WHEN we get to the state as opposed to before). However, this solution requires too many gates (a 4-input NOR minimum). My previous design was actually fed from another part in the design that is already present, so it didn't require any additional circuitry. Any ideas on a more efficient solution? The IC's used in this design are the 74LS47 (7Segment decoder) and the 74LS163 (4-bit binary counter). The pull-down resistor inclusion is a mechanism to set the counters to 00 and hold while the switch is closed.
If you're having problems with switching speed on a slow switching circuit, the simplest solution is to slow it down. I would suggest using your original idea, but add a series RC lowpass filter (series R, then shunt C to GND) right before the clock input pin with a time constant (R times C) on the order of a milisecond or so. This should filter out any very short runt pulses that are being generated. If that doesn't work, crank up the time constant to 10 ms or even 100 ms. Too high and there will be a noticable delay, though.
0.833333
How to slow down a slow circuit
How do you output the filename in find command while using -exec?
I use the following line to find all sub-directories of the PWD and run svnadmin verify on each directory (I already know that they're Subversion repositories) find ./* -maxdepth 0 -exec svnadmin verify {} \; This works well, other than the fact that the output looks like this: * Verifying repository metadata ... * Verifying metadata at revision 1 ... * Verifying metadata at revision 2 ... * Verifying metadata at revision 4 ... * Verifying metadata at revision 5 ... * Verifying metadata at revision 6 ... * Verifying metadata at revision 9 ... * Verifying metadata at revision 10 ... * Verifying metadata at revision 12 ... * Verifying metadata at revision 14 ... * Verifying metadata at revision 15 ... * Verifying metadata at revision 18 ... * Verifying metadata at revision 20 ... * Verifying metadata at revision 22 ... * Verified revision 0. * Verified revision 1. * Verified revision 2. * Verified revision 3. * Verified revision 4. * Verified revision 5. * Verified revision 6. * Verified revision 7. * Verified revision 8. * Verified revision 9. * Verified revision 10. * Verified revision 11. * Verified revision 12. * Verified revision 13. * Verified revision 14. * Verified revision 15. * Verified revision 16. * Verified revision 17. * Verified revision 18. * Verified revision 19. * Verified revision 20. * Verified revision 21. * Verified revision 22. * Verified revision 23. * Verified revision 0. * Verifying repository metadata ... * Verifying metadata at revision 4 ... * Verifying metadata at revision 5 ... * Verifying metadata at revision 6 ... * Verifying metadata at revision 7 ... * Verifying metadata at revision 9 ... * Verified revision 0. * Verified revision 1. * Verified revision 2. * Verified revision 3. * Verified revision 4. * Verified revision 5. * Verified revision 6. * Verified revision 7. * Verified revision 8. * Verified revision 9. I'd really like find to print the filename before executing the svnadmin verify command, to make logging easier. I've tried to squeeze a little ls in there but bodged it up, how should I do this (preferably simply)?
If you don't want to recurse, there's no point in using find. It is far simpler to do it in the shell directly: for d in */; do echo "$d"; svnadmin verify "$d"; done The for d in */ will find all directories (the */ ensures only directories and no files are found); the echo "$d" will print the directory's name; the svnadmin verify "$d" will check the directory. This can be run either directly from the command line or from within a script with no change in format.
0.666667
Use find to recurse
How to set the ID3 Year on an mp3?
I'm creating my own MP3s with an online service, and I'm setting the "Year" attribute in the ID3v tag, but I'm having trouble getting it to work with both Nautilis and Rhythmbox. In Nautilis, when I click on "Properties" and select the "Audio" tab, it shows "Year: Unknown". In Rhythmbox, it does the same when selecting the file "Properties" and says it's "Unknown". When I use EasyTag though, it works fine and shows the Year field set properly. I've also tried using eyeD3 to try both ID3 v1.x, v2.3 and v2.4, but they all show "Unknown". One other observation was when I changed the year from "Unknown" to "2013" in Rhythmbox, and then closed Rhythmbox, Nautilis still showed "Unknown" for the year. Is there something more to setting the Year field on ID3 tags that I'm missing, or is this just some subtlety between how different programs interpret the tags?
Try the KDE MP3 ID3 tag editor. With the KDE MP3 ID3 tag editor, you can edit tags of multiple files, e.g. the artist, album, year and genre of all files of an album typically have the same values and can be set together.UA To install, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below: sudo apt-get install kid3 Or just click KDE MP3 ID3 tag editor
0.777778
KDE MP3 ID3 tag editor
Weren't there originally going to be nine Star Wars films?
I seem to remember reading that there were going to be three trilogies originally in Star Wars, i.e. they would add episodes 7 - 9. Was that ever the case? What happened to that plan? Update: looks like that original plan might be back after all!
Some fantastic answers here, but I thought I'd just add a little more detail, that I don't think has been included in any of the others. Firstly, as has already been said, STAR WARS was only ever one film. Vader wasn't Luke's father, Leia wasn't Luke's sister, no further films were planned. Even the original 1977 opening crawl looked like this: That's right. No "Episode IV : A New Hope". It's difficult to remember now, but STAR WARS was HUGE. I mean TITANIC big. Adjusted for inflation it's actually still the second highest grossing movie of all-time (AVATAR is only number 14). So Lucas and his friends set to work on expanding the universe, much like the Wachowski's did with THE MATRIX. Lucas's "second in command", from the beginning of his Hollywood career, was a man called Gary Kurtz. Kurtz produced Lucas's first "Hollywood" feature, AMERICAN GRAFITTI, which in itself was a big success (currently 44 on the highest grossing films of all time list), STAR WARS, and THE EMPIRE STRIKES BACK. Lucas worked with Kurtz (and many others) on producing a rough outlines for approximately 8 more movies, making 9 in total. The EMPIRE STRIKES BACK was made according to this plan. After the success of RAIDERS OF THE LOST ARK (the project Lucas put together with Steven Spielberg), Lucas decided that cinema-goers wanted more of a rollercoaster action movie, and so changed the 9 movie plan. Kurtz and Lucas were at logger-heads over a lot of things. Some of them technical, some of them artistic. According to Kurtz they agreed they should go their separate ways before RETURN OF THE JEDI began, with Kurtz taking the opportunity to work with Jim Henson on THE DARK CRYSTAL. However, since Kurtz was so intricately involved in the evolution of STAR WARS into something bigger, he's a great source. According to him, the outlines for the nine movies went like something this: EPISODE 1: Was to focus on the origins of the Jedi Knights and how they are initiated and trained EPISODE 2: Introduction and development of Obi-Wan Kenobi EPISODE 3: Introduction and life of Vader EPISODE 4: There were seven different drafts of the film. At one point, they pursued buying the rights to Hidden Fortress because of the strong similarities. At one point, Luke was a female, Han was Luke's brother, Luke's father was the one in prison (interesting point for some debates) and the film featured 40 wookies EPISODE 5: Once written, the screenplay of Empire is almost exactly what is seen on screen. The only cut scenes were those involving wampas in the rebel base (cut because of time and unsolved technical glitches) and about two minutes of Luke/Yoda Jedi training with no real dialog. EPISODE 6: Leia was to be elected "Queen of her people" leaving her isolated. Han was to die. Luke confronted Vader and went on with his life alone. Leia was not to be Luke's sister. EPISODE 7: Third trilogy was to focus on Luke's life as a Jedi, with very few details planned out. EPISODE 8: Luke's sister (not Leia) appears from another part of the galaxy. EPISODE 9: First appearance of the Emperor. (I believe he went into greater detail in an issue of SFX magazine, but I've been unable to find a copy of the text on the internet... I bet it's there somewhere!) There's also a great interview with Kurtz here, where he goes into a bit more detail: The one story thread [in Return of the Jedi] that got totally tossed out the window, which was really pretty important I think, was the one of Vader trying to convince Luke to join him to overthrow the Emperor. That together they had enough power that they could do that, and it wasn’t him saying I want to take over the world and be the evil leader, it was that transition. It was Vader saying, “I’m looking again at what I’ve done and where my life has gone and who I’ve served and, very much in the Samurai tradition, and saying if I can join forces with my son, who is just as strong as I am, that maybe we can make some amends.” So there was all of that going on in Jedi as well, that was supposed to go on. So the story was quite a bit more poignant and the ending was the coronation of Leia as the queen of what was left of her people, to take over the royal symbol. That meant she was then isolated from all of the rest and Luke went off then by himself. It was basically a kind of bittersweet ending. She’s not his sister that dropped in to wrap up everything neatly. His sister was someone else way over on the other side of the galaxy and she wasn’t going to show up until the next episode. Read more: http://www.filmthreat.com/interviews/8/#ixzz2Fcy0psgB
1
"Episode IV : A New Hope" was only ever one film .
How to remove Libre.fm from Rhythmbox?
As I do not use Libre.fm, I'd like to remove it from the sidepane in Rhythmbox (Ubuntu Precise). I did it some time ago on of my machines. But now I cannot recall how I did it. :-( I could not find a plugin to deactivate, or a package to uninstall.
Libre.fm is part of the LastFM plugin Choose Edit - plugins and click of the Last.fm plugin. You then will have the preferences button visible. From the popup-dialog you can hide/show both services.
1
Choose Edit - plugins and click of the LastFM plugin
How to find bible verses?
This is a question one of my Catechism students asked. We were playing a Bible based board game where if you don't know the answer you look it up in the Bible. That's pretty great, if you know how to find verses in the Bible. But, given a standard super thick, thin paged Bible with no tabs and characteristically ignoring the index page like one would expect an eighth grader might, what mnemonic and memorization devices do people use to find the relative position of certain books in the Bible? (I'd prefer Catholic answers using Catholic Bibles, but any wisdom is appreciated)
I learned this technique on Protestant Bibles but you could easily adapt it for any Bible. It works best if you have everyone use their own Bible so that they can see how the technique applies to the Bible they use most. Psalms is usually at the center of most Bibles. If you're looking for Psalms you try to open to the middle of the book. The New Testament tends to start around the last quarter of the Bible. So let's say you're looking for John 3:16. It's in the New Testament so it's in the last quarter of the Bible. It's a Gospel so it's at the front of that last quarter. Flip to about the last quarter of the book. If you land on John great. If you landed somewhere else is it before or after John? This also goes hand in hand with memorizing the order of the books which the best I can do is a song that I think I might still have somewhere on VHS but you can just hit up YouTube and find something your kids will like. Even more helpful is understanding the sections of the Bible. Law History Poetry & Wisdom Major Prophets Minor Prophets Gospels Pauline Epistles General Epistles Prophecy So from the example above, if the open the Bible to somewhere other than John it goes: What book are you on? Is it before or after John? Is it Old Testament or New? If it's old you move back. New could be either way. What section is it in? If it's a Gospel, which one? (in this case any one means move back slowly) If it's not at least one of the minor prophets then you're probably way too far ahead. Likewise if you landed in Revelation then you're too far back. (This actually happens because of maps and other stuff they cram into Bibles these days.) It plays out like a game of 20 questions. Every time you move you repeat the steps. I don't remember it taking long for us to pick this up but, the more time they spend using an actual Bible with no search aids, the faster they'll get it.
1
How to open to the middle of a book?
image processing
This is an assignment, i have put good effort since i am new to python programming: I am running the following function which takes in image and phrase (spaces will be removed so just text) as arguments, i have already been given all the import and preprocessing code, i just need to implement this function. I can only use getpixel, putpixel, load, and save. That is why coding this has been a hard task for me. def InsertoImage(srcImage, phrase): pix = srcImage.load() for index,value in enumerate(phrase): pix[10+index,15] = phrase[index] srcImage.save() pass This code is giving "system error" which says that "new style getargs format but argument is not tuple" Edit: C:\Users\Nave\Desktop\a1>a1_template.py lolmini.jpg Hi Traceback (most recent call last): File "C:\Users\Nave\Desktop\a1\a1_template.py", line 31, in <module> doLOLImage(srcImage, phrase) File "C:\Users\Nave\Desktop\a1\a1_template.py", line 23, in doLOLImage pix[10+index,15] = phrase[index] SystemError: new style getargs format but argument is not a tuple Edit: Ok Thanks, i understood and now posting code but i am getting error for the if statement not sure why the if statement is not working, here is full code sorry for not adding it entirely before: from future import division letters, numbers, and punctation are dictionaries mapping (uppercase) characters to Images representing that character NOTE: There is no space character stored! from imageproc import letters, numbers, punctuation, preProcess This is the function to implement def InserttoImage(srcImage, phrase): pix = srcImage.load() for index,value in enumerate(phrase): if value in letters: pix[10+index, 15] = letters[value] elif value in numbers: pix[10+index, 15] = numbers[value] elif value in punctuation: pix[10+index, 15] = punctuation[value] srcImage.save() pass This code is performed when this script is called from the command line via: 'python .py' if name == 'main': srcImage, phrase = preProcess() InserttoImage(srcImage, phrase) Thanks, letter, numbers, and punctuation are dictionaries which see the key element and open the image (font). But still there is an issue with pix[10+index, 15] as it is giving error: pix[10+index, 15] = letters[value] SystemError: new style getargs format but argument is not a tuple
Just try this: pix[10+index:15] = letters[value] Use ":" instead of ","
0.666667
Use ":" instead of ""
Skip duplicated files on copy
I am moving files from one folder to another destination1 to destination2 however if destination2 already has a copy of the file from destination1 I would like to simply skip and continue the copy process rather than overwriting which will take a longer process. I have already tried: FileSystem.CopyFile(destination1,destination2, true);which will overwrite the file. Is there anyway I could get some assistance on accomplishing this please.
You can use File.Exists method to check whether the file already exists: if(!File.Exists(destination2)) { // copy file }
0.888889
File.Exists (destination2))
Does the number of visits matters for SEO?
Considering I have a website and I have millions of direct views (entering directly by URL, not by any other URL) and that there is no links to this site anywhere else (or that this views don't generate any external link to the site), will these visits increase my positioning in search engines such as Google? Are search engines capable of measuring direct visits rather than links from other pages?
Search Engine may know about visits to orphaned (i.e. no inbound links) websites based on users who may have a toolbar installed that is reporting browsing activity back to the search engine. Whether this is used as a ranking signal is debatable. Also if you use a tool such as Google Analytics then Google in this case will certainly know a great deal about your website users. Again it's very unlikely that they will be using this as any basis to rank your site, which I think is at the crux of your question. Inbound links and good content pretty much cover 90% of the ranking outcome for any website. Nothing has changed there for years!
1
Inbound links and good content cover 90% of the ranking outcome for any website
Why is the last line of text separated in MS Visio shapes
In the image below, you can see two rectangles with some text inside. If you take a closer look you will notice a difference in spacing between lines. The spacing between the first and the second lines is smaller than the spacing between the second and the third. The last line is always separated. If you have 10 lines of text, the spacing between all the lines will be OK except the spacing between the next to last and the last line of text. The font is the same (in every aspect) accross the lines (except the title), and there are no custom paragraph properties set. Why does this happen and how to solve this?
I was able to highlight all the text (Control + A), right click on the highlighted text, select Format Text, select a size 12 font, even though it said it was already size 12, then click OK and it got rid of the space.
1
Control + A, right click on the highlighted text, select Format Text, select a size 12 font
Unable to Import Data
I am following this tutorial, but i am not able to get the right username and password to import data. How do I know what the username password is? By default I see tomcat6 as database and username and no password in the textbox. As i am following the tutorial I changed it to username: postgis and password: postgres. How do I know what my username and password is? EDIT Import the data in PostGIS, which requires PostGIS connection. UPDATE Ok so i got the user and passwd but when I am trying to add the shapefile using the Shape File to PostGIS Importer Plugin and having made connection successfully, I am getting this error when I am adding the shapefile. Connecting: host=localhost port=5432 user=admin dbname=shpRepo password='**********' Connection succeeded. Connection: host=localhost port=5432 user=admin dbname=shpRepo password='**********' Destination: public.AllQuebecSpecies Source File: /home/smaranh/development/Biodiversity/biodiversity/shapefile/AllQuebecSpecies Shapefile type: Point Postgis type: POINT[2] Failed SQL begins: "SET CLIENT_ENCODING TO UTF8; SET STANDARD_CONFORMING_STRINGS TO ON; BEGIN; CREATE TABLE "public"."AllQuebecSpecies" (gid serial PRIMARY KEY, "family" varchar(50), "species" varchar(50)); SELECT AddGeometryColumn('public','AllQuebecSpecies','the_geom','-1" Failed in pgui_exec(): ERROR: function addgeometrycolumn(unknown, unknown, unknown, unknown, unknown, integer) does not exist LINE 7: SELECT AddGeometryColumn('public','AllQuebecSpecies','the_ge... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. Shapefile import failed. Can somebody tell me where am I going wrong?
Maybe you created a database without PostGIS extension. You should choose the PostGIS template on the 'Definition' tag when creating a new database.
1
Create a database without PostGIS extension
Suppress 'file truncated' messages when using tail
I'm tailing a log file using tail -f messages.log and this is part of the output: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce eget tellus sit amet odio porttitor rhoncus. Donec consequat diam sit amet tellus viverra pellentesque. tail: messages.log: file truncated Suspendisse at risus id neque pharetra finibus in facilisis ipsum. It shows tail: messages.log: file truncated when the file gets truncated automatically and that's supposed to happen, but I just want tail to show me the output without this truncate message. I've tried using tail -f messages.log | grep -v truncated but it shows me the message anyway. Is there any method to suppress this message?
Maybe help if can be fixes origin of this error. It happened because something write to file with overwrite ">" not with append ">>".
0.888889
if can be fixes origin of this error
Is apt-get upgrade a dangerous command?
When I use apt-get update and apt-get upgrade,there are some packages should installed in newest version,like below: The following packages will be upgraded: accountsservice apparmor apport apt apt-transport-https apt-utils binutils cloud-init cpp-4.8 dpkg fuse g++-4.8 gcc-4.8 gcc-4.8-base gdisk gnupg gpgv grub-common grub-legacy-ec2 grub-pc grub-pc-bin grub2-common initscripts isc-dhcp-client isc-dhcp-common libaccountsservice0 libapparmor-perl libapparmor1 libapt-inst1.5 libapt-pkg4.12 libasan0 libatomic1 libbsd0 libcurl3-gnutls libdrm2 libedit2 libfuse2 libgcc-4.8-dev libgd3 libgomp1 libitm1 libjson-c2 libjson0 libnuma1 libpam-systemd libpolkit-agent-1-0 libpolkit-backend-1-0 libpolkit-gobject-1-0 libquadmath0 libstdc++-4.8-dev libstdc++6 libsystemd-daemon0 libsystemd-login0 libtsan0 libudev1 libxext6 linux-libc-dev ntpdate openssl overlayroot patch policykit-1 ppp python-urllib3 python3-apport python3-problem-report python3-update-manager rsyslog systemd-services sysv-rc sysvinit-utils tcpdump tzdata udev update-manager-core 75 upgraded, 0 newly installed, 0 to remove and 4 not upgraded. If I didn't know every one of there packages what will happen if there update in newest version.I shouldn't execute this command(apt-get upgrade). For example: This php version is before I upgrade yzxu@ubuntu:/tmp/git-2.1.2$ php --version PHP 5.6.6-1+deb.sury.org~precise+1 (cli) Copyright (c) 1997-2015 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies and after I upgrade: yzxu@ubuntu:/tmp/git-2.1.2$ php --version PHP 5.6.10-1+deb.sury.org~precise+1 (cli) Copyright (c) 1997-2015 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies The php version is changed.And if I didn't what what was change in two version,should I upgrade it?Is it will influence product?
Maybe. But you should regularly update your system. Updates can have risk, yes. This risk also depends on things I do not know such as what PPAs you may or may not have added or other sources. But again in general it's a good idea to keep you system up to date. When you update, you get stability fixes and security updates. So I will say that it is even more dangerous not to update(upgrade) your system.
0.777778
Updates can have risk, yes.
Multilingual Application in ASP.NET MVC - Best Practices?
I'm developing a web application using ASP.NET MVC (I'm new to the framework and actually quite new to web development in general). My application must support multiple languages - there's a bunch of countries for which I need the application to "speak" the local language. The UI concept is common - have flag icons somewhere, usually the top, possibly with an additional drop-down to include less common languages. At this stage I don't want to get into automatically detecting the source country, but rather start with English and allow users to choose otherwise (and I would remember that setting of course). I would like to know if there's any "framework" for supporting such multilingual views in ASP.NET MVC that will make the job easier. Any recommendations? Thanks
Check out these links: first second third Worked for me. In view - HtmlHelper.Resource("greeting"); in controller - this.Resource("greeting"); in model i got my own localization implementation. Make sure You check out this approach when considering localization implementation.
0.777778
Localization implementation
Christian description of "self-love" (from Matthew 22)
Matthew 22: 39 And the second command is like the first: ‘Love your neighbor the same as you love yourself. Self love, esteem, worth, etc are matters of the spirit and personality - that are foundations for how we live our lives. What is the description of self-love Christians are expected to have for themselves and their neighbors? Another issue, what is meant by this in a society where self love is low or rare (and why wasn't that considered when Jesus said this)?
My answer is based on a definition of love that is implied in Scripture, but not necessarily spelled out in chapter and verse. I learned it from Les Feldick's "Through The Bible" program. Any child can grasp the definition of Biblical love. It's simply seeking the other's highest good. (and only God is good). When Jesus commands us to love our neighbor as our selves. We simply seek eternal life for them as we desire it for ourselves. Jesus further commands his apostles "love one another as I have loved you" Jesus loved us by doing His Father's will. Believers love one another likewise, by doing our Father's will. For some, this love manifests itself in working toward getting God's Word out, the Gospel of grace, so that every man and woman, boy and girl can come to the saving knowledge of Jesus Christ.
1
"Through The Bible" is a definition of Biblical love .
Undelete comment on a Facebook Page
The new Facebook Page Manager app (in combination with my less than stellar thumb accuracy) has had me inadvertently deleting comments (when I've been trying to like them) left and right. Is there any way to undo this? If not, is there any way to tag a person who is a fan of the page and who commented on the post/picture but whose comment you deleted? I assume the answer is no since you cannot (acting as a page) tag someone in a reply who has not yet commented on a given post, but didn't know if anyone knew of any workarounds...
No, there is no way to retrieve a deleted comment. Additionally, the rest of what you said is true, you will not be able to tag this person in the reply.
1
No way to retrieve deleted comment
Do I need to pay income taxes for the money I earn online from a foreign website?
I work for a website based in Europe and they pay me every month to my bank account (salary account). Every time I receive funds, I will get a call from the bank for confirmation and they ask for the source and reason. I will tell them the website name and software consultancy. They deduct some amount as charges, and credit the remaining to my account. The question is: do I need to pay income taxes for this money I earned online?
Normally, yes, you would have to pay. If you are in the US, or a citizen of the US, then IRC Sec. 61 would levy tax on all income. Even if you find money on the ground, that will generally be taxable income (the treasure trove doctrine). If you are paying foreign income taxes, the US may allow credit.
1
IRC Sec. 61 would levy tax on all income
Can't deploy Sharepoint 2013 app
I'm trying to deploy my first sharepoint 2013 via Visual Studio. I generated an isolated app domain. When deploying the app i get an error in Visual Studio. ErrorDetail: The remote hosting service is not configured. ErrorType: Configuration ErrorTypeName: Configuration ExceptionMessage: Microsoft.Office.SecureStoreService.Server.SecureStoreServiceTargetApplicationNotFoundException: Target application not found (application id: __RemoteAppManagementInfo__). I don't know how to fix that. I already set up a new App Service Apllication, generated a key in secure store, restarted it, add Managed Account to Admin-List of secure store.
The message could come from the fact that you are doing a "High-Trust" SharePoint App, which requires also configuring Certificates. I would suggest you really folow to the letter these 2 posts, and also try to create a simple SharePoint Hosted, to make sure it works. http://msdn.microsoft.com/en-us/library/fp179923.aspx http://msdn.microsoft.com/en-us/library/fp179901.aspx Some tips: - make sure DNS is properly setup with a Wildcard domain or your local hosts file - do not use sub-domains (Mirjam has an excellent article here http://sharepointchick.com/archive/2012/07/29/setting-up-your-app-domain-for-sharepoint-2013.aspx)
0.777778
How to create a SharePoint Hosted?
get_option function
I'm currently trying to make my own theme, but i'm not quite sure how the get_option() function works, because how come this.. echo get_option('show_header', 'sultenhest_theme_display_options'); echo get_option('sultenhest_theme_display_options')['show_header']; ..both returns 1 (but Dreamweaver doesnt like the second option). While echo get_option('twitter', 'sultenhest_theme_social_options'); ..simply returns 'sultenhest_theme_social_options', which is incorrect. An option would be to define the array as such $social_options = get_option( 'sultenhest_theme_social_options' ); and call it like this echo $social_options['twitter']; It returns the correct string, but it only works in the header.php (if the array is defined there) file and not in, e.g. footer.php. UPDATE: Following partly ialocin and Brad Dalton i came up with this solution, which works like a charm: function sultenhest($option, $arg){ $the_array = array(); foreach( get_option('sultenhest_theme_'.$option) as $key => $item ){ $the_array[$key] = $item; } return $the_array[$arg]; } and echoing it out like this: echo sultenhest('social_options', 'twitter') ? '<a href="' . sultenhest('social_options', 'twitter') . '">Twitter</a>' : '';
You are using get_option() wrong, first variant, so take another look at the get_option() documentation. Basically you can't directly access an array element with the function, it just doesn't support it. The second variant should be possible, but you need at least PHP 5.4 - if I'm not totally mistaken; I don't know anything about dreamweaver. The reason why you can't access the variable everywhere you want is the variable scope, read up on it at the PHP Manual: Variable scope. The easiest thing I imagine is to do it the old fashion way, just make a function you can use. Exemplary like this: function wpse_179693_echo_my_options_array_value() { $social_options = get_option( 'sultenhest_theme_social_options' ); if ( isset( $social_options['twitter'] ) ) { echo $social_options['twitter']; } else { return FALSE; } }
0.666667
How to access an array element with the function?
Displaying additional User Contact Information
I have been advised how to add additional contact info fields to the User admin area here (Click here). However, I am not entirely sure how I can display the the field contents in a link within my template files. Here is the code in my functions.php: add_filter( 'user_contactmethods', 'more_contactmethods' ); function more_contactmethods( $contactmethods ) { $contactmethods['twitter'] = 'Twitter URL'; $contactmethods['facebook'] = 'Facebook URL'; $contactmethods['linkedin'] = 'LinkedIn URL'; return $contactmethods; } And here's the code in one of my template files, but it doesn't seem to work, so I wonder whether I can actually do it this way? <?php $twitter = get_usermeta( $user_id, 'facebook' ); $facebook = get_usermeta( $user_id, 'twitter' ); $linkedin = get_usermeta( $user_id, 'linkedin' ); ?> <a href="<?php echo $twitter ?>" id="twitterBtn" title="Visit our Twitter page">Visit our Twitter page</a>
// Add/Remove Contact Methods function add_remove_contactmethods( $contactmethods ) { $contactmethods['twitter'] = 'Twitter'; $contactmethods['facebook'] = 'Facebook'; $contactmethods['Youtube'] = 'YouTube'; $contactmethods['linkedin'] = 'LinkedIn'; $contactmethods['skype'] = 'Skype'; // Remove Contact Methods unset($contactmethods['aim']); unset($contactmethods['yim']); return $contactmethods; } add_filter('user_contactmethods','add_remove_contactmethods',10,1); This works fine in Thesis. Here's the full tutorial http://wpsites.net/how-to-wordpress/how-to-addremove-custom-user-profile-contact-info-links-to-your-author-box/
0.888889
Add/Remove Contact Methods
android opengl error (Application unexpectedly stopped)
I'm developing this game for android. I'm following a tutorial on how to make menus. And this is the code. There's no errors just warning in the code so I dont know what to do. 08-23 21:31:41.099: E/System(79): Failure starting core service 08-23 21:31:41.099: E/System(79): java.lang.SecurityException 08-23 21:31:41.099: E/System(79): at android.os.BinderProxy.transact(Native Method) 08-23 21:31:41.099: E/System(79): at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146) 08-23 21:31:41.099: E/System(79): at android.os.ServiceManager.addService(ServiceManager.java:72) 08-23 21:31:41.099: E/System(79): at com.android.server.ServerThread.run(SystemServer.java:206) 08-23 21:31:41.139: E/EventHub(79): could not get driver version for /dev/input/mouse0, Not a typewriter 08-23 21:31:41.139: E/EventHub(79): could not get driver version for /dev/input/mice, Not a typewriter 08-23 21:31:42.049: E/SoundPool(79): error loading /system/media/audio/ui/Effect_Tick.ogg 08-23 21:31:42.049: E/SoundPool(79): error loading /system/media/audio/ui/KeypressStandard.ogg 08-23 21:31:42.069: E/SoundPool(79): error loading /system/media/audio/ui/KeypressSpacebar.ogg 08-23 21:31:42.069: E/SoundPool(79): error loading /system/media/audio/ui/KeypressDelete.ogg 08-23 21:31:42.079: E/SoundPool(79): error loading /system/media/audio/ui/KeypressReturn.ogg 08-23 21:31:42.159: E/UsbObserver(79): java.lang.NullPointerException 08-23 21:31:42.159: E/UsbObserver(79): at com.android.server.UsbObserver.init(UsbObserver.java:131) 08-23 21:31:42.159: E/UsbObserver(79): at com.android.server.UsbObserver.<init>(UsbObserver.java:65) 08-23 21:31:42.159: E/UsbObserver(79): at com.android.server.ServerThread.run(SystemServer.java:402) 08-23 21:31:47.820: E/ThrottleService(79): Could not open GPS configuration file /etc/gps.conf 08-23 21:31:47.880: E/ThrottleService(79): Error reading data file 08-23 21:31:49.250: E/logwrapper(194): executing /system/bin/tc failed: No such file or directory 08-23 21:31:49.320: E/logwrapper(195): executing /system/bin/tc failed: No such file or directory 08-23 21:31:49.370: E/logwrapper(196): executing /system/bin/tc failed: No such file or directory 08-23 21:31:57.759: E/logwrapper(225): executing /system/bin/tc failed: No such file or directory 08-23 21:31:57.889: E/logwrapper(226): executing /system/bin/tc failed: No such file or directory 08-23 21:31:58.000: E/logwrapper(227): executing /system/bin/tc failed: No such file or directory 08-23 21:32:41.593: E/MetadataRetrieverClient(34): failed to extract an album art 08-23 21:33:17.502: E/ThrottleService(79): Error reading data file 08-23 22:06:08.702: E/AndroidRuntime(414): FATAL EXCEPTION: GLThread 13 08-23 22:06:08.702: E/AndroidRuntime(414): java.lang.IllegalArgumentException: No EGLConfig found! 08-23 22:06:08.702: E/AndroidRuntime(414): at org.andengine.opengl.view.ConfigChooser.chooseConfig(ConfigChooser.java:183) 08-23 22:06:08.702: E/AndroidRuntime(414): at org.andengine.opengl.view.ConfigChooser.chooseConfig(ConfigChooser.java:157) 08-23 22:06:08.702: E/AndroidRuntime(414): at android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:919) 08-23 22:06:08.702: E/AndroidRuntime(414): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1264) 08-23 22:06:08.702: E/AndroidRuntime(414): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)
if you are trying this in an emulator - it's probably not configured properly. See my answer to this question - Android AndEngine problems: java.lang.IllegalArgumentException: No EGLConfig Found
0.888889
Android AndEngine problems: No EGLConfig Found
Mystery cards in Magic 2015 card list
If you look at the full card list for Magic 2015, at Gatherer or elsewhere, you'll see a bunch of cards listed with collectors number 270-284. What are these cards, and why are they listed as being part of Magic 2015? I played enough M15 Limited to be pretty sure that they aren't actually present in packs, and they're listed after the basic lands, which is very unusual. Is there some secret, bonus release of M15 that had these extra cards?
You are correct, these cards are not in booster packs. For the past few years, Wizards has put out 30 card sample decks to introduce new players into the game. This year they decided to put into these packs a number of reprinted cards not actually present in M15: see here for decklists. Like the article mentions, the Deck Builder's Toolkit for M15 also has the extra cards. Since putting two of these sample decks together gives a basic 60 card, two-color deck, Wizards expects a number of people to do just that to build their first standard deck. They made those extra cards explicitly standard legal to allow people that option; most people would assume by default that such a deck is playable.
1
Wizards has put out 30 card sample decks to introduce new players into the game
Comment before or after the relevant code
Assuming a comment won't fit (or can't go) on the line it applies to, should one write the comment before the code or after? Well, wherever future readers will best understand the comment's scope. In other words, wherever most programmers/scripters put such comments. So where do most programmers/scripters put a comment: before or after its code? If your answer applies only to specific languages, please indicate which. And if you can cite an accepted spec or guide that supports your answer, so much the better.
A comment may need to go either above or below a piece of code, depending on what kind of comment it is: if it gives an ultra-brief explanation of what the code does, then it needs to precede the code; if it elaborately clarifies a technical detail about how the code works, then it needs to follow the code. Luckily, a comment can go either above or below a piece of code, and still leave no doubts about which piece of code it pertains to, by making proper use of blank lines. Of course, programmers who do not pay attention to the use of blank lines will not know what I am talking about; if you are one of those, please skip this answer and move on with your life. But programmers who pay attention to blank lines know very well that blank lines are used to divide code up into logical entities. So, if you see the following: [blank line] /* comment */ { code } [blank line] You know that the comment belongs to the code, and that it tells you what the code does. Whereas, if you see the following: [blank line] { code } /* comment */ [blank line] Again you know very well that the comment belongs to that code, and it is a clarification about how the code does what it does.
1
a comment can go above or below a piece of code if it gives an ultra-brief explanation of what the code does, then
Crosstalk vs interference
I don't even clear about the differences between crosstalk and interference. Could you explain me please? I just know that cross talk is the leakage power from other sources, whereas interference is the aliasing signal. Could you tell me any other differences?
Wikipedia gives a reasonable summary of the types of interference, of which crosstalk is one: http://en.wikipedia.org/wiki/Interference_%28communication%29
1
Wikipedia gives a reasonable summary of the types of interference
Safari 7 get stuck when loading webfont (woff) from cache
I'm experiencing a strange behaviour with Safari 7 on a webpage using web fonts The use of the webfont is properly specified in the CSS with correct URL pointing to a .woff file hosted in the server that runs the site. I clear the cache. I load the home page, everything is fine. I load a second page, the page doesn't load. Inspecting the network activity it comes out that Safari has loaded every resource except the webfont; it is aware the webfont is in cache, doesn't attemp to reload (no request is sent to the server) but is stuck processing that resource (the spinner keeps spinning). Reloading the (second) page, results in getting the page loaded just fine. Other browsers behave with no issues. Is this a bug in Safari or I'm missing something? Is there any workaround? Here is the CSS: @font-face { font-family: 'myfont'; src: url( '../font/my-font-webfont.eot' ); src: url( '../font/my-font-webfont.eot?#iefix' ) format( 'embedded-opentype' ), url( '../font/my-font-webfont.woff' ) format( 'woff' ), url( '../font/my-font-webfont.ttf' ) format( 'truetype' ), url( '../font/my-font-webfont.svg#myfont' ) format( 'svg' ); font-weight: normal; font-style: normal; }
I had similar issues in the past. Probably it's a problem related to the Safari installation on your machine. Try with other Safari 7 installation on different machine and see if the problem persists.
0.777778
Safari 7 installation on different machine
Ripening bananas artificially: What is the biological reason
I am a resident of the tropical island of Sri Lanka, and we have a strange traditional method to ripen our bananas quickly. What we do is this: We dig a pit in earth that is enough to put the whole banana cluster in. Then, after the safely laying the bananas in the pit, we cover up the pit with a sheet such that only a small hole from a side remains: visualize a small 3-4 inch door to the pit. After that, we light a fire with semi-dry leaves just outside the pit's door. (Semi-dry leaves are used to get as much smoke as possible. Dry leaves do not give that much smoke, because they completely oxidize quickly). And the smoke is sent through the door by blowing it with the aid of a bamboo. This sends a good amount of smoke and warms the inside of the pit considerably. And by experience I can tell you that this makes the bananas to ripen really quickly. I have done a controlled experiment where half of the cluster was not put into the pit. Bananas in the pit ripen overnight and the control sample took days to ripen. Can anybody explain what are the bio-mechanisms that are working here?
Ripening of bananas is induced by ethylene (see reference 1), which acts as a hormone and induces the ripening process. The incomplete combustion of the leaves produces ethylene, additionally the warmth of the process will help the enzymes as well. There is even a paper about this technique (although it is unfortunately not accessible), see reference 2 for more information. Smoking Chambers are routinely used in this process, see reference 3 and 4. References: Role of Ethylene in Fruit Ripening Effects of smoking on some physiological changes in bananas. Fruit Ripening Technology for ripening fruits as important as marketing them
1
Ripening of bananas is induced by ethylene (see reference 1) .
Good travel games for two players, especially for playing on trains?
I would be interested to hear if anyone had recommendations for 2-player games that are particularly suitable for playing while travelling on trains. (I ask this as someone who mostly enjoys games like Carcassonne, Power Grid, Agricola, Pandemic, etc. around the table at home.) To be specific, the things that I think are important properties for these games are: Needing minimal table space. Most trains have a small table you could use, but not much more. Being quiet to play, so that other passengers won't be disturbed. For example, I imagine that games that involve repeatedly rolling dice wouldn't be appreciated. Packing down small, so that they don't take up much luggage space. Not requiring batteries or a power socket. (I appreciate that an iPhone or a Nintendo DS for each player might be a good solution more generally, but it's not what I'm after in this case.) Not being so delicate to arrange that motion from the train will unduly disrupt the play. I think it would be best to recommend one game (or class of games) per answer, if that's appropriate, and explain why you think it's particularly suitable. (Incidentally, I've read the guidance on good questions about game recommendations and hope this question meets the criteria.) Update: Thanks for so many excellent suggestions - we certainly won't be short of games for our next long train journey :) Update 2: Unfortunately, I can't really playtest this many great games in any reasonable time period, so I'm going to accept the top-voted answer (Cribbage) and try out the others as soon as I can. Thanks again...
The base version of Carcassonne can be played on a very compact space, if you get an alternative scoring track. I have a cloth scoring track, plus the draw bag that comes with B&T (I think) that I can carry in a mini-expansion box. There is also a travel version of Carcassonne. The iPad version of Caracassonne and Small World are also very nice. You only need one iPad, and the battery lasts ages.
1
Carcassonne can be played on a very compact space if you get an alternative scoring track
Is it possible to keep using iPhoto in parallel with Photos?
Is it possible to keep using iPhoto after starting to use Photos?
You can keep using it, but not in parallel. Any changes made in one app will not be reflected in the other. Over time, things will diverge more & more. I would use one & stick to it for now. When you finally decide to go over to Photos full-time, then do a resync from your current iPhoto state, by deleting the Photos Library & importing again. Doing that will then erase any work done in Photos & replace it with the latest iPhoto state
1
Do a resync from your current iPhoto state, by deleting Photos Library & importing again
How to make extra crispy and crunchy breading like KFC?
I'm wondering how I would go about making extra crispy chicken breading like they do at many places like KFC and the like. Is there a certain ingredient that makes the breading like that? Any assistance would be very much appreciated, and feel free to share any of your own recipes for crispy chicken breading if you have them. I'll be sure to put them to good use! Thanks!
its have been an ancient question on how to get chicken crispy like kfc. here is kfc recipe mix for breading. 10 kg cake flour 650 grm milk and egg. 1 kg salt 1 kg seasoning also note that kfc breading consist of dry ingrediants milk and egg powder that why their chicken is crispy we all know that the milk is browning and egg binding. and yep they uses pressure fryer. if you need to archieve almost similar result with your recipe you need a pressure fryer or just forget about it. i am working with fried chicken in fact i made my breading from scratch using their measurement in making my recipe. my chicken is much more crisper and dryer than kfc. i reduced milk and egg by 150 grm added 2.5 kg brown bread flour sift my breading twice before i started breading chicken. the result was amazing i am supply breading to small restaurants competing against the giants Freddy Hirsch etc the difference is my breading is one product you open the breading and bread chicken thats all. the only way to get away without using fressure fryer is steaming the chicken. double bread it and fry in the open chip fryer. i gave that method to chicken xpress for their hot wings and its working. yeah we can cook too in South Africa.
1
How to get chicken crispy like kfc?
Java and JVM license
Does Java license allow other companies to create their own versions of Java language or just implement it accurately? Same question about JVM. I heard about Sun suing Microsoft for changing their .NET version of Java implementation and Java for Google Android, but I just can't grasp the whole concept as a totality.
Well, as I understand it, you can implement the specification all you like - to be able to legitimately call it "Java" you have to license and pass the compatibility kit, which apparently isn't trivial. Android is not "java" although it uses the java language. It doesn't even attempt to pass the TCK.
0.666667
Android is not "java" although it uses the java language
Does "so far, so good" carry a negative connotation?
As a follow up to this etymology question, does "so far, so good" carry a negative connotation? For example, after having her sonogram, my wife asked the technician if everything was okay. The technician replied, "so far, so good." My wife later remarked that she didn't like that the technician used the phrase because it sounded like things will be going wrong later. I always thought this phrase was positive and that it was a replacement for the word "good."
"So far, so good" has a neutral connotation. The only negative I can see in it is that it isn't unreservedly positive. In cases where such a positive answer might be expected, failing to give one might be seen as negative in comparison. However, in the specific scenario, giving a premature positive answer would be unprofessional, so I don't think you should see any negative connotation here.
1
"So far, so good" has a neutral connotation
how do i fixed divs from overlapping centered, static div on browser resize?
I am trying to build a two columned layout with a sidebar that always stays on the left side of the page with a main content area that is centered, and when the window is resized, the centered content will eventually bump up against the nav bar, but never move any further left than where it is when they touch (which would be left: 150px). Can someone help me out? Here is the CSS: @charset "UTF-8"; /* CSS Document */ body,td,th { font-size: 16px; font-family: Verdana, Geneva, sans-serif; color: #000; } body { background-color: #FFF; margin-left: 0px; margin-top: 0px; margin-right: 15px; margin-bottom: 0px; } #nav { position: fixed; top: 0px; left: 0px; width: 150px; height: 10000px; background-color: #D61D21; text-align: right; } #nav a:link { color: #FFF; text-decoration: none; } #nav a:visited { color: #FFF; text-decoration: none; } #nav a:hover { color: #FFF; text-decoration: underline; } #main { width: 810px; height: 810px; margin: 0px auto; } and here is the html: <!DOCTYPE HTML> <html> <head> <meta charset="UTF-8"> <title>Nick Passaro Designs</title> <link href="css/index.css" rel="stylesheet" type="text/css"> </head> <body> <div id="nav"> <a href="index.php"><img src="assets/marklogo.jpg" width="150" height="97" border="0" alt="Nick Passaro Designs"></a> <p><a href="portfolio.php">PORTFOLIO</a>  </p> <p><a href="logos.php">LOGOS</a>  </p> <p><a href="print.php">PRINT</a>  </p> <p><a href="web.php">WEB DESIGN</a>  </p> <p><a href="photography.php">PHOTOGRAPHY</a>  </p> <p><a href="contact.php">CONTACT</a>  </p> </div> <div id="main"> ENTER CONTENT HERE </div> </body> </html> Any help is greatly appreciated!
A neat little trick I just learned is making your #content position: relative; and then make all child elements inside it position: absolute; that way all child elements are absolute to your content area and the content will resize to any resolution. Saves me so loads of time and i can't believe how much time I used to waste laying dynamic sites out. Hope this does something for you.
0.888889
Make your #content position: relative; and then make all child elements inside it position: absolute; and the content will resize to any
How does owning a home and paying on a mortgage fit into family savings and investment?
I'm in my mid-20's, and so I am aiming at long-term growth with higher risk in my portfolio. My financial adviser is showing me some investment allocations that put my money in some growth, mid, and value-retention locations. He doesn't seem to be taking into the equation the fact that I am putting a huge percentage of my paycheck into my home. I know home values fluctuate, but long term, it seems to be a pretty good way to at least retain value, and at best make a small return. If I am already contributing so much to my "home" investment, why would I also invest in stocks or bonds with a low rate of return, even though they are considered a "safe" part of my portfolio? Update: I think the question really has two parts. 1) How does owning a home fit into my financial portfolio? Most seem to agree that at best it is a hedge against rent or dollar inflation, and at worst it should be viewed as a liability, and has no place alongside other real investments. 2) How should one view payments on a home mortgage? How are they similar or different to investing in low-risk low-reward investments?
Have you ever tried adding up all your mortgage payments over the years? That sum, plus all the money that you put as a down payment (including various fees paid at closing) plus all the repair and maintenance work etc) is the amount that you have "invested" in your house. (Yes, you can account for mortgage interest deductions if you like to lower the total a bit). Do you still feel that you made a good "investment"?
0.888889
Do you still feel that you made a good "investment"
What's the base f-stop when counting an ideal f-stop for lens?
I've read a lot around this site that an ideal quality of the lens is achieved when using f-stop roughly 2 stops slower than the fastest value of the lens. Firstly, I'm not exactly sure what "2 stops" mean when it comes to f-stop, but this isn't really important in what I'm about to ask. What I'd like to know is what is the base f-stop when counting this value. Let's look at it this way: If I have a prime lens with f/1.8, then obviously I'll be getting the ideal value from f/1.8, let's say after 2 stops I get f/2.8? But! What in case of zoom lenses, for example 18-55, which have f-stop f/3.5 - f/5.6. Should I take f/5.6 as my base value, or does the base value depends on the real fastest value at the exact focal length? Therefore, if I set the lens to 18 mm, their fastest aperture is f/3.5 and thus the ideal quality is at f/5.6 and when I set it to 55 mm, their fastest aperture is f/5.6 and thus the ideal quality is at f/8 ? Or is it f/8 for the whole focal range ?
Real fastest value at the exact focal length. But, this is just a rule of thumb — it's not necessarily exactly two stops in every case. For the question of what two stops mean, see What does f-stop mean?. In short, each stop is approximately the-square-root-of-two times the previous one. That means half the light is allowed in (which is why the seemingly-weird series of numbers was chosen). Two stops is doing that twice, which conveniently works out to simply being doubling. Two stops from f/2 is f/4, and and two stops from that is f/8. Or, starting at f/1.8, two stops is f/3.6. The test results comparison tool used by Digital Photography Review is interesting for looking at this. Try this test of Pentax's 18-55mm zoom, which like most kit zooms goes from f/3.5 at the short end to f/5.6 zoomed out. You can see that at 18mm, the sharpness improves as you go from f/3.5 to f/4 to f/5.6. At f/8, it's more even from center to corners, but doesn't get any sharper. And beyond that, it drops off. Then, change the focal length to 55mm. You'll notice that with this lens, overall sharpness goes down from 18mm at f/5.6. At f/8, it picks up a little bit, and a little more at f/11, and then back down again at f/16. So, that fits with the two-stops guideline pretty well. Same for the Canon kit lens, and Nikon too. With the Pentax DA 15mm f/4 Limited test, they've got test results in third-stops, and there you can see that f/7.1 is no better than f/6.3, and f/8 is worse — so that's only 1⅓ stops. On the other hand the DA★ 55mm f/1.4 shows peak sharpness at f/4.5 — closed down by 3⅓ stops. This doesn't reflect a problem with the lens, just different priorities in design. The Nikon 50mm f/1.4G is similar, with peak sharpness at 3⅔ or 4 stops down. However, the entry level Nikkor f/1.8G fits the "two stops" guide quite well, peaking at around f/3.5. It's also worth noting that this test is primarily concerned with sharpness, because that's easy to measure. Other image quality and rendering characteristics are also affected. Vignetting (light falloff in the corners) gets better the more you stop down, and it's usually gone after two stops. And bokeh quality is usually improved by stopping down, too — generally, lens bokeh is nicer/smoother stopped down a bit, but of course it's less visible since you have greater depth of field. Plus, shape of the aperture blades will become visible in specular highlights, which is a side-effect unrelated to stopping down per se — some modern lenses have rounded aperture blades to make that not be a concern.
0.666667
What does f-stop mean?
If $f : [-a,a] \rightarrow \mathbb{IR}$ is Scott continuous, why are $f^-$ and $f^+$ measurable?
In "A domain theoretic account of Picard's theorem" (http://www.doc.ic.ac.uk/~dirk/Publications/icalp2004.pdf), the authors assert the following. Let $\mathbb{IR}$ be the interval domain $\lbrace [a^-,a⁺] | a^- \leq a^+, a^-, a^+ \in \mathbb{R} \rbrace \cup \lbrace \mathbb{R} \rbrace$. Suppose $f = [f^-,f^+] : [-a,a] \rightarrow \mathbb{IR}$ is Scott continuous. Then $f^-$ and $f^+$ are measurable. Their proof consists in asserting that $f⁻$ and $f⁺$ are lower (resp. upper) semi-continuous, which I have tried without success to establish. Can anyone help with either an explanation or a reference that proves it?
First, we note that $\mathbb{IR}$ is ordered by $[a,b] \sqsubseteq [c,d]$ iff $[c,d] \subseteq [a,b]$, which makes $\mathbb{IR}$ into a domain. Now suppose $f: [-a,a]\to \mathbb{IR}$ is Scott-continuous (that is, $f$ preserves all directed suprema). We want to prove that $f^-$ as defined in the comment above is lower semi-continuous. Let $(x_n)$ be an increasing sequence in $[-a, a]$. So $(x_n) \to s$ where $s = \sup\{x_n:n\in\mathbb{N}\} \in [-a, a]$. We want to show that $\lim_{n\to\infty} f^-(x_n) = f^-(s)$. The set $$D:=\{x_n: n\in \mathbb{N}\}$$ is a directed subset of the domain $[-a,a]$ (with the ordering inherited from $\mathbb{R}$), and we have $s=\bigsqcup D$. For $n\in \mathbb{N}$ we have $f(x_n)\supseteq f(x_{n+1})$ since $f$ is order-preserving (which is implied by $f$ being Scott-continuous). The fact that $f$ is Scott-continuous means that $$[f^-(s), f^+(s)] = f(s)=f(\bigsqcup D) = \bigsqcup f(D) = \bigcap \{ [f^-(x_n), f^+(x_n)]:n\in\mathbb{N}\}.$$ So $(f^-(x_n))_{n\in\mathbb{N}}$ is an increasing sequence in $\mathbb{R}$ and it is bounded by $f^+(x_1)$, so it converges. The equations above imply that $\lim_{n\to\infty} f^-(x_n) = f^-(s)$, so $f^-: [-a,a]\to \mathbb{R}$ is lower semi-continuous. A similar argument shows that $f^+$ is upper semi-continuous.
0.777778
$f: [-a,a]to mathbbIR$ is Scott-continuous .
Install old version of Wine
Recording to this page https://appdb.winehq.org/objectManager.php?sClass=version&iId=9597&iTestingId=56155, I should install older version of wine (max. 20041019), in order to run D2GS (game server). Can anyone help me with that? As I've heard, the easiest way is with PlayOnLinux, but I'm looking for a direct way of installation. Thanks!
I suspect the information on that page that mentions a wine version from 2004 is extremely old (over 10 years old). The compatibility box at the top of the page suggests it works fine on the latest versions of wine. If you are having a problem running it on the current version of wine in Ubuntu, the best thing to do would be to file a bug report with any crash details and with a description of the problem.
0.777778
if you are having a problem running a wine version in Ubuntu, the best thing to do would be to file a bug report
How do I create a quicklist for Ubuntu Tweak?
I want to create a quicklist for Ubuntu Tweak on my Unity launcher, but I'm having trouble getting started. Can anyone help?
The newest versions of Ubuntu Tweak now have a couple of command line parameters which you could exploit to create a quicklist. By default - ubuntu-tweak has already a quicklist for various features: running ubuntu-tweak -h: Usage: ubuntu-tweak [options] Ubuntu Tweak is a tool for Ubuntu that makes it easy to configure your system and desktop settings. Options: --version show program's version number and exit -h, --help show this help message and exit -d, --debug Generate more debugging information. [default: False] -m MODULE, --module=MODULE Start module directly. [default: ] -f FEATURE, --feature=FEATURE Start feature directly. [default: ] Features - ubuntu-tweak -f [feature-name] overview tweaks admins janitor Modules - ubuntu-tweak -m "[ClassName"] This is useful if you have any plugins installed. Thus you can copy /usr/share/applications/ubuntutweak.desktop to ~/.local/share/applications and add any plugins that you may have installed to add to the default quicklist. See the Linked Question for an example of how to create a quicklist by passing parameters such as a plugin module name to the ubuntu-tweak executable. Linked Question: How do I make a quicklist for umplayer?
0.888889
How do I create a quicklist for umplayer?
Jasper Report group subreports using columns
I have a master report (using iReport 5.0.4) with a subreport that uses grouping by a field called "Group Number" (sorry, but that is the actual column name). My report works fine when there are more than one group, but it generates each group result scrolling down the page vertically. I would like to be able to have each group go across vertically, but when I tried using columns, it simply forces each group's data into columns, and not the entire group 1, followed by group 2 in the next column, etc. There can be up to 8 groups, so I was hoping not to have to create 8 individual sub-subreports with a "print when" expression to show/hide them. Can anyone tell me if this should be possible? Thanks, Mitch
I think making subreports is the easiest and obvious way. But if you want to make it in other way, I can only suggest to use scriptlet, and form dataset manually (Transpose it). Another suggestion is when you generating report directly from database (i.e. passing connection into jasper) you can modify query and transpose the data (PIVOT table). Anyway provide more info about your case. I will try to help you.
0.888889
How to make subreports
Proper word for "understood"
I want to communicate to a person that her situation and conditions are understandable and I get it. Is: You're being understood. the most accurate one? Is "understood" the best word in this context?
Google suggests many, as well as a few of my own: Clear Comprehensible Transparent (Although this is usually said as an insult to an individual who has a plan, so I wouldn't recommend it) Distinct Concise Although these are all options, yours fits the bill just fine, if not a little formal. For a word in a casual conversation or chat1 you might like to try: "Yeah, I get you" "It's all clear" In summary, you've used the right word, but there are some good alternatives out there if you wish to use them! 1: Although that's not to say that "understood" would be completely inappropriate in a casual conversation! EDIT: To express sympathy, you could (and should) use different terms to those that describe a knowledgeable understanding. If the person is going through a bad time: "I feel for you" (when the person is going through a bad time) "I know how you feel" Or, if the person is judging their actions (or themselves) in response to their situation and circumstances: "You did the right thing" "It's not your fault" "You did the best you could" Or, if you've been through a similar experience: "I've been there" "We've all been there" (if her situation is a common one)
0.777778
"understood" would be completely inappropriate in a casual conversation
drive 3 phase induction motor with only DC (not pwm) thru each phase
I've been researching making a driver for a 3 phase induction motor powered by DC source using PWM to approximate sine waves in each phase. However, the switching speeds of the PWM signal for the rotational speed I want is difficult to obtain with hobby microcontroller boards like the arduino. Can I just switch the DC directly thru each phase at the correct time only twice per cycle ? Essentially I would be approximating a sine wave with only 2 different voltages thru the coils, ie: +V and -V (using H bridge circuitry here) Will this create enough of a rotating magnetic field that sufficient current is induced in the rotor cage ? What will be the losses in power / efficiency for this, or any other drawbacks for this system ? The bonus is greatly simplified drive electronics.
If you're switching the DC through 3 half-bridges, this will work just fine. Torque will be uneven at low speeds and waveforms rather nasty, but it'll work. Beware that turning current OFF fast to an inductive load (i.e. motor) is a good way to generate very high voltages so pay attention to protective diodes. NOT 1N4001s (FAR too slow) but high speed switching, high current diodes from each motor terminal to both supply rails, and overvoltage protection on the rails... [edit...] The problem with PWM is not the PWM frequency, but the number of times you have to change it per revolution... As you are controlling it with software, there is nothing to stop you using PWM at low speed, and switching to direct (square wave) drive at high speed.
1
Switching DC through 3 half-bridges will work just fine
Can I restrict a vhost to only a local IP?
I have a subdomain I'd like to only be accessible by a local IP address. Is it possible to specify this in the vhost? I'm thinking it's not since I haven't found much on Google. If not, what's the best way to do this on an apache level? I forget the version of Linux we're using... but we have Samba running on it. The site I'm trying to restrict is our site's documentation.
You can definetly disable access to a directory based on IP with mod_access (included in most linux distributions): i.e. <Directory /docroot> Order Deny,Allow Deny from all Allow from 10.1.2.0/24 </Directory> If you block the access to the whole document root for that vhost then the user from outside should not get more than 403 Forbidden all the time.
0.888889
How to disable access to a directory based on IP with mod_access
Pull CSV data from URL to Google Spreadsheet
I have a site which allows authenticated users (read: in-house users) to download certain data from the site in CSV format, e.g. http://example.com/activities.csv . Can I create a Google Spreadsheet which pulls its data directly from that URL? (The idea is that I could then share that spreadsheet with them - we're on the same Apps domain - and skip the step of downloading and importing a CSV file every time we want to update the spreadsheet.) I've looked through Spreadsheet's menus and help and haven't found a toehold on this; I'm wondering if it's not possible or if I'm just searching the wrong things.
Drop this formula in the first cell of your google spreadsheet: =importData("http://example.com/activities.csv") And it will automatically fill out the rest of the current spreadsheet with as many columns and rows as it needs until all the data from the original source csv is displayed. There are many other powerful ways to feed Google Spreadsheets from all kinds of external sources. Check out this article for some demonstrations.
0.888889
How to feed Google Spreadsheets from external sources
Offline tiled map web app
I'm not sure whether to post this here or on Stackoverflow, as it's sort of a crossover. Let me give it a try. In the proposed HTML5 standard, there's the option of storing web application data in a local cache using a cache manifest. I am looking to use this technique for an offline tiled web map application and did a quick prototype here based on a standard install of Geoserver. I just ripped the OpenLayers client page that is generated from one of the default layers and changed the <html> tag to <html xmlns="http://www.w3.org/1999/xhtml" manifest="cache.manifest"> And created the file cache.manifest which simply reads CACHE MANIFEST http://lima.schaaltreinen.nl:8080/ Which should, in my limited understanding of the matter, locally cache everything that loads from that URL: all tiles and the OpenLayers JS. In fact, upon first call in Firefox, it does ask me to allow local storage, but when I hit refresh - either online or offline - the page croaks stating that the OpenLayers object is not defined. Looks like it hasn't loaded the OpenLayers JS. Anyone successfully did a functioning offline OpenLayers-based tiled web map app? Or hints on how to investigate this further?
One complexity that seems to show up in articles about this is that: Note that the MIME type of the manifest file is text/cache-manifest. And the examples all seem to list specific files to cache (but I may need to read further).
0.333333
Note that MIME type of the manifest file is text/cache-manifest
Add rows of textboxes with a click of a button
I am badly stuck on this problem and would appreciate any kinds of helps! I have to create a page where the user can add more rows by clicking a button. For example, I have the first row with 2 text boxes (name and birth dates), second row with the "Add Row" button. When the user clicks the "Add Row" button, the first row should be cloned and repeated...but the user can't add more than 5 rows. Later all the information need to be saved in a SQL table. How this can be achieved in C#? I am attaching my sample ASP.NET. Can any one PLEASE help me? PS: I have already read and tried "How to: Add Rows and Cells Dynamically to a Table Web Server Control"....but that's not working for me. <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Testing Adding Rows</title> </head> <body> <form id="form1" runat="server"> <div> <asp:Table ID="Table1" runat="server" width="400" style="border:[none][0]; border-color:White; border-style:hidden"> <asp:TableRow ID="TableRow1" runat="server"> <asp:TableCell runat="server" nowrap="nowrap" Width= "70"> <asp:Label ID="nameLabel" runat="server" Text="Your Name" Font-Size="X-Small"></asp:Label> </asp:TableCell> <asp:TableCell runat="server" nowrap="nowrap" Width= "100"> <asp:TextBox ID="tb_name" runat="server" Font-Size="Smaller"></asp:TextBox> <asp:RequiredFieldValidator ID="nameValidator" runat="server" ControlToValidate="tb_name" Font-Size="Smaller">*</asp:RequiredFieldValidator> </asp:TableCell> <asp:TableCell runat="server" nowrap="nowrap" Width= "70"> <asp:Label ID="dateLabel" runat="server" Text="Birthdate" Font-Size="Smaller" ></asp:Label> </asp:TableCell> <asp:TableCell runat="server" Width= "100"> <asp:TextBox ID="tb_date" runat="server" Font-Size="Smaller"></asp:TextBox> <asp:RequiredFieldValidator ID="dateValidator" runat="server" ControlToValidate="tb_date" Font-Size="Smaller">*</asp:RequiredFieldValidator> </asp:TableCell> </asp:TableRow> <asp:TableRow ID="TableRow2" runat="server"> <asp:TableCell runat="server" align="left" Width= "100"> <asp:Button ID="addRow" runat="server" Height="22px" Text="Add Row" ToolTip="Click to add another row" onclick="ButtonAddRow_Click" /> </asp:TableCell> </asp:TableRow> <asp:TableRow ID="TableRow3" runat="server"> <asp:TableCell runat="server" bordercolor="#FFFFFF"> </asp:TableCell> <asp:TableCell runat="server" align="left" nowrap="nowrap" bordercolor="#FFFFFF"> <asp:Label ID="msg" runat="server" ForeColor="Red" Font-Size="Smaller"></asp:Label> <asp:ValidationSummary ID="LogonValidationSummary" HeaderText="All the fields (*) are required." DisplayMode="SingleParagraph" Font-Italic="true" ShowSummary="True" EnableClientScript="true" runat="server" Font-Size="Smaller"/> </asp:TableCell> </asp:TableRow> <asp:TableRow ID="TableRow4" runat="server"> <asp:TableCell ID="TableCell10" runat="server" bordercolor="#FFFFFF"> </asp:TableCell> <asp:TableCell ID="TableCell11" runat="server" align="left" bordercolor="#FFFFFF"> <asp:Button ID="ButtonSubmit" runat="server" Height="22px" Text="Submit" Width="79px" onclick="ButtonSubmit_Click" /> </asp:TableCell> </asp:TableRow> </asp:Table> </div> </form> </body> </html>
This codes snippet is just a hint that you can do this way.. TableRow row = new TableRow(); for (int j = 0; j < colsCount; j++) { TableCell cell = new TableCell(); TextBox tb = new TextBox(); tb.ID = "TextBoxRow_" + i + "Col_" + j; cell.Controls.Add(tb); row.Cells.Add(cell); } Table1.Rows.Add(row);
1
tableRow row = new TableRow()
Matching Gmail filters on BCC mail
I am using Google Apps for Domains to handle my personal email. I have the following filter configured: Matches: to:([email protected]) Do this: Skip Inbox, Mark as read, Delete it Here is the exported filter XML: <entry> <category term='filter'></category> <title>Mail Filter</title> <id>tag:mail.google.com,2008:filter:1348992826412</id> <updated>2012-09-30T08:16:38Z</updated> <content></content> <apps:property name='to' value='[email protected]'/> <apps:property name='shouldMarkAsRead' value='true'/> <apps:property name='shouldArchive' value='true'/> <apps:property name='shouldTrash' value='true'/> </entry> Despite this rule, mail to the [email protected] address is not being matched by the filter. Here is one example headers of a mail that was not caught by the filter: Delivered-To: [email protected] Received: by 10.49.35.178 with SMTP id i18csp10155qej; Sun, 30 Sep 2012 02:09:09 -0700 (PDT) Received: by 10.68.225.68 with SMTP id ri4mr32446176pbc.115.1348996149371; Sun, 30 Sep 2012 02:09:09 -0700 (PDT) Return-Path: <[email protected]> Received: from mail.tbb.com.tw ([210.202.75.124]) by mx.google.com with SMTP id c5si10659paz.41.2012.09.30.02.09.07; Sun, 30 Sep 2012 02:09:08 -0700 (PDT) Received-SPF: neutral (google.com: 210.202.75.124 is neither permitted nor denied by best guess record for domain of [email protected]) client-ip=210.202.75.124; Authentication-Results: mx.google.com; spf=neutral (google.com: 210.202.75.124 is neither permitted nor denied by best guess record for domain of [email protected]) [email protected] Received: By OpenMail Mailer;Sun, 30 Sep 2012 16:05:41 +0800 (CST) From: "Loan Financial Private Company" <[email protected]> Reply-To: [email protected] Subject: Loan Financial Private Company Message-ID: <[email protected]> Date: Sun, 30 Sep 2012 16:05:41 +0800 (CST) MIME-Version: 1.0 Return-Path: [email protected] Content-Type: text/plain; charset=big5 Content-Transfer-Encoding: quoted-printable Note that I have tens of other similar filters that do properly match mail per address. It is only this one address / filter combination that is failing to match mail. To proactively address the obvious red herrings and ensure that the discussion remains focused: I am aware of the dangers of posting a live email address publicly. I am aware of Gmail's excellent spam filters. I am aware of the arguments against catch-all email addresses.
Gmail help says: *Search on bcc: cannot retrieve messages on which you were blind carbon copied You need to use the deliveredto: operator. Search for messages within a particular email address in the Delivered-To line of the message header Example: deliveredto:[email protected] Meaning: Any message with [email protected] in the Delivered-To: field of the message header (which can help you find messages forwarded from another account or ones sent to an alias).
0.888889
Search for messages in the Delivered-To: field
How soon after baking can you refrigerate freshly made fruit pies?
How soon after baking a fresh fruit custard pie can I refrigerate it? Must it be at room temperature before it's put in the fridge?
Basically you want to avoid heating up the contents of your refrigerator. That's pretty much the only concern, protecting your other food items. How long it will take a given pie to cool depends on a lot of factors, but I'd say wait half an hour minimum after pulling from the oven. It will still be warm at that point, but probably not enough to appreciably warm your fridge.
1
How long will it take a pie to cool?
Lead Free Soldering and bad looking joints
For years I've been soldering with normal Sn60Pb40 solder wire. But now I try to switch to lead free solder. In many forums over the internet I found the Amasan BF32-3 solder wire. It's a Sn95Ag4Cu solder wire with 3.5% flux. So I tried it and was very disappointed. Nearly every solder joint was looking different. Some of them were (partially) shiny; some (the most) of them were dull. And the worst thing was, that even with additional flux, the solder didn't flow like the leaded. So there is no way, I could solder fine pith SMD stuff with it. I’m using a JBC soldering iron station with a C245-907 2.2mm chisel tip and tried different temperatures starting with 290°C to 360°C. The best results I get with about 315°C, with 350°C I got the worst results. I used the Amtech NC-559 Flux – the original, not the fake from china. Some other guys told me, that maybe the solder wire is not the best. That's why I'm looking for other soldering wires. But there are so many on market. Some with copper, some are Sn96.5Ag3.5 like the Amtech ASN96A3.5-0.50. So can someone tell me, with what type of solder wire or what product I can get nice shiny solder joints. And yes, I now that dull joints were not a sign for a bad or even cold joint.
For things that require RoHS, I've been using a version of lead-free popular with assembly houses- Sn99.3/Cu0.7 2% flux, which seems to work okay. The joints are not quite as shiny as the beloved Sn63/Pb37 with RMA flux, but quite acceptable. Left two joints are lead-free, right joint is Sn63/Pb37.
0.777778
Sn99.3/Cu0.7 2% flux, which seems to work okay.
MS-Access VBA Date() works on one PC but not others
I am designing my first database from the ground up and I have learned a lot in the last few weeks. One thing that has been eating at me though is that on my login page I have a simple unbound text box with its control source as =Date(). This works perfectly well on the computer I use most days, but any other computer in the facility I am working out of displays #NAME? instead of the date. I have tried changing to =Now() and it works fine on all computers. Apparently only =Date() has issues. If the fields control source is changed back to =Date() I am informed that The function you entered can't be used in this expression. I have checked the MS-Access versions and tried on a machines with and without access. I really need Date() to work because it is used elsewhere in more vital areas of my code and I may not be able to use Now() in its place. Any ideas as to why this may not work on any PC besides my own?
Date() is controlled by the Visual Basic For Applications X.XX reference. Make sure the reference is installed and any competing references are removed. To do this, open the VBA window and go to Tools --> References and ensure the proper one is checked.
0.888889
Date() is controlled by the Visual Basic For Applications X.XX reference
Generate mousemove event with dispatchevent?
Is there anyway to do a mousemove event with java.awt.Component.dispatchEvent(AWTEvent)? .dispatchEvent(new MouseEvent(client.a .getComponentAt(1, 1), MouseEvent.MOUSE_MOVED, System.currentTimeMillis(), MouseEvent.NOBUTTON, x,y, 1, false)); I got this now but it doesnt perform a mouse move. How can i do it? Edit: I tried it like this but its not working: .dispatchEvent(new MouseEvent(client.a .getComponentAt(1, 1), MouseEvent.MOUSE_MOVED, System.currentTimeMillis(), MouseEvent.NOBUTTON, x,y, 0, false)); Thanks, Jeffrey
I use Abbot to emulate MouseEvent in my application. It was recently updated by an Oracle employee for Java 6, JUnit 4, etc.
0.888889
Abbot emulate MouseEvent in application
Lens Cleaner Recommendations
What is, in your opinion, the best lens cleaner? Which do you think is the most effective/best value for your money/most easy to use, etc. Please include advantages/disadvantages as well as price and link.
Given that I already own these for cleaning the sensor in my DSLR, I use Eclipse optical cleaning solution, and Pec-Pad cleaning cloths. Eclipse is an extremely clean filtered methanol solution, that leaves no residue on glass and other optics. Likewise, the Pec-Pads are a woven, lint-free disposable cloth that is excellent for cleaning optics. Unlike regular lens tissue, these are very absorbent, so you are not smearing solution around the lens. These are recommended as part of the 'copperhill method' of sensor cleaning, and a bottle/100 wipe pack will last you a lifetime of sensor cleaning, meaning there is plenty left over for critical lens cleaning. Note that I use these products primarily in the home, prior to a shoot, or after a shoot. In the field, I use a lens brush, and a microfiber cloth for emergency purposes. I prefer to NOT touch the lens in any fashion in the field, but sometimes you can not avoid or prevent it. Response to question below about blower: Yes I do use and recommend a blower, and it can indeed be a useful addition to your bag. I recommend the Giottos Rocket Blower, as it is inexpensive, and it has a filter on the intake, which helps reduce dust being blasted out of the blower onto your equipment. Note however that they can be kinda bulky, and its usually one of the first things to get tossed out of the bag if I am traveling light. Also, don't over think this: your mouth makes a workable blower in a pinch, and is dust free, though not necessarily liquid free (see cleaner above).
1
Eclipse optical cleaning solution and Pec-Pad cleaning cloths
CASTING attributes for Ordering on a Doctrine2 DQL Query
I am trying to get Doctrine2 Entities, ordered by their ID which apparently is a String even though it contains only Numbers. So what I would like to do is something like this: SELECT entity1, cast (entity1.id AS integer) AS orderId FROM Namespace\Bla\MyEntity ORDER BY orderId Is there a way to do something like this in Doctrine2? Or, what would be the best practise to get my Result if i can't change the type of the id (due to customer requirements of course)? Attention: I am not asking SQL Code, i am asking for a Doctrine2 Solution, preferably in DQL
You should be able to add your own function to implement this feature. The class would look something like this: namespace MyProject\Query; use Doctrine\ORM\Query\AST\Functions\FunctionNode; use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; class CastAsInteger extends FunctionNode { public $stringPrimary; public function getSql(SqlWalker $sqlWalker) { return 'CAST(' . $this->stringPrimary->dispatch($sqlWalker) . ' AS integer)'; } public function parse(Parser $parser) { $parser->match(Lexer::T_IDENTIFIER); $parser->match(Lexer::T_OPEN_PARENTHESIS); $this->stringPrimary = $parser->StringPrimary(); $parser->match(Lexer::T_CLOSE_PARENTHESIS); } } You'll need to register your function: $config = $em->getConfiguration(); $config->addCustomNumericFunction('INT', 'MyProject\Query\CastAsInteger'); Then you can use it: SELECT e, INT(e.id) AS HIDDEN orderId FROM Namespace\Bla\MyEntity e ORDER BY orderId PS: By adding the HIDDEN keyword, the alias orderId won't be in the results (and is only used for ordering).
0.888889
How to add a function to your function?
Modifying a calculated column gives different errors
I have site column with the following formula: [AmountLeftToPay]/([AmountAssigned]-[AmountReleased]) The problem is the division by zero, sometimes it shows on list items #DIV/0! So I wanted to do the following: =IF([AmountAssigned]-[AmountReleased]=0; 0; [AmountLeftToPay]/([AmountAssigned]-[AmountReleased])) And it shows me the same error in all lists where its used. is not supported. /apps/xx/xx/Lists/Budgets : The formula contains a syntax error or is not supported. If I change ; with commas, The formula contains a syntax error or is not supported. so I got no clue
Sharepoint bug? who knows when changing it via powershell with the same formula above it works
0.833333
Sharepoint bug?
Folder compare tool?
I'm looking for a Windows GUI tool to compare the contents of two folders and show which files are different....
I'm a little bit shocked that Total Commanders folder compare ability wasn't mentioned so far. Total Commander Features in Total Commander 8.01 now include - Two file windows side by side - Multiple language and Unicode support - Enhanced search function - Compare files (now with editor) / synchronize directories
1
Total Commanders folder compare ability not mentioned so far .
When to use layoutSubview in iOS
I am writing iOS application for iPad that require custom layout. The layout from portrait and landscape are totally difference, so it can't be solve by using UIAutoResizingMask. I try to use the layoutSubview Method, but I detected that layout subview is called a lot (from UIScrollView). How can i reduce the layoutSubview call to optimize the code , or I should call it by my self when ever the device is rotated. Thank.
Speaking from experience I would personally only adjust your layout based upon deviceDidRotateSelector notifications. I have an updatePortrait method and an updateLandscape method and call whichever is necessary.
0.777778
Configure layout based on deviceDidRotateSelector notifications
Adding seconds to mysql DateTime via php
Im trying to add 12 seconds to a mysql datetime object via php. My php code generates the following query: "UPDATE Stats SET Usage = 1970-01-01 00:00:12" however the query fails. My php code is as follows: public function UpdateTime($diffrence) { $seconds = $diffrence / 1000; mysql_connect('localhost','user','pass') or die("Unable to select host"); mysql_select_db('StatDB') or die("Unable to select database"); $query = "SELECT * FROM Stats"; $result=mysql_query($query); $retVal = mysql_result($result,0,"Usage"); $oldTime = new DateTime($retVal); $oldTime->modify('+'. $seconds .' seconds'); $from = date("Y-m-d H:i:s", strtotime($oldTime->format('Y-m-d H:i:s'))); $query2 = "UPDATE Stats SET Usage = $from"; echo $query2; $result2=mysql_query($query2); mysql_close(); } Does anyone how I can fix this? Thanks
Try: $query2 = "UPDATE `Stats` SET `Usage` = '$from'"; 'Usage' is a reserved word in MySQL: http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html
0.888889
'Usage' in MySQL
Why are magnetic fields so much weaker than electric?
In EM radiation, the magnetic field is $ 3*10^8$ times smaller than the electric field, but is it valid to say it's "weaker". These fields have different units, so I don't think you can compare them, but even so it seems like we only interact with the electric field of EM radiation, not the magnetic field. Why is this?
As you already indicated, physical units need to be considered. When working in SI units, the ratio of electric field strength over magnetic field strength in EM radiation equals 299 792 458 m/s, the speed of light $c$. However, the numerical value for $c$ depends on the units used. When working in units in which the speed of light $c=1$, one would conclude that both fields are equal in magnitude. A better way to look at this is to consider the energy carried by an electromagnetic wave. It turns out that the energy associated with the electric field is equal to the energy associated with the magnetic field. So in terms of energies electric and magnetic fields are equals.
0.888889
When working in SI units, the ratio of electric field strength over magnetic field strength in EM radiation equals 299 792 458
How can one link/merge/combine/associate two accounts/users? (Anonymous/unregistered/cookie or OpenID/registered)
I accidentally posted a question without being logged in with OpenID. Is there a way to associate that question with my account? Return to FAQ Index For more information, visit "I accidentally created two accounts; how do I merge them?" in the Help Center. a.k.a. How can you link an OpenID account to a cookie based account? a.k.a. How do I merge an unregistered account with a registered account a.k.a. Merging users a.k.a. How do I associate anonymous questions I’ve asked with my OpenID account? a.k.a. Is there a way to claim an unregistered user? (in case anyone searches with those terms)
To merge any two accounts, follow the procedure outlined on the "User Merge" help page. If you're into URL modification, you can just go directly to http://$site/help/merging-accounts. For example, http://stackoverflow.com/help/merging-accounts, http://english.stackexchange.com/help/merging-accounts, and so on.
0.777778
To merge accounts, follow the procedure on the "User Merge" help page
What's the difference between a plant and an animal?
Are there some living things where the distinction between plant and animal is blurry or unclear? I wouldn't know where to put something like yeast. I also thought of photosynthesis, but then I heard that some salamanders have photosynthetic cells. So, what's the difference between a plant and an animal, formally?
Yeast are neither plants nor animals; they are fungi. The old classification where things were lumped into only two buckets - plants or animals - has long since broken down. In fact, even things you might think of as plants, like algae or most seaweed are no longer classified as plants. Under the old system, plants and animals were considered kingdoms, and the latest classifications now divide the Eukaryotes into six kingdoms, but even this is poorly evidenced and facing challenge. The best method of classification is probably cladistics which is based on the evolutionary history of organisms - but even it has problems when you start considering what to do with horizontal gene transfer and endosymbiosis. Because under a cladistic view, plants and animals are defined not by their features but by their ancestors your question becomes moot, I think.
1
Yeast are neither plants nor animals; they are fungi
Rate-limiting in transition state theory
Suppose an initial state $A$ can transition to either state $C$ or state $D$. Suppose further that both of these two processes are rate-limited by a transition to the same intermediate state $B$, as follows: Note that $\Delta G_{AB}> \Delta G_{BC}>\Delta G_{BD}$. According to transition state theory, rates are determined by the rate-limiting step. So the rate of each process will be the same, \begin{align} r_{A\to C}&=r_{A\to B} \\ r_{A\to D}&=r_{A\to B} \end{align} from which it follows that the number of transitions made during some large $\Delta t$ will also be the same, \begin{align} N_{A\to C}&=r_{A\to B}\Delta t \\ N_{A\to D}&=r_{A\to B}\Delta t \end{align} However, if we were to consider the two pathways collectively then we would predict more transitions to be made to state $D$ than $B$ since $\Delta G_{BD}<\Delta G_{BC}$. How do we resolve this apparent discrepancy?
On remark: just because activation energy high/low it doesn't necessarily mean that reaction is slow or fast. You cannot tell this without the pre-exponential factor. The answer: Off course, the original statement should not applied as you do it. "According to transition state theory, rates are determined by the rate-limiting step." doesn't mean automatically that all the reaction rates are equal. A to B conversion is slow compared to other processes, is true, but still B to C and B to D are competing processes. The original statement only means that B will not build up in bigger quantities, so during the reaction all the final products (C and D together) are approximately equal with the used A after you consider stoichimetries. Edited for clarification (sorry, pretty new to LaTex): You should consider all the transformations as independent equations. Black magic is not involved, "rate determining step" and such only helps making approximations so one can solve the coupled differential equations on napkin. Example 1. Let us assume a reaction system with $A \to B \to C$. The kinetics of the system can be describe by two independent equations $A \to B$ with a corresponding $k1$ and $B \to C$ with a corresponding $k2$ To describe conversions we can get different equations: $$ \frac{d[A]}{dt} = -k1 [A] $$ $$ \frac{d[B]}{dt} = k1 [A] - k2 [B]$$ $$ \frac{d[C]}{dt} = k2 [B] $$ We see that it is already pretty messy, so assumptions like $k1 << k2$ can help. The general way is that we say, this difference in the rate constants allows us to asume $$ \frac{d[B]}{dt} \approx 0 $$. So we have pipeline, and in first approximation have that much $B \to C$ conversion going as $A \to B$. I.e. the is no "clogging" in the middle. Not much magic here. Example 2. Now what if we have e.g. two slow reactions as second step instead of one? Noting special: $A\to B$ , with $k1$, $B\to C$ , with $k2$, $B\to D$ , with $k3$ which translates to $$ \frac{d[A]}{dt} = -k1 [A] $$ $$ \frac{d[B]}{dt} = k1 [A] -( k2 [B] + k3 [B])$$ $$ \frac{d[C]}{dt} = k2 [B] $$ $$ \frac{d[D]}{dt} = k3 [B] $$ Now we have the same assumption that the first step is much slower than the others than $$ \frac{d[B]}{dt} = k1 [A] -( k2 [B] + k3 [B]) \approx 0$$ I think you can try it from here and see how the rates comes out.
0.555556
How do we calculate a reaction rate in a second step?
... finished {written/writing/to write/wrote} two compositions
I am just practising some english grammar related questions , here is the question I am confused about : Salman finished__________ two of his published compositions before his twelfth birthday. A. Written B. Writing C. To write D. Wrote Its correct answer is B. Writing. But why should we select "writing", what's the logic or rule behind it?
This is a licensing matter: each verb “licenses” or permits only specific kinds of clausal complement. The verb finish licenses gerund clauses but not infinitive or that clauses: okSalman finished writing two compositions. ∗ Salman finished to write two compositions. ∗ Salman finished that he wrote two compositions. By contrast, begin licenses both gerund and infinitive clauses: okSalman began writing two compositions. okSalman began to write two compositions. ∗ Salman began that he wrote two compositions. Linguists have strained for a couple of generations to discern a “logic or rule” behind specific licenses, but I have not seen a convincing account. It’s just an idiomatic property of individual words, and you have to learn it word-by-word. Click this licensing to see more questions involving licensing by verbs and words of other classes. ∗ marks an utterance as unacceptable
1
Licenses by verbs and words of other classes
deployment taking longer time using changesets
We currently use changesets to deploy to production for apex classes and configuration items. It is taking a long time for deployment because the validation on the production org takes a longer time to accomplish this. I know i can easily do a validation using ant to cut down the validation time but unfortunately the end user team does not allow this.Is there anything we can do to cut down the time taken to do the validate task for changesets in the production org? Buyan
It is my opinion that validating components set from eclipse takes less time than validating from web interface. If your end user team allows then you can deploy changed components by using eclipse. I recommend use of eclipse if you have some bigger validation and deployment job. For small change sets web interface is easier. And there are no shortcuts or no control over the validation or deployment time in org. As it is systematic process and depends on complexity of classes and number of components.
0.777778
Validating components set from eclipse takes less time
how to pass value from visual force page (InputField) to controller?
I have created a Vf page from which i need to fetch the value of new owner and need to save the value in property defined in controller: Following is my vf page code: <apex:pageBlockSection> <apex:InputField label="user" value="{!a.ownerid}"/> </apex:pageBlockSection> here a is object of opportunity Controller code: used one property to store the value: public string ownername {get;set;} Note: user will input the value through lookup field. Any suggestions on this?
The inputfield will have a direct binding to the a.ownerid. This binding is two-directional, so that means two things: When the page loads, the input field will be filled with a.ownerid. The reverse is also true: the value of the input field will be saved to a.ownerid. If you had a commandButton with an action that is executed on the controller, the a.ownerid will by then have the value that the user entered on the Visualforce page before the user clicked the commandButton. Update your Visualforce code like so to include that commandButton <apex:pageBlockSection> <apex:InputField label="user" value="{!a.ownerid}"/> <apex:commandButton action="{!someAction}" value="Save"/> </apex:pageBlockSection> Now you can reference a.owernid anywhere in that someAction method on the controller, and use code like this to store it to owername: public PageReferene someAction() { ownername = a.ownerid; }
0.888889
The input field will have a direct binding to the a.ownerid
Is the Power-Link designed for routine usage?
I have a Power-Link which i intended to use in emergencies (when the chain breaks and i'm far from home). Used it once, worked pretty well. Now i wonder, what if i use it permanently with my chain? My idea is that it might be convenient to quickly remove the chain, stuff it into a bowl of acetone/oil/whatever, and easily install it back onto the bike. But will the Power-Link wear out quickly (e.g. quicker than the other "links" of the chain)? I am not sure whether it was intended to be used all the time or just for emergencies.
There are several versions of SRAMs power links. The original versions were intended for reuse, and you would have no problem using them in that manner. If you have an 8 or 9 speed bike, you've got one of the original designs. If you have a ten speed SRAM drivetrain, then you need to look at the link and the model of the chain. SRAMs newest power links for 10 speed are not designed to be used more than once. They are sold in a 4 pack so that you have replacements to use. The gold power link you've pictured is either 9 speed, or one of the first 10 speed links, which is reusable. If yours is black, you have one of the newer, non reusable variety. If the chain is a PC-1071, PC-1091 or 1091r, this is the links it comes with, and while you can remove them, they need to be replaced with a fresh link each time you do. I hope that helps.
0.888889
SRAMs power links for 10 speed are not designed to be used more than once
Seven Mitzvos D'Rabanan
I heard there are 620 letters in the Aseres Hadibros which corresponds to the 613 Mitzvos of the Torah and 7 Mitzvos D'Rabanan. What are the Seven Mitzvos D'Rabanan - שבע מצוות דרבנן? Is there a easy way to remember them? Is there any disagreement as to what the seven are?
The Chinuch (p394 in this edition) gives the list below and explains each in detail! The 7 Mitzvos are: 1) Berachos - Reciting Berachos 2) Netilas Yadayim - washing your hands 3) Eruvin - allowing one to carry within an Eruv and walk further on Shabbos through an Eruv Techumin 4) Reciting Hallel on festivals 5) Ner Shabbos - Shabbos candles 6) Megilla - on Purim 7) Chanuka - lighting the Menora. There are many mnemonics for remembering them. One from Sefer Keser Torah is: אש"ר לרע"ך א - אור (חנוכה) ש - שבת (נר) ר - רנה (הלל) ל - לקריאה (מגילה) ר - רחיצה (נטילת ידיים) ע - ערובין כ - כברכותיך More can be found at wikipedia
0.888889
The Chinuch (p394) gives the list below and explains each in detail!
Should if/else statements be arranged by rareness of cases or difficulty of dealing with them?
In some code I'm writing right now, I have something like this: if (uncommon_condition) { do_something_simple(); } else { do(); something(); long(); and(); complicated(); } Part of me thinks "It's fine the way it's written. Simple cases should go first and more complicated cases should go next." But another part says: "No! The else code should go under the if, because if is for dealing with unusual cases and else is for dealing with all other cases." Which is correct or preferable?
Try to enhance readability. One way is to place the longer code block into the else part. if (s == null) // short code else // long // code // block is more readable than if (s != null) // long // code // block else // short code
0.888889
if (s == null)
Can I use Flatiron's resourceful in express?
Is it possible to use Flatiron's resourcefull (ODM) in express.js?
There's nothing in Resourceful that is specific to any other package; the readme at https://github.com/flatiron/resourceful does a good job of showing how you would use this package in any project (not just Express-based ones).
0.888889
Resourceful is not specific to any other package .
How to display large amounts of data on one page with existing tabs as navigation?
I have a web application that uses the left navigation for major functionality and tabs for displaying different information within a function. One function is to enroll in something. There are several steps, with the last step displaying a summary of your selections before you submit. (All data selected during this process needs to be shown here before you click on the Submit button.) What is the best way to display all data if tabs are already used for the steps? More tabs or using an accordion and showing one or two sections expanded and the other sections collapsed or something else?
I'm sorry, but making selections in order before submission seams so nineties! This was how the web and ERP:s worked back in the days. You should at each single selection filter results returned accordingly and not have your user play guessing game. Now go back to your development team and tell them they need to be coding for real time, right now!
0.888889
Creating selections in order before submission seams so nineties
Is there any significant ranking penalty for using 302 redirects to force HTTPS?
We have a site with: Decent ranking on certain targeted keywords. An HTTPS-only policy, which uses 302 redirects to force clients onto the secure version of any URL. Internal links using HTTPS, so there is no redirection. Some, but not all, external links from other domains use HTTPS. The rest do not and will of course be subject to the 302. Google is only indexing the HTTPS version of each URL. Even if you search specifically for the HTTP URL, only the HTTPS URL is shown in the results. Will there be any significant, immediate ranking benefit to changing our site to use 301 redirects to enforce HTTPS? Are there any statements from Google, Matt Cutts or other authorities on this specific situation? Based on my research the difference should be minimal since we are already well indexed, and our internal links are fine, so Google is not going to apply a sitewide penalty for the 302s, which are, in effect, only the first link in the chain.
The problem with 302 redirects are that they are temporary, which often results in both pages being indexed in Google - The page you are redirecting from and the page you are redirecting to. If both pages are indexed in Google then that is problem as you have a duplicate page indexed. As mentioned here: Google's page on HTTP status codes 302 (Moved temporarily). This code is similar to a 301 in that for a GET or HEAD request, it automatically forwards the requestor to a different location, but you shouldn't use it to tell the Googlebot that a page or site has moved because Googlebot will continue to crawl and index the original location. So although you mention all your internal linking will use https, but external links inevitably will be with http, so Google is going to find some http links and 302 redirects, which could result in duplicate pages being indexed. Here is video from Matt Cutts where he attempts to answer the question weather there are problems ranking sites that use https. Although he doesn't mention your question specifically, he does touch on the point that if doing this correctly, you should be using 301 redirects. Can switching to HTTPS harm ranking? So to summarise you should not be using 302 redirects to force http, you should be using 301 redirects.
0.777778
Problem with 302 redirects is that they are temporary
local AJAX-call to remote site works in Safari but not in other browsers
I am maintaining a website that uses Javascript. The script uses jQuery and loads some content from the server at which the site is normally hosted. Just for convenience while maintaining the site, I run a local copy of the site on my iMac. This works perfectly fine when I use Safari. But Firefox, Opera and Chrome refuse to work. I guess it is because of cross-domain-policy. (I couldn't test this with IE, because IE has to run in a virtual machine on my iMac, so for this reason it is not possible to access any local files) Is there a setting within Firefox and the other browsers where I can tell the browser that it is ok to ajax-load files that are located on a remote server from a local html-page with a local javascript? In a nutshell: This my html-page: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>some title</title> <link rel="stylesheet" type="text/css" href="../css/stylesheet.css"> <script src="../js/jquery-2.1.3.min.js"></script> <script src="../js/myScript.js"></script> </head> <body> <!-- some content with a div-container to receive the ajax-content --> </body> </html> This is myScript.js: var errorMsg = function (msg) { //insert the message into the html-page }; var JSONerror = function (jqXHR, textStatus, errorThrown ) { var msg = 'JSON-answer: '+jqXHR.responseText; msg += '<br>'+'JSON-Errorstatus: '+textStatus; if ($.type(errorThrown) === 'string') { msg += '<br>'+'Error: '+errorThrown; } errorMsg(msg); }; var JSONreceive = function (JSONobj, StatusString, jqXHR) { //insert the data in JSONobj into the html-page } var StartAJAX = function () { $.ajax({ url: 'http://my.domain.tld/cgi-bin/myPerlScript.pl', data: "lastID=" + lastID + '&qkz=' + Math.random(), dataType: "json", success: JSONreceive, error: JSONerror }); }; There is also an event-listener, that listens for page-scroll and resize and checks some other constraints (like: is there already an ajax-call in progress?). This listener calls StartAJAX. When it calls StartAJAX on a local copy of my page (file:///User/...) within Safari, I get the Ajax-content perfectly fine inserted into my html-document. within the other browsers i get the error-message inserted into the html-page. It is: JSON-Answer: undefined JSON-Errorstatus: error Error: Why does it work in Safari but not in Firefox, Chrome and Opera? How can I make those browsers work? (I need to test it with all browsers, because all browsers render the same html-domument differently, but I don't want to upload all files to the server after every change just to test it.) EDIT: After reading some answers, I want to make something clear, that I obviously did not make clear enough: I am searching for settings in Webbrowsers I will NOT change the settings of my remote webserver (Apache) I will NOT manipulate any files on my remote machine (.htaccess) I will NOT set up a webserver on my local iMac I will NOT change the code of the AJAX-calls in my Javascript-files I will NOT change the code of the Perl-Scripts on my remote Server I can tell you why: I am just doing a short maintainance, and i am too lazy to upload every manipulated file to the remote machine after I edited it. The settings of the webserver are fine for actual operation. I don't want to change them (and maybe forget the changes before finishing my work). Same for the scripts: Those parts that some of you want to change work fine as they are now. There is no reason to touch the Ajax-Calls, because there is nothing wrong with them in the productive environment. All I want is that those stupid browsers Firefox, Opera and Chrome behave like Safari and process the Ajax-calls correctly. BTW: Please can anyone explain what is so risky to call data via Ajax from an other domain in Firefox, Opera or Chrome while it seems to be harmless doing the same thing in Safari?
Due to the same origin policy you aren't normally able to request resources from a different domain. Try adding crossDomain: true to your AJAX request since you are trying to make a request to a different domain. $.ajax({ url: 'http://my.domain.tld/cgi-bin/myPerlScript.pl', crossDomain: true, data: "lastID=" + lastID + '&qkz=' + Math.random(), dataType: "json", success: JSONreceive, error: JSONerror });
0.888889
crossDomain: true to AJAX request
Quartz cron expression of 0/0
As a part of a input validation I was thinking whether this is a really valid cron expression and how it would executed: 0 0/0 * * * ? Quartz validation returns true org.quartz.CronExpression.isValidExpression("0 0/0 * * * ?") So, does this run all the time, never, every hour or every minute...?
You can find the result by using TriggerUtils.computeFireTimesBetween() : try { CronTriggerImpl cron = new CronTriggerImpl(); cron.setStartTime(new Date()); cron.setCronExpression("0 0/0 * * * ?"); BaseCalendar calendar = new BaseCalendar(); List<Date> result = TriggerUtils.computeFireTimesBetween(cron, calendar, new Date(),DateBuilder.futureDate(1, IntervalUnit.DAY)); for (Date date : result) { System.out.println(date); } } catch (ParseException e) { e.printStackTrace(); } and the output is : Thu Apr 05 18:00:00 CST 2012 Thu Apr 05 19:00:00 CST 2012 Thu Apr 05 20:00:00 CST 2012 Thu Apr 05 21:00:00 CST 2012 Thu Apr 05 22:00:00 CST 2012 Thu Apr 05 23:00:00 CST 2012 Fri Apr 06 00:00:00 CST 2012 Fri Apr 06 01:00:00 CST 2012 Fri Apr 06 02:00:00 CST 2012 Fri Apr 06 03:00:00 CST 2012 Fri Apr 06 04:00:00 CST 2012 ....................... So , 0 0/0 * * * ? will run at every hour at 0 mins and 0 sec.
0.555556
0 0/0 * * * ?
Update UIProgressView on UITableViewCell
At the moment I got my main tableview with cells, which are loaded from a XML and filled up. After that I can click on one cell and a detailview is loaded(xib file, loaded through code in the main tableview). On the detailview I can click a download button and some files are downloaded asynchron to the documents folder. Then I pop the view down and I see again my tableview. My idea now is to see the progress of the download in the tableview cell. I set up a uiprogressview on every cell, which is hidden on default. I now want to see the progress bar when I start the download. How can I do that? I tried something with performSelectorOnMainThread and a selector, which change the progress of my selected cell(which I assign in the main tableview). Seems to be a bad idea - didnt work. Some ideas how to do that? EDIT2: Some piece of code of my solution, ATTENTION! This is not the real code, I deleted a lot of lines for inserting here. There arent all releases etc. I think the solution is really dirty, but I didnt found a better solution for me... Some important things: cellDownloading: Array which knows every cell which is downloading at the moment progressDictionary: Knows the progress of every cell cellDictionary: Knows every cell, filled up in the cellsForRowAtIndexpath delegte of the tableview I also cant copy the whole code, because there is a lot which have nothing to do with the whole process, but I give you the important steps. My cells are created through parsing a xml, so every cell has got a setId in my case. ////////////////// // Downloader.mm ////////////////// method to download asynchron -(void)startAsynchronousDownload:(NSString*)path{ // generate notification NSMutableDictionary *userInfo = [[NSMutableDictionary alloc] init]; NSNumber *tmpSetId = [NSNumber numberWithInteger:setId]; [userInfo setObject:tmpSetId forKey:@"setId"]; NSNotification* notification = [NSNotification notificationWithName:@"downloadStackNotification" object:self userInfo:userInfo]; [[NSNotificationCenter defaultCenter] postNotification:notification]; // add some infos... NSMutableDictionary *dictionary = [[NSMutableDictionary alloc] init]; [dictionary setObject:tmpSetId forKey:@"setId"]; // perhaps more here // asynchronous download handling NSOperationQueue *queue = [NSOperationQueue alloc] init]; NSInvocationOperation *operation = [[NSInvocationOperation alloc] initWithTarget:self selector:@selector(downloadImagesWithDictionary:) object:dictionary]; // release [operation release]; [dictionary release]; [userInfo release]; } In my example the selector downloadImagesWithDictionary downloads some images, for every downloaded image I send a notification. Every stack of images have a setId in my case. [...] NSMutableDictionary *userInfo = [[NSMutableDictionary alloc] init]; NSNumber *sliceCounter = [NSNumber numberWithInt:i]; NSNumber *amount = [NSNumber numberWithInt:amountOfImages]; NSNumber *tmpSetId = [NSNumber numberWithInteger:setId]; [userInfo setObject:sliceCounter forKey:@"actualImage"]; [userInfo setObject:amount forKey:@"allImages"]; [userInfo setObject:tmpSetId forKey:@"setId"]; NSNotification* notification = [NSNotification notificationWithName:@"downloadSliceNotification" object:self userInfo:userInfo]; [[NSNotificationCenter defaultCenter] postNotification:notification ]; [...] //////////////////////////// // TableViewController.mm //////////////////////////// Now we need to get the notifications to update our tableview [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(downloadSliceNotification:) name:@"downloadSliceNotification" object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(downloadStackNotification:) name:@"downloadStackNotification" object:nil]; We need a cell dictionary to know all indexpath of our existing tableview cells. Fill them in the cellForRowAtIndexPath delegate [cellDictionary setObject:indexPath forKey:[NSString stringWithFormat:@"%d",cellSetId]]; Now we create the handler to do somehting if we got a notification First the handler if the download starts I have got a progress dictionary which knows every progress of every cell I can identify every cell by the setId - perhaps u have to change that a little bit - (void)downloadStackNotification:(NSNotification*)notification { NSDictionary *userInfo = [notification userInfo]; NSNumber *setId = [userInfo objectForKey:@"setId"]; NSNumber *progress = [NSNumber numberWithInt:0]; [progressDictionary setObject:progress forKey:[setId stringValue]]; // add cell to downloadlist [cellDownloading addObject:[setId stringValue]]; } Now for every download step(in my case one image). Calculate process and update the dictionary, get the cell to update the progress - (void)downloadSliceNotification:(NSNotification*)notification { NSDictionary *userInfo = [notification userInfo]; NSNumber *sliceCounter = [userInfo objectForKey:@"actualImage"]; NSNumber *amount = [userInfo objectForKey:@"allImages"]; NSNumber *setId = [userInfo objectForKey:@"setId"]; NSNumber *progress = [NSNumber numberWithFloat:(100/[amount floatValue])*[sliceCounter floatValue]]; [progressDictionary setObject:progress forKey:[setId stringValue]]; NSIndexPath* indexPath = [cellDictionary objectForKey:[setId stringValue]]; CustomServerCell* cell = (CustomServerCell*)[self.tableView cellForRowAtIndexPath:indexPath]; NSMutableDictionary *downloadData = [[NSMutableDictionary alloc] init]; [downloadData setObject:cell forKey:@"cell"]; [downloadData setObject:sliceCounter forKey:@"actualImage"]; [downloadData setObject:amount forKey:@"allImages"]; [self performSelectorOnMainThread:@selector(updateProgressWithDictionary:) withObject:downloadData waitUntilDone:NO]; } Update the cell -(void)updateProgressWithDictionary:(NSMutableDictionary*)downloadData { CustomServerCell* cell = (CustomServerCell*)[downloadData objectForKey:@"cell"]; NSNumber *sliceCounter = [downloadData objectForKey:@"actualImage"]; NSNumber *amount = [downloadData objectForKey:@"allImages"]; cell.progressView.hidden = FALSE; NSNumber *tmpProgress = [progressDictionary objectForKey:[NSString stringWithFormat:@"%d",cell.progressView.tag]]; cell.progressView.progress = [tmpProgress floatValue]/100; cell.statusLabel.text = [NSString stringWithFormat:@"download slice %d / %d",[sliceCounter integerValue],[amount integerValue]]; }
Try using [self performSelectorOnMainThread:@selector(updateProgressBar:) withObject: [NSNumber numberWithFloat:pr] waitUntilDone: YES] instead of progressView.progress += 0.1; // or any other number for that matter
0.777778
Try using [self performSelectorOnMainThread:@selector(updateProgressBar:) withObject
Counting vowels with consonants
I have made a program to count the number of vowels and consonants in an inputted string: Scanner in = new Scanner(System.in); System.out.print("Enter a string "); String phrase = in.nextLine(); int i, length, vowels = 0; int consonants = 0; boolean y = false; String j; length = phrase.length(); for (i = 0; i < length; i++) { j = "" + phrase.charAt(i); boolean isAVowel = "aeiou".contains(j.toLowerCase()); boolean y = "y".contains(j.toLowerCase()); if(isAVowel){ vowels++; }else if(isAVowel && y){ vowels++; consonants++; //}else if(y && !(isAVowel)){ // vowels++; }else{ consonants++; } System.out.println("The number of vowels in \"" +phrase+"\" is "+ vowels+".\n\nThe number of consonants is "+consonants+".\n\n"); When "y" is by itself it says its a consonant, it should be a vowel. Where do I state this?
There are several things going on here: j.equalsIgnoreCase("a,e,i,o,u") will check if j (a length 1 string) is the string "a,e,i,o,u", which is almost certainly not what you want (since it's always false and therefore you set y=true for every consonant). Instead, consider setting a boolean value to false at the beginning of each iteration and setting it to true in the vowel branches. Then, if that variable is true, you know that this time you saw a vowel. Or just have the else branch. You initialize y to false outside the loop, but once y is true it never gets reset, and so for each letter you will run the if (y == true) block. Right now, your system only accounts for words with 1 y and no vowels. If you enter "yyy", you'll get 1 vowel & 2 consonants. Stylistically, there are a lot of other changes you can make to make your program easier to read through and debug. Here are a few: You don't have to do "== true" when checking a bool. For example, instead of "if (y == true)" just do "if (y)". All the vowels are handled the same, so you don't need separate branches for each. For example, you could have: if (j.equalsIgnoreCase("a") || j.equalsIgnoreCase("e") || j.equalsIgnoreCase("i") || ...) { vowels++; } In fact, you can simplify this further by checking against a collection of vowel values, using a regex, or in this case, simply using contains: boolean isAVowel = "aeiou".contains(j.toLowerCase()); Consider counting y's separately, so you keep track of vowels, ys, and constants in 3 separate counters. Then, at the end you can decide whether to add ys to vowels or consonants. Finally, add a System.out.println("vowels = " + vowels + ", consonants = " + consonants + "...") to the inside of your loop during the debugging stage. This will make it a lot easier to see what is going on and where things start to go wrong.
0.777778
j.equalsIgnoreCase (a,e,i,o,u) is the string "a
How to make Drupal upload pasted links to .doc files from the internet
Let's say I have a Drupal website and I want there a function that would work like this: Paste an URL to a .doc file, so on submit Drupal downloads that file, uploads to its local server and generates a link to download from the website. I was wondering if this needs custom coding or can this be achieve with a module?
Can be achieved with Filefield Sources module. FileField Sources is an extension to the FileField module. The FileField module lets you upload files from your computer through a CCK field. The FileField Sources module expands on this ability by allowing you to select new or existing files through additional means, including: Re-use files by an auto-complete textfield Attach server-side files uploaded via FTP Transfer files from a remote server (cURL required) Paste a file directly from the clipboard (Drupal 7 only) Select existing files through the IMCE file browser
1
FileField Sources allows you to select new or existing files through additional means .
Is it ethical to profit by having my students buy my textbook?
This question was suggested to me by How can I sell my text book to my students in e-book format? which asked about the practicalities, but attracted many comments about the ethics. So this question is to ask about the ethics directly. Suppose I have written and published a textbook, and I want to use it as the text for a course I am teaching. I receive royalties from each copy of my book that is sold, so if my students are required to buy my textbook for the course, I will make some money. Is it ethical to do so? Well-reasoned opinions would be useful answers, but even more useful would be pointers to institutional policies, professional codes of ethics, etc, that address this issue. Of course, there are many ways to avoid profiting from the sale of my book to my students. If my contract with my publisher allows it, I could distribute PDFs to my students, or have the university bookstore print out copies and sell them at cost. Another approach I've heard of is to compute how much I earn in royalties on each copy, and refund that amount from my pocket to each student who buys a copy. Or, use my royalty earnings to buy pizza for the class. Certainly these are nice gestures, but I would like opinions on whether they are ethically required. Edit: To address some questions that have arisen in the comments: This question is hypothetical. I haven't published any textbooks myself and have no immediate plans to do so. In any case, my personal preference would be to make the book available to students for free, if at all possible. So I've phrased this question in the first person for rhetorical convenience only. I had intended the question to be only about the potential financial conflict of interest that could arise if I make money by assigning my own book. Some of the answers feel that it is improper for me to assign my own textbook at all, whether I make money or not, but I don't think this point of view is prevalent within the academic community. If it happens that my book (as a pithy but now-deleted comment put it) "blows", I think most would agree that my decision to assign it is pedagogically unfortunate, but not unethical. I don't literally mean that students would be required to buy the book, only that they'd be expected to have it. I might assign readings or homework problems from the book, so that the student needs access to the book in order to do them, but they could certainly achieve this by getting a used copy or borrowing from a friend. But probably most students would buy new copies anyway, since that is the most convenient way.
This is an interesting question but it involves much more than just ethics and financial considerations. It is also a matter of tradition versus more modern thinking about free material. I am currently writing a custom "book" (not to be published anytime soon) for a new course since no existing book will fit. It will be free of charge, as developmental material, until it becomes published (which will happen if I think it is any good in the end). My old advisor used his lecture notes developed over years to produce a commercial book that can be used by many but is tailored to his (in this case) course. To write materials for your own course or on your research field is quite natural. For obvious reasons such books will suit their purpose best. I think many would dream of having tailored reading materials in their courses; few have the opportunity to spend the time writing it. In many, if not most, university systems no-one will pay you for writing it so it will be done on your free time. Such books benefit the students by covering more or less exactly what the course is about. As teachers, we have probably been involved in (endless) discussions about the pros and cons of books: "this covers this material, that book covers that, but not none is perfect. So which one to chose.". The small amount of royalty from own students is not enough to make anyone rich. From this perspective, and assuming the book (and the course) is any good, I think making the issue a matter of ethics is petty. The choice is obviously to provide a book material as, for example, free pdf material or try to have it printed (which is expensive) as a regular book or as print on demand. If one want others to use the material, publishing a book puts the material "on the map". A book also carries with it prestige, not only for the author but for the department and the university. It may also signal to the student that the teacher is a "name" in the field. So there are many reasons for choosing a book but not many will first look at it as a source for revenue. So in the end, I cannot see anything wrong with using a book and receiving royalty as long as the book is good, the course is good, so that the students get the best opportunity to learn the material the course should provide.
1
Choosing a "book" for a new course is a matter of ethics and financial considerations .
Change face of plain text between double quotation marks in Emacs
I am looking for a way to highlight or use different face of quoted text in plain text. It seems that there should be a sophisticated/enhanced text mode but I cannot find it. If there isn't a easy solution, can you let me know where should I begin to write a function? Thank you very much! A noob who has been using Emacs from 19.xx
For the regexp, I think you want to exclude " itself in the string content, except when escaped. Something like this --- ", followed by either a non " or an escaped character, followed by ": \"\\([^\"]\\|\\\\\\(.\\|[\n]\\)\\)*\" But be aware that matching quotations "..." is notorious. I do exactly that in Info+, but there are a few Info nodes where this highlighting gets thrown off by the occasional lone \" or ?\" in manuals that refer to such programming constructs.
1
" itself in string content, except when escaped"