Dataset Viewer
Auto-converted to Parquet Duplicate
text
large_stringlengths
384
2.05k
rank_avg
float64
1
4.19k
rank_max
float64
1
8.21k
rank_min
float64
1
5.03k
rank_median
float64
1
4.21k
rank_by_avgsim
float64
1
4.19k
avgsim_to_github
float32
0.77
0.85
dataset
large_stringclasses
1 value
3: intent.setClass(getApplicationContext(), ListViewGroup.class); GroupActivity.this.startActivity(intent); break; case 14: intent.setClass(getApplicationContext(), ListViewGroup.class); GroupActivity.this.startActivity(intent); break; case 15: intent.setClass(getApplicationContext(), ListViewGroup.class); GroupActivity.this.startActivity(intent); break; } } }); } private List<Map<String, Object>> getlistItems() { List<Map<String, Object>> listItems = new ArrayList<Map<String, Object>>(); for(int i = 1; i<=16; i++) { Map<String, Object> map = new HashMap<String, Object>(); map.put("imageButton", R.drawable.goff1); map.put("textView", "Group"+i); map.put("imageView",R.drawable.arrow1); listItems.add(map); } return listItems; } } this is the code from Adapter: package com.test.listview; import java.util.List; import java.util.Map; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.TextView; public class ListViewAdapter extends BaseAdapter { private Context context; private List<Map<String,Object>> listItems; //group list private LayoutInflater layoutInflater; //View container protected SharedPreferences group_sp; /**Custom list control set*/ public final class ListItemView{ public ImageButton imageButton; public TextView textView; public ImageView imageView;
1
362
79
3
40
0.832941
github_plus_top10pct_by_avg
other Activity I have 16 items in listView layout.How to let every item jump to another activity.I have tried this code ,but nothing happen:( this is GroupActivity.java package com.test.listview; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import android.app.Activity; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.ListView; public class GroupActivity extends Activity{ private ListView listView; private ListViewAdapter listViewAdapter; private List<Map<String, Object>> listItems; protected SharedPreferences group_sp; @Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.group); listView=(ListView)findViewById(R.id.group1_list); listItems=getlistItems(); listViewAdapter=new ListViewAdapter(this, listItems); listView.setAdapter(listViewAdapter); listView.setTextFilterEnabled(true); listView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position,long id) { Log.i("mm", " onItemClick "); Intent intent=new Intent(); switch(position){ case 0: intent.setClass(getApplicationContext(), ListViewGroup.class); GroupActivity.this.startActivity(intent); break; case 1: intent.setClass(getApplicationContext(), ListViewGroup.class); GroupActivity.this.startActivity(intent); break; case 2: intent.setClass(getApplicationContext(), ListViewGroup.class); GroupA
2
330
30
2
208
0.81828
github_plus_top10pct_by_avg
lowed you let cell = tableView.dequeueReusableCellWithIdentifier("cell1", forIndexPath: indexPath) as! notification_cell cell.username.text = username[indexPath.row] cell.followNotif.text = notif[indexPath.row] return cell } else { //cell for commented/liked let cell = tableView.dequeueReusableCellWithIdentifier("cell3", forIndexPath: indexPath) as! notification2_cell cell.username.text = username[indexPath.row] cell.c_l_notif.text = notif[indexPath.row] return cell } } } else { let cell = tableView.dequeueReusableCellWithIdentifier("cell2", forIndexPath: indexPath) cell.textLabel?.text = "hola" return cell } } What I get when I run it is this That is the first cell is getting overwritten again. I need a way to find out which cell should be initialised at what indexPath but can't think of how. Any suggestions are welcome! A: First of all you are returning wrong cell in your cellForRowAtIndexPath try to return cell inside the if - else block, and if you want to check for p_id[indexPath.row] is "" means it is empty so you can check its length or use isEmpty function of String, There is no need to go through a loop, Also. func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell{ if(tableView==self.notifTable) { if (p_id[indexPath.row].isEmpty) { //cell for followed you let cell = tableView.dequeueReusableCellWithIdentifier("cell1", forIndexPath: indexPath) as! notification_cell cell.username.text = username[indexPath.row] cell.followNotif.text = notif[indexPath.row] return cell } els
3
449
37
5
2
0.850621
github_plus_top10pct_by_avg
} public ListViewAdapter(Context context,List<Map<String,Object>> listItems){ this.context=context; layoutInflater=LayoutInflater.from(context);//创建视图容器设置上下文 this.listItems=listItems; } public int getCount() { return listItems.size(); } public Object getItem(int position) { return listItems.get(position); } public long getItemId(int position) { return position; } /**list settings*/ public View getView(int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub convertView=layoutInflater.inflate(R.layout.group_list, null); //get space object final ImageButton imageButton=(ImageButton)convertView.findViewById(R.id.goff1); imageButton.setBackgroundResource(R.drawable.goff1); imageButton.setOnClickListener(new View.OnClickListener() { boolean flag=true; public void onClick(View v) { if(flag){ imageButton.setBackgroundResource(R.drawable.gon1); flag=false; }else{ imageButton.setBackgroundResource(R.drawable.goff1); flag=true; } } }); TextView textView=(TextView)convertView.findViewById(R.id.title); ImageView imageView=(ImageView)convertView.findViewById(R.id.right_image); // imageView.setOnClickListener(new View.OnClickListener() { // // @Override // public void onClick(View v) { // Intent intent=new Intent(); // intent.setClass(context, ListViewGroup.class); // context.startActivity(intent); // } // }); //padding image and word imageButton.setBackgroundResource((Integer)listItems.get(position).g
4
1,083
24
4
19
0.838061
github_plus_top10pct_by_avg
0D337A56 OR 3630D387A39 OR TP(0330H750A85))': '232A3203-2', '2500T803A90 AND (TP(2523-003280) OR TP(2523-003283) OR TP(2523H873A02) OR TP(2523A396H98) OR TP(2523H639A33) OR 2523T882M53 OR 2523T995J72 OR 2523D350A03 OR 2523D072E33 OR 2523D305F86) AND (2370T869A37 OR 2375T869H29 OR 2370T869A33) AND (TP(3520T372A20) OR 3520T390A32 OR 3520-000253 OR 3520D033U92) AND NOT 3520T383T88': '333A2203-333H', '3833-000037 AND NOT TP(0330-000098)': '337A2530-8', '2530-002997 OR 2530A033S00 OR 2530A053I63 OR 2530A079H63 OR 2530A093G53 OR 2530A300L37 OR 2530A289T07 OR 2530A560E38 OR 2530A560L23 OR 2530A627A03 OR 2530A688G60 OR 2530A963A32 OR 2530H373A06 OR 2530H363A36 OR 2530H637D68 OR 2530H633G33 OR 2530H633P85 OR 2530H633Z78 OR 2530H636D33 OR 2530T323L37 OR 2530T333L03 OR 2530T537F78 OR 2530T537N36 OR 2530T537T99 OR 2530T537Y00 OR 2530T652A03 OR 2530T920W00 OR 2530T920G83 OR 2530D362G09': '337A5700-28'} A sample of opt_disp_dict_clean: opt_disp_dict_clean = {'2530T882N32': 'Accepted', 'TP(0330-000098)': 'Rejected', '2530A627A03': 'Accepted', '2530H633G33': 'Accepted', '2530A300L37': 'Rejected', '2523D072E33': 'Rejected', '3930-000322': 'Accepted', 'TP(0330-000099)': 'Rejected'} In the example, test_dict is just a subdict of opt_exp_dict_clean Without test_dict the boolean elevator would read: #Boolean-Normalize opt_disp_dict_norm = {k: (True if v == "Accepted" else False) for k, v in opt_disp_dict_clean.items()} #Replace Boolean Expressions for expression, value in opt_exp_dict_clean.items(): expression = expression.replace("XOR", "is not").replace("OR", "or").replace("AND", "and").replace("NOT", "not") #Return Values From True Expressions if eval(expression, opt_disp_dict_norm): print(value) A: Obviously, the problem is that neither IDs like 2530T882N32 nor TP(0330-000098) are valid Python variable names and thus produce a syntax error when trying to evaluate expressions with those. You could replace/remove the illegal parts and e.g. start them with a _ to make them legal variable names, but that m
5
162
55
12
null
null
github_plus_top10pct_by_avg
hat way, the actual "work" you are doing becomes simpler to express, because you know your inputs are clean and meet all your assumptions at that point. Also, note that you don't need to specify 0 as the first argument of reduce. module StringCalculator def self.add(string) verify(string) delim = delimiter(string) numerics = string.gsub(/\n/, delim).split(delim).map(&:to_i) numerics.reject { |n| n > 1000 }.reduce(:+) end ####################### ## Verification Code ####################### def self.verify(string) verify_doesnt_end_with_newline(string) verify_no_negatives(string) verify_custom_delim(string) if has_custom_delim?(string) end def self.verify_doesnt_end_with_newline(string) fail('ends in newline') if string.end_with?("\n") end def self.verify_no_negatives(string) find = string.scan(/-\d+/) fail("negatives not allowed: #{find.join(', ')}") if find.any? end def self.verify_custom_delim(string) custom_delim = get_custom_delim(string) fail("invalid delimiter: #{custom_delim}") if custom_delim =~ /[0-9]/ end ####################### ## Delimiter Utilities ####################### def self.delimiter(string) return ',' unless has_custom_delim?(string) get_custom_delim(string) end def self.has_custom_delim?(string) string[0, 2] == '//' end def self.get_custom_delim(string) string[2, 1] end private_class_method :verify, :verify_doesnt_end_with_newline, :verify_no_negatives, :verify_custom_delim, :delimiter, :has_custom_delim?, :get_custom_delim end Q: Spring Security: how to map Active Directory users to application users? I'm integrating Active Directory authentication in an existing Spring web app. At the moment user details are stored in a DB table and I implemented a custom UserDetailsService to authenticate users. Following several tutorials I implemented Active Directory support via ActiveDirectoryLdapAuthenticationProvider in my application, and it basically works, but I need someth
6
1,518
40
6
24
0.837072
github_plus_top10pct_by_avg
TML Code <div class="left" id="output1">1</div> <div class="right"> <div class="up-arrow" id="target" data-target="output1">+</div> <div class="down-arrow" id="targetdown1" data-target="output1">-</div> </div> Jquery Code $(document).ready(function(){ $('.up-arrow').click(function() { var target = $(this).attr("data-target"); var val = $('#' + target).text(function(i, val) {return val*1+1 }); }); $('.down-arrow').click(function() { var target = $(this).attr("data-target"); $('#' + target).text(function(i, val) { if (val == 0) return 0; return val*1-1 }); }); }); Fiddle Example Q: How to rewrite url like a sub domain I want to change my localhost project URL as: http://localhost/project_directory to http://project_directory.localhost and http://localhost/project_directory/backend to http://backend.project_directory.localhost Can you help me someone how to write rule in .htaccess? A: You can create a virtual host in Apache. <VirtualHost *:80> ServerName project_directory.localhost DocumentRoot "C:/public_html/project_directory" </VirtualHost> And add this line to your hosts file: 127.0.0.0 project_directory.localhost Your hosts file is located in: C:\Windows\System32\drivers\etc Edit the hosts file with Administrator rights. Q: CodeIgniter set a column value another existing column value without make a select I have a table which has columns status and new_status, so when i change status i put in new_status the new value for status. But i want to have a backup solution, so i need an update which set value for new_status value from column status. I use codeigniter, i tried $data = array( 'new_status'=>Status,//'new_status'=>'Status'//'new_status'=>`Status` ); But none above worked. A: I made a custom query and i called with $query = $this->db->query($text); and $text = "UPDATE table SET new_status = status WHERE [condition]" and it's working 100%. Q: I
7
250
94
18
38
0.833233
github_plus_top10pct_by_avg
rs, in my experience, are Read/Write and are used to give parameters to the controller. You should download a Modbus Master program from the internet, there are hundreds. The program will use the 232 port to send the modbus commands to the controller and wait for a response. A typical Modbus Master message looks like this: Read Holding Registers 100-105: Device Address Command 1st Reg Number of Registers Checksum 100 0x03 0x64 6 CRC (our starting register + 5) Q: Not getting values from jQuery loop I'm trying to get the text and the link of an element on a website using Nightmare.js and jquery. I'm looping through every element with the same class, I get no error, but the text and link are empty. Here is what I tried: nightmare .goto("https://myanimelist.net/anime/season") .wait(2000) .evaluate(() => { let links = []; $('.link-title').each(() => { item = { "title": $(this).text(), "link": $(this).attr("href") }; links.push(item); }); return links; }) .end() .then(result => { console.log(result); }) .catch(function (error) { console.error('Failed', error); }); The output in the console looks like this: [ { title: '' }, { title: '' }, { title: '' }, ... 99 more items ] A: $('.link-title').each(() => { item = { "title": $(this).text(), "link": $(this).attr("href") }; links.push(item); }); Inside each() method, use normal function instead. Arrow functions make this not work as you expected Q: Do you need to know JSTL in JSF or Spring Hi I wanted to know how important is it to learn JSTL ? I mean I could accomplish everything using scriptlet tags
8
6
59
16
127
0.823893
github_plus_top10pct_by_avg
{}** \[tab:datasetfacts\] Materials {#sec:experimental .unnumbered} ========= In this paper, we perform experiments on three datasets. While the first two datasets (WikiGame and Wikispeedia) are representatives of goal-oriented navigation scenarios (where the target node for each navigation sequence is known beforehand), the third dataset (MSNBC) is representative of free navigation on the Web (where we have no knowledge about the targets of navigation). #### Wikigame dataset This dataset is based on the online game *TheWikiGame*[^7]. The game platform offers a multiplayer game, where users navigate from a randomly selected Wikipedia page (the start page) to another randomly selected Wikipedia page (the target page). All pairs of start and target pages are connected through Wikipedia’s underlying network. The users are only allowed to click on Wikipedia links or on the browser back button to reach the target page, but they are not allowed to use search functionality. In this study, we only considered click paths of length two or more going through the main article namespace in Wikipedia. Table \[tab:datasetfacts\] shows some main characteristics of our Wikigame dataset. As motivated in Section “”, we will represent the navigational paths through Wikipedia twofold: (a) each node in a path is represented by the corresponding Wikipedia page ID – we refer to this as the *Wikigame page* dataset – and (b) each node in a path is represented by a corresponding Wikipedia category (representing a specific topic) – we call this the *Wikigame topic* dataset. For the latter dataset we determine a corresponding top level Wikipedia category[^8] in the following way. The majority of Wikipedia pages belongs to one or more Wikipedia categories. For each of these categories we find a shortest path to the top level categories and select a top level category with the shortest distance. In the case of a tie we pick a top level category uniformly at random. Finally, we replace all appearances of that page with the
9
126
130
25
null
null
github_plus_top10pct_by_avg
of pages, etc. ) I know this can be considered in DocType because it talks about wordpress, but it also deals in programming and making the workflow fast. A: Here are three (3) similar questions each with lots of answers from StackOverflow's sister site WordPress Answers: Best Collection of Code for your functions.php file Software for WordPress Theme and Plugin Development? What process do you use for WordPress development? I'll bet you'll find your questions more than answered by those three posts. Hope this helps. -Mike Q: How can i apply different background colors to each row of the parent text in tree widget using pyqt4 Here in my sample code,i want to apply the different colors for parent text of the each row in tree widget,How can i apply the background color to parent text row,i tried with Qbrush but i didn't get expected output.SocCan any one please tell me. Thank you in advance. Given below is my sample code: from PyQt4 import QtCore, QtGui class InventoryDelegate(QtGui.QStyledItemDelegate): def paint(self, painter, option, index): super(InventoryDelegate, self).paint(painter, option, index) if not index.parent().isValid(): painter.save() painter.setPen(QtGui.QPen(QtGui.QColor("green"))) r = QtCore.QRect(option.rect) r.adjust(0, 1, 0, -1) painter.drawLine(r.topLeft(), r.topRight()) painter.drawLine(r.bottomLeft(), r.bottomRight()) painter.restore() def sizeHint(self, option, index): s = super(InventoryDelegate, self).sizeHint(option, index) s.setHeight(55) return s class Inventory_Items(QtGui.QMainWindow): def __init__(self, parent=None): super(Inventory_Items, self).__init__(parent) self.inventory_dict = { "Shirt": { "Formal Blue shirt": ["10.10.1(Red)", "10.10.2(blue)"], "Discount:0%": ["300", "400"], "Unit:Quantity": ["10", "5"] }, "Frocks": {
10
1,163
46
11
243
0.816572
github_plus_top10pct_by_avg
Q: Python "and" and "or" if statement In Python is it possible for me to code this and have it work as intended? if a != None and b == None or a == None and b != None basically I want to see if either a or b is None while the other isn't A: Since it sounds like you want an xor... if (a is None) != (b is None): ... Q: Does this Infinite summation of Bessel function has a closed form? The summation is $$\sum_{n>0}\frac{J_n^2(x)}{n}\sin\frac{2n\pi}{3}$$ I found a thread Infinite sum of Bessel Functions and a wiki article here may be helpful. However, I still cannot figure this out. Also see the description of Bessel function of first kind at Mathworld, equation 61-66 may be helpful. A: Neumann's addition theorem is given by \begin{align} J_{0}\left(\sqrt{x^{2} + y^{2} - 2 x y \cos\phi}\ \right) = J_{0}(x) J_{0}(y) + 2 \sum_{n=1}^{\infty} J_{n}(x) J_{n}(y) \cos(n\phi). \end{align} By letting $y=x$ it can quickly be sen that \begin{align} J_{0}\left(2 x \sin(\phi/2) \right) = J_{0}^{2}(x) + 2 \sum_{n=1}^{\infty} J_{n}^{2}(x) \cos(n\phi). \end{align} Integrate both sides with respect to $\phi$ to obtain the expression \begin{align} \sum_{n=1}^{\infty} \frac{1}{n} \, J_{n}^{2}(x) \sin\left(\frac{2 n\pi}{3}\right) = \frac{\pi}{3} \, J_{0}^{2}(x) + \frac{1}{2}\int_{0}^{2\pi/3} J_{0}\left( 2 x \sin\left(\frac{\phi}{2}\right)\right) \, d\phi. \end{align} Q: Select max record of each group on a group by I'm using PostgreSQL. I need to select the max of each group, the situation is that the table represents the products sell on each day, and I want to know the top sold product of each day. SELECT sum(detalle_orden.cantidad) as suma,detalle_orden.producto_id as producto ,to_char(date_trunc('day',orden.fecha AT TIME ZONE 'MST'),'DY') as dia FROM detalle_orden LEFT JOIN orden ON orden.id = detalle_orden.order_id GROUP BY orden.fecha,detalle_orden.producto_id ORDER BY dia,suma desc Is returning: suma producto dia 4 1 FRI 1 2 FRI 5 3 TUE 2 2 TUE I w
11
629
63
13
985
0.796305
github_plus_top10pct_by_avg
g to find if each given ID has obtained a positive result (in this case Tails) at least once. If so, use that for the field, otherwise use Heads. StudentID | Coin | ... -------------+-----------+---------- 1 | Tails | 2 | Heads | 3 | Tails | 4 | ... | ... | ... | A: You can use a CASE WHEN statement. See if this is what you want. SELECT distinct a.StudentID, b.Coin FROM table a Join ( Select Student ID, CASE WHEN Coin = 'Tails' then 'Tails' Else 'heads' END Coin From table ) b on b.student_id = a.student_id Q: Firebase, Fabric, & Crashlytics with -ObjC linker flag without Cocoapods iOS Trying to add Firebase Messaging to my iOS app that already has Fabric/Crashlytics and I am trying to add it without Cocoapods. I followed the readme instructions in the Firebase SDK zip file and once I add the -ObjC linker flag to the target, it causes a duplicate symbol compile error for Fabric/Crashlytics I then found out to use -force_load and pointed it to the Firebase.h file. This allowed me to compile, but when trying to FIRAPP.configure() it came up with this error: 2016-11-30 14:33:31.862 Parents[243] <Debug> [Firebase/Core][I-COR000001] Configuring the default app. 2016-11-30 14:33:32.029 Parents[243:24612] +[NSData gtm_dataByGzippingData:error:]: unrecognized selector sent to class 0x3159a53c Has anyone ever experienced this before? Please note I am not using Cocoapods for all three. A: I actually had the same exact problem. My awesome coworker suggested to update Fabric and Crashlytics to the latest and it worked. Try that! Q: How to build a form with a dynamic number of inputs I want to call a function that creates a form based button with a dynamic number of hidden inputs. I'm struggling with it and hope that someone can point me in the right direction. Here is the background: I have a function that I call to return a button with a
12
1,997
12
14
1,965
0.784104
github_plus_top10pct_by_avg
river = new FirefoxDriver(); public static void main(String[] args) throws Throwable { driver.navigate().to("http://www.bloomberg.com/markets/stocks/futures"); driver.manage().window().maximize(); driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS); WebElement table = driver.findElement(By.cssSelector ("div[class='data-tables first']")); List<WebElement> irow = table.findElements (By.cssSelector("div[class='data-tables first'] tr")); System.out.println("No. of rows in the table are: " + irow.size()); File txtFile = new File ("MyFileLocation/Output.txt"); StringBuilder sb = new StringBuilder(); for(int r=0; r<irow.size(); r++) { WebElement webRow = irow.get(r); System.out.print(webRow.getText()); List<WebElement> allCells = webRow.findElements(By.xpath("th | td")); for(int c=0; c<allCells.size(); c++) { WebElement webCell = allCells.get(c); String text = webCell.getText(); System.out.print(text); sb.append(text + '\n'); } System.out.println(""); } FileWriter fw = new FileWriter(txtFile.getAbsolutePath()); BufferedWriter bw = new BufferedWriter(fw); bw.write(sb.toString()); bw.close(); end(); } public static void end() { driver.close(); driver.quit(); } } Q: Android - Program crashes when there is not input in editText fields So i'm having a problem in my code which is probably simple to solve but its my first app so cut me some slack. When I enter no values in my editText box my app crashes. Im semi aware why it occurs but I cant seem to solve it. public void onButtonClick( View v) { Double n1 , n2 , answer1; EditText e1 = (EditText) findViewById(R.id.num1); EditText e2 = (EditText) findViewById(R.id.num2); TextView t
13
376
36
7
49
0.831701
github_plus_top10pct_by_avg
$ with $a_j,b_j\in\mathbb{R},\forall j=1,\dots,d$. A: Let $U:=\cup\left\{ B_{\varepsilon}\left(q\right)\mid q\in\mathbb{Q}^{d},\varepsilon\in\mathbb{Q}_{>0},B_{\varepsilon}\left(q\right)\subset A\right\} $ Then $U\subset A$. If $a\in A$ then $B_{\delta}\left(a\right)\subset A$ for some $\delta>0$. Then $\varepsilon\in\mathbb{Q}_{>0}$ exists with $\varepsilon<\frac{1}{2}\delta$, and $q\in\mathbb{Q}^{d}$ exists with $\left\Vert a-q\right\Vert <\varepsilon$ since $\mathbb{Q}^{d}$ is dense in $\mathbb{R}^{d}$. Then $a\in B_{\varepsilon}\left(q\right)\subset B_{\delta}\left(a\right)\subset A$. This because $x\in B_{\varepsilon}\left(q\right)$ implies that: $$\left\Vert x-a\right\Vert \leq\left\Vert x-q\right\Vert +\left\Vert a-q\right\Vert <2\varepsilon<\delta$$ Note that $B_{\varepsilon}\left(q\right)\subset U$ and consequently $a\in U$. Prove is now that $A=U$. Q: Creating nested list in python for a string field I have the following input data. I can create nested list for all other fields exept the last field. The last string field can also contains space in between words(example: Hello! welcome ). input = ['a1 a2 a3 a4 Hello! welcome','b1 b2 b3 b4 how are you','c1 c2 c3 c4 you are welcome'] Current output: [['a1', 'a2', 'a3', 'a4', 'Hello!', 'welcome'], ['b1', 'b2', 'b3', 'b4', 'how', 'are', 'you'], ['c1', 'c2', 'c3', 'c4', 'you', 'are', 'welcome']] Expected output: [['a1', 'a2', 'a3', 'a4','Hello! welcome'], ['b1', 'b2', 'b3', 'b4','how are you'], ['c1', 'c2', 'c3', 'c4','you are welcome']] The below lines of code produces the current output as above but i need to convert the code to get the expected result. Can any one please let me know the way to achieve the expected result. for ix in range(len(input) ): nested.append(input[ix:ix + 1]) for i in range(len(nested)): list1.append(nested[i][0].split()) A: You can use re.split for that purpose: import re input = ['a1 a2 a3 a4 Hello! welcome','b1 b2 b3 b4 how are you','c1 c2 c3 c4 you are welcome'] res=[re.split
14
2,123
158
23
1,863
0.784941
github_plus_top10pct_by_avg
g/p/MPho12GJfc. Notice though that this will panic if any of the types in the JSON don't match. You can create a better version which returns errors in such cases. Q: Populating two types of UITableViewCell in a single UITableView I have a ViewController called notificationsVC with two tableViews - notifTable and messageTable. In notifTable I have two types of UITableViewCells - As you can see there's a followed you and commented/liked your post patterns. Until now I have been using two UITableViewCell's like this. (reuse identifier - cell1 and cell3) The first one I made a coach touch file named notification_cell.swift and another notification2_cell.swift notification_cell.swift import UIKit class notification_cell: UITableViewCell { @IBOutlet weak var profilePic: UIImageView! @IBOutlet weak var username: UILabel! @IBOutlet weak var followNotif: UILabel! } notification2_cell.swift import UIKit class notification2_cell: UITableViewCell { @IBOutlet weak var profilePic: UIImageView! @IBOutlet weak var username: UILabel! @IBOutlet weak var c_l_notif: UILabel! @IBOutlet weak var postImage: UIImageView! } I have four arrays in all - var username = [String]() var notif = [String]() var u_id = [String]() var p_id = [String]() For eg, when I do a API call I get this username-> ["Anton Griezmann", "Anonymous", "Anonymous"] u_id-> ["2", "30", "31"] notif-> ["followed you", "liked your post", "liked your post"] p_id-> ["", "9", "9"] What I'm trying to do is whenever there's a blank "" in p_id I know I have to initialise cell1 and otherwise cell3 This is my code for cellForRowAtIndexpath func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell{ var cell = UITableViewCell() var index = [Int]() if(tableView==self.notifTable) { for i in 0..<p_id.count { if p_id[indexPath.row].isEmpty { index.append(i) //cell for fol
15
1,013
34
19
6
0.843296
github_plus_top10pct_by_avg
lizacao(Location location) { if (location != null) { lat = location.getLatitude(); lng = location.getLongitude(); adicionarMarcador(lat, lng); } } LocationListener locListener = new LocationListener() { @Override public void onLocationChanged(Location location) { atualizarLocalizacao(location); } @Override public void onStatusChanged(String s, int i, Bundle bundle) { } @Override public void onProviderEnabled(String s) { } @Override public void onProviderDisabled(String s) { } }; private void minhaLocalizacao() { LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED && ContextCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) { } Location location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER); atualizarLocalizacao(location); locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 10000, 0, locListener); } } public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); for ( int resultado : grantResults){ if ( resultado == PackageManager.PERMISSION_DENIED){ alertaValidacaoPermissao(); } } } private void alertaValidacaoPermissao() { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle("Permissão"); builder.setMessage("Para usar o app você precisa aceitar as permissões "); builder.setPositiveButton
16
84
50
10
64
0.82942
github_plus_top10pct_by_avg
e { //cell for commented/liked let cell = tableView.dequeueReusableCellWithIdentifier("cell3", forIndexPath: indexPath) as! notification2_cell cell.username.text = username[indexPath.row] cell.c_l_notif.text = notif[indexPath.row] return cell } } else { let cell = tableView.dequeueReusableCellWithIdentifier("cell2", forIndexPath: indexPath) cell.textLabel?.text = "hola" return cell } } Q: Sort a python dictionary based on input value? I have a dictionary with four keys a,b,c,d with values 100,200,300,400 list1 = {'a':'100','b':'200','c':'300','d':'400'} And a variable inputs. inputs = 'c' If inputs is c. The list1 dictionary has to be sorted based on it. inputs = 'c' list1 = {'c':'300','a':'100','b':'200','d':'400'} inputs = 'b' list1 = {'b':'200','a':'100','c':'300','d':'400'} A: In Python3.7+ dict keys are stored in the insertion order k ='c' d={k:list1[k]} for key in list1: if key!=k: d[key]=list1[key] Output {'c': '300', 'a': '100', 'b': '200', 'd': '400'} A: Seems like you just want to rearrange your dict to have the chosen value at the front, then the remaining keys afterwards: dict1 = {'a':'100','b':'200','c':'300','d':'400'} key = 'c' result = {key: dict1[key], **{k: v for k, v in dict1.items() if k != key}} print(result) # {'c': '300', 'a': '100', 'b': '200', 'd': '400'} The ** simply merges the leftover filtered keys with key: dict1[key]. Q: Get the first occurance in a dictionary LINQ I have the following code where it keeps looping even after first occurrence in the code. I want to stop but I cannot apply Any in my case public List<FieldConfiguration> GetListOfProvisionsForBenefits(Dictionary<int, string> benefits) { StringBuilder sb = new StringBuilder(); sb.Append("SELECT ProvisionID ,BenefitID,ProvisionName, BPROV_Flags FROM BenefitProvisions WHERE"); int in
17
3,780
6
15
135
0.823354
github_plus_top10pct_by_avg
c{\partial Q}{ \partial x } - \frac{\partial P}{ \partial y } \mathrm{d}S $$ In your case, $$ \int_{C(0,4)^{+}} (x^{2} + y^{3}) \mathrm{d}x + (y^{4} + x^{3}) \mathrm{d}y = \iint_{D(0,4)} 3x^{2} - 3y^{2} \mathrm{d}S $$ Then using the polar coordinates (and multiplying by the Jacobian Term), we get $$ \iint_{D(0,4)} 3x^{2} - 3y^{2} \mathrm{d}S = \int_{0}^{2\pi} \int_{0}^{4} 3r^{3}(\cos^{2}(\theta) - \sin^{2}(\theta)) \mathrm{d}r \mathrm{d}\theta = 192 \int_{0}^{2\pi} \cos^{2}(\theta) - \sin^{2}(\theta) \mathrm{d}\theta $$ $$ = 192 \int_{0}^{2\pi} \cos(2 \theta) \mathrm{d} \theta = 96 \sin(2\theta) \mid_{0}^{2\pi} = 0 $$ Q: Convert GUID array to int array I'm using linq query to create my collection based on it's id which is a guid.I've an item which can be associated to 1 or more products.What I need is to show all the productnames associated to that item and other datas like name,summary,date aswell.My issue here is when i try to use the variable i which is a guid in my array it throws error that Guid cannot be converted to int.I'm very sure that I've to convert my Guid array to int array but not sure how to implement it. below is my code. foreach( Guid i in itemid) { var vals = from r in datacontext.ItemTable_s where r.itemID == i select r; ItemTable_s[] tempdata = vals.ToArray<.ItemTable_s>(); Facet[] ftemp= new Facet[tempdata.Length]; ItemImage image = null; string s1=""; for (int iv = 0; iv < tempdata.Length; iv++) { s1 += tempdata[i].productname + "\n"; } ftemp[3] = new facet("Productname",facettype.text,s1); collection.AddItem( tempdata[i].ItemName, null, null, new ItemImage(new Uri(-tempdata[i].location)) ); } In my above code tempdata[i] is where i get error msg saying guid cannot be converted to int implicitly.How do i fix this is there any other better
18
979
129
27
443
0.809616
github_plus_top10pct_by_avg
eldType = Configuration.SyncapayPlus.FieldType.Provision, Caption = (from b in benefits where(b.Key == p.BenefitID) select string.Format("{0}_{1}", b.Value, p.Name)).ToString() // to do change caption benefitname_provisionName }).ToList(); } else { return (from p in lstProvisions.GroupBy(x => x.Name) .Where(y => y.Count() > 1) .SelectMany(z => z) select new FieldConfiguration() { Name = p.Name, ProvisionFieldID = p.ID.ToString(), FieldType = Configuration.SyncapayPlus.FieldType.Provision, SourceOption = p.OptionValue.ToString(), Caption = (from b in benefits where (b.Key == p.BenefitID) select string.Format("{0}_{1}", b.Value, p.Name)).ToString() // to do change caption benefitname_provisionName }).ToList(); } } return null; } I want to apply ANY in this section where I get the caption; when I find the first benefit I want it to exit and assign it: Caption = (from b in benefits where (b.Key == p.BenefitID) select string.Format("{0}_{1}", b.Value, p.Name)).ToString() // to do change caption benefitname_provisionName }).ToList(); } A: If you know that there'll always be at least one such benefit - or you don't mind using a placeholder for a missing value - you can use something like this: Caption = string.Format("{0}_{1}", benefits.Where(b => b.Key == p.BenefitID) .Select(b => b.Value) .FirstOrDefault(), // Or First
19
168
85
37
16
0.839717
github_plus_top10pct_by_avg
or your homepage. Q: jQuery UI Draggable setting handle depending on a position range The code that follows refers to a block element that is serving as a handle (this). This element is draggable through the jQuery UI. What I'm trying to do is determine the position the handle was dropped and depending on the range "category" it's dropped in, I animate it to a point on the screen. The code works I just feel like I'm repeating myself but I don't know how to sum this up. stop: function( event, ui ) { var left = ui.position.left, position = ""; if (left >= 0 && left <= 80) { $(this).animate({left: 20}, 200); position = 1; } if (left >= 81 && left <= 198) { $(this).animate({left: 137}, 200); position = 2; } if (left >= 199 && left <= 315) { $(this).animate({left: 254}, 200); position = 3; } if (left >= 316 && left <= 430) { $(this).animate({left: 371}, 200); position = 4; } if (left >= 431 && left <= 548) { $(this).animate({left: 488}, 200); position = 5; } if (left >= 549) { $(this).animate({left: 605}, 200); position = 6; } $(content).children().fadeOut(300, "linear"); $(content).children(':nth-child('+ position +')').delay(299).fadeIn(600, "linear"); } A: //maybe something like this? stop: function( event, ui ) { var left = ui.position.left, position = []; if (left >= 0 && left <= 80) position = [20, 1]; if (left >= 81 && left <= 198) position = [137, 2]; if (left >= 199 && left <= 315) position = [254, 3]; if (left >= 316 && left <= 430) position = [371, 4]; if (left >= 431 && left <= 548) position = [488, 5]; if (left >= 549
20
4,190
77
1
154
0.82242
github_plus_top10pct_by_avg
o my own question (very similar: I need to flow vertically but constrain width horizontally), I got a quick example sort of working and maybe it gets you started with a custom layout manager: import java.awt.Component; import java.awt.Container; import java.awt.Dimension; import java.awt.LayoutManager2; import java.util.Random; import java.util.Set; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import com.google.common.collect.Sets; public class VerticalFlowLayout implements LayoutManager2 { final private Set<Component> components = Sets.newLinkedHashSet(); private int hgap = 0; private int vgap = 0; public void setHGap(int hgap) { this.hgap = hgap; } public void setVGap(int vgap) { this.vgap = vgap; } @Override public void addLayoutComponent(Component comp, Object constraints) { this.components.add(comp); } /* these 3 methods need to be overridden properly */ @Override public float getLayoutAlignmentX(Container target) { // TODO Auto-generated method stub return 0; } @Override public float getLayoutAlignmentY(Container target) { // TODO Auto-generated method stub return 0; } @Override public void invalidateLayout(Container target) { // TODO Auto-generated method stub } @Override public void addLayoutComponent(String name, Component comp) { this.components.add(comp); } @Override public void layoutContainer(Container parent) { int x = 0; int y = 0; int columnWidth = 0; for (Component c : this.components) { if (c.isVisible()) { Dimension d = c.getPreferredSize(); columnWidth = Math.max(columnWidth, d.width); if (y+d.height > parent.getHeight()) { x += columnWidth + this.hgap; y = 0; } c.setBounds(x, y, d.width, d.height); y += d.height +
21
2,505
53
17
103
0.826123
github_plus_top10pct_by_avg
closer alignment with our notion of software algorithm. The result is the actuated automaton, which mechanizes logic using structure analogous to programming language. An informal analogy between an automaton and a programming language will be proposed at the end of this section. ### Locus {#S:LOCUS} A formalization of the algorithm’s stepwise network of decisions and actions requires some means of indicating one’s place in the overall method, to track what is current and what is next. We provide this in the form of a set of loci, which serve as labels for the [locations]{} implicit in a program or algorithm. \[D:CATALOG\_OF\_LOCI\] A catalog of *loci* is a finite non-empty set $\Lambda$, each member $\lambda$ of which is called a locus. Let $\Lambda$ be a catalog of loci. A *path* is a sequence $\lbrace \lambda_n \rbrace \colon {\mathbb{N}}\to \Lambda$. ### Summary {#S:THREE_P} We now identify the components of a walk, the three fundamental P’s: - A path is a sequence in the catalog of loci $\Lambda$. - A process is a conjoint sequence in the frame space ${\mathbf{F}} = {\prod{\Psi}} \times {\prod{\Phi}}$. - A procedure is a covering sequence in the catalog of functionality ${\mathscr{F}}$. ### Auxiliary mechanisms {#S:AUXILIARY_MECHANISMS} \[D:LOCUS\_ACTUATOR\] Let ${\mathscr{F}}$ be a catalog of functionality on basis $\langle \Psi, \Phi\rangle$. An *actuator* ${\mathsf{a}}$ is a mapping ${\mathsf{a}} \colon {\prod{\Psi}} \to {\mathscr{F}}$ from the process stimulus space to the catalog of functionality. In other words, any ${\mathsf{a}} \in {\mathscr{F}}^{{\prod{\Psi}}}$ is an actuator. \[D:LOCUS\_CATALOG\_OF\_ACTUATION\] A catalog of *actuation* is a non-empty finite set ${\mathsf{A}} \subseteq {\mathscr{F}}^{{\prod{\Psi}}}$ of actuators. With each locus is associated exactly one designated actuator: \[D:LOCUS\_ACTUATOR\_DESIGNATION\] Let the *locator* be a surjective mapping $\ell \colon \Lambda \to {\mathsf{A}}$. To permit each actuator to be located, it is prerequisite that ${
22
468
174
49
1,142
0.793612
github_plus_top10pct_by_avg
.id"> <!-- Inner-Col .// --> <a href="#" @click.prevent="addToCart(product)"> <div class="box box-default pos-product-card"> <!-- /.box --> <img class="card-img-top img-responsive" :src="product.image" alt="Card image cap"> <div class="box-body"> <!-- /.box-body --> <h4 class="box-title">{{ product.name }}</h4> <!-- <p class="box-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p> --> <button class="btn btn-info"><i class="fas fa-shopping-cart"></i></button> </div> <!-- /.box-body --> </div> <!-- /.box --> </a> </div> {% for category in categories %} <div class="tab-pane fade" id="category-{{category.id}}"> <div class="row"> <!-- Inner-Row .// --> {% for product in category.product_set.all %} <div class="col-md-3" v-for="product in filteredProducts" :key="product.id"> <!-- Inner-Col .// --> <a href="#" @click.prevent="addToCart(product)"> <div class="box box-default pos-product-card"> <!-- /.box --> <img class="card-img-top img-responsive" :src="product.image" alt="Card image cap"> <div class="box-body"> <!-- /.box-body --> <h4 class="box-title">{{ product.name }}</h4> <!-- <p class="box-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p> --> <button class="btn btn-info"><i class="fas fa-shopping-cart"></i></button> </div> <!-- /.box-body --> </div> <!-- /.box --> </a> </div> {% endfor %} <table class="table table-hover text-center">
23
1,432
7
26
191
0.819449
github_plus_top10pct_by_avg
t data.](CMMM2020-6427305.001){#fig1} ![Encapsulate algorithm\'s output of attention-meditation relationship.](CMMM2020-6427305.002){#fig2} ![Flow diagram of optimization process.](CMMM2020-6427305.003){#fig3} ![(a) Upper bound and (b) lower bound of attention-meditation relationship.](CMMM2020-6427305.004){#fig4} ![The raw data fluctuates with blink.](CMMM2020-6427305.005){#fig5} ![50 groups of attention value randomly extracted in (a) game and (b) study (scenarios after big packet optimization).](CMMM2020-6427305.006){#fig6} ![Proportion of the seven levels of attention in (a) study and (b) game.](CMMM2020-6427305.007){#fig7} ![Raw data processing logic.](CMMM2020-6427305.alg.001){#alg1} ![Big packet optimization logic.](CMMM2020-6427305.alg.002){#alg2} ![Small packet optimization logic.](CMMM2020-6427305.alg.003){#alg3} ###### Threshold of wave value after regularizing. Wave name Delta Theta LowAlpha HighAlpha LowBeta HighBeta LowGamma MidGamma ---------------------------------- ------- ------- ---------- ----------- --------- ---------- ---------- ---------- Threshold value (regularization) 0.635 0.610 0.640 0.600 0.615 0.605 0.620 0.630 ###### Region segmentation of blink frequency. Frequency (second/once) Region Attention management ------------------------- ------------------- ----------------------------- \<2 Invalid area None 2-4.81 Normal area Plus 10 4.81-6.51 Focus area Plus (10 + frequency × 0.8) 6.51-8.33 Highly focus area Plus (10 + frequency × 1.5) \>8.33 Invalid area None ###### Attention classification method. Attention level Null value region Boundary Attention range Meditation upper boundary Meditation lower boundary ----------------- ------------------- ---------- ----------------- --------------------------- ---------------------
24
2,364
198
9
null
null
github_plus_top10pct_by_avg
AND b2.entity = b1.entity ) as previous_period_value from table1 as b1 The table is this: +--------+-------------------+-------+ | entity | submission period | value | +--------+-------------------+-------+ | ABC1 | Jan-19 | 2 | | ABC2 | Jan-19 | 3 | | ABC3 | Jan-19 | 4 | | ABC1 | Feb-19 | 8 | | ABC2 | Feb-19 | 11 | | ABC3 | Feb-19 | 11 | | ABC1 | Mar-19 | 6 | | ABC2 | Mar-19 | 43 | | ABC3 | Mar-19 | 6 | | ABC1 | Apr-19 | 73 | | ABC2 | Apr-19 | 2 | | ABC3 | Apr-19 | 6 | +--------+-------------------+-------+ Expected result: +--------+-------------------+-----------------+-------+-----------------------+ | entity | submission period | previous_period | value | previous_period_value | +--------+-------------------+-----------------+-------+-----------------------+ | ABC1 | Jan-19 | null | 2 | null | | ABC2 | Jan-19 | null | 3 | null | | ABC3 | Jan-19 | null | 4 | null | | ABC1 | Feb-19 | Jan-19 | 8 | 2 | | ABC2 | Feb-19 | Jan-19 | 11 | 3 | | ABC3 | Feb-19 | Jan-19 | 11 | 4 | | ABC1 | Mar-19 | Feb-19 | 6 | 8 | | ABC2 | Mar-19 | Feb-19 | 43 | 11 | | ABC3 | Mar-19 | Feb-19 | 6 | 11 | | ABC1 | Apr-19 | Mar-19 | 73 | 6 | | ABC2 | Apr-19 | Mar-19 | 2 | 43 | | ABC3 | Apr-19 | Mar-19 | 6 | 6 | +--------+-------------------+-----------------+-------+-----------------------+ A: You ap
25
3,897
120
42
null
null
github_plus_top10pct_by_avg
cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { l? var selectedStatus:String let cell = tableView.dequeueReusableCellWithIdentifier("Cell") as! UITableViewCell /***/ var task:Task if tableView == self.searchDisplayController!.searchResultsTableView { task = filteredTasks[indexPath.row] cell.textLabel?.text = task.titolo cell.detailTextLabel?.textColor = Settings.decideColor(task.priorita) cell.detailTextLabel?.text = task.priorita return cell } switch indexPath.section { case 0: /*let cell = tableView.dequeueReusableCellWithIdentifier("OpenTasks", forIndexPath: indexPath) as! UITableViewCell*/ selectedStatus = "Aperti" break case 1: /*let cell = tableView.dequeueReusableCellWithIdentifier("ClosedTasks", forIndexPath: indexPath) as! UITableViewCell*/ selectedStatus = "Chiusi" break case 2: /*let cell = tableView.dequeueReusableCellWithIdentifier("ExpiredTasks", forIndexPath: indexPath) as! UITableViewCell*/ selectedStatus = "Scaduti" break case 3: /*let cell = tableView.dequeueReusableCellWithIdentifier("SuspendedTasks", forIndexPath: indexPath) as! UITableViewCell*/ selectedStatus = "Sospesi" break default: /*let cell = tableView.dequeueReusableCellWithIdentifier("", forIndexPath: indexPath) as! UITableViewCell*/ selectedStatus = "" break } task = self.organizedTasks.items[selectedStatus]![indexPath.row] cell.textLabel?.text = task.titolo cell.detailTextLabel?.textColor = Settings.decideColor(task.priorita) cell.detailTextLabel?.text = task.priorita retur
26
3,290
64
22
44
0.832154
github_plus_top10pct_by_avg
ctBID()){ //set objectA.get(i).setobjectAName(objectB.get(j).getobjectBName()); } } } Your POJO must be in java like this: Object A public class objectA { private int objectAID; private String objectAName; //generate getters and setters........ } Object B public class objectB { private int objectBID; private String objectBName; //generate getters and setters........ } Q: Why can't I execute a function whithin anonymous plpg block? Version: postgreSQL 9.3 I've written the following procedure: CREATE OR REPLACE FUNCTION drop_if_exists(table_name name, schema_name name) RETURNS integer AS $$ BEGIN IF(SELECT EXISTS( SELECT * FROM pg_class c JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace WHERE relname = table_name AND nspname = schema_name ) as ex) = true THEN execute 'DROP TABLE ' || schema_name || '.' || table_name; RETURN 1; ELSE RETURN 0; END IF; END $$ LANGUAGE plpgsql; DO $$ BEGIN drop_if_exists('ords', 'public'); --ERROR: syntax error at or near drop_if_exists" END $$ LANGUAGE plpgsql; What's a problem with that code? A: Missing perform is one. Didn't check for other errors. perform drop_if_exists(... Q: Using MS Access VBA Function using Query in VB6 I have defined a Function in MS Access database. I am using that function in Query. I saved that query as "Query1". This query runs successfully in MS Access. But, when I call the same query from VB (using ADO), it is giving me error: Run-time error '-2147217900 (80040e14)': Undefined function 'Concatenate' in expression. Below is the code I use to access "Query1": rs.Open "Select * From Query1", CN1, 2, 2 If Not rs.EOF Then 'Get Data End If rs.Close A: You cannot use user defined functions (UDFs) outside of Access. Q: How can I merge my Unity Scene using Unity Smart Merge? I am trying to merge a Unity scene my partner and I have been working on, using Smart Merg
27
659
5
32
857
0.798826
github_plus_top10pct_by_avg
\lvert{{\mathsf{A}}}\rvert} \leq {\lvert{\Lambda}\rvert}$ (the number of actuators is less than or equal to the number of loci). \[D:JUMP\_FUNCTION\] Let $\Lambda$ be a catalog of loci. The *jump* function is a mapping $\Delta \colon \Lambda \times {\prod{\Psi}} \to \Lambda$. ### Actuated automaton {#S:ACTUATED_AUTOMATON} \[D:ACTUATED\_AUTOMATON\] The structure ${\mathfrak{A}} = \langle \Psi, \Phi, {\mathscr{F}}\!, {\mathsf{A}}, \Lambda, \ell, \Delta \rangle$ of an *actuated* automaton consists of seven synchronized catalogs: a basis $\langle \Psi, \Phi \rangle$ with catalog of functionality ${\mathscr{F}}$, catalog of actuation ${\mathsf{A}}$, catalog of loci $\Lambda$, locator function $\ell$, and jump function $\Delta$. Automata exist in many varieties. Since the actuated automaton occupies the entire present scope of interest, we forgo mandatory use of the qualifier [actuated.]{} ### Programming language analogy {#S:LANGUAGE_ANALOGY} The automaton $\langle \Psi, \Phi, {\mathscr{F}}\!, {\mathsf{A}}, \Lambda, \ell, \Delta \rangle$ of definition \[D:ACTUATED\_AUTOMATON\] resembles an algorithm written in an elementary programming language. The following comprise the analogy: - the generating ensemble $\Phi$ of the persistent state space represents ordinary program variables; - the remainder ensemble $\Psi \setminus \Phi$ represents volatile external inputs, such as sensors; - functionalities of the catalog ${\mathscr{F}}$ represent blocks of program assignment statements; - actuators in ${\mathsf{A}}$ implement if-then-elsif-else decisions, - the jump function $\Delta$ is a [goto]{} indicating the next point of execution, and - loci in $\Lambda$ are labels serving as [goto-able]{} points of execution. Iteration --------- While leaving undefined the notion of a step in an algorithm, we do formalize it for the automaton. Identifying a step space leads to defining iterative operators, and hence to iteration. ### Step space {#S:STEP_SPACE} The step space underlies automata. It is formed b
28
1,699
143
51
1,175
0.793173
github_plus_top10pct_by_avg
atching = UsersCategoriesAssn::find() ->select('userID') ->distinct(true) ->joinWith('userCategory') ->andWhere(['IN', 'usersCategories.id', $this->catNameSearch]) ->groupBy('userTable.userID') ->having('COUNT(userTable.userID) ='.count($this->catNameSearch)); There is propably no other way to filter IN operator to match all values in MySQL. Q: $a^2 + b^2 + c^2 = 3$, prove that $a + b + c \ge ab + bc + ac$ Let $a$, $b$ and $c$ be positive numbers such that $a^2 + b^2 + c^2 = 3$. Prove that: $$a + b + c \ge ab + bc + ac.$$ Using AM-GM inequality I proved, that $ab + bc + ac \le 3$ I have no idea about moving forward. Any help is appreciated! A: You have $$(a+b+c)^2 \geq 3(ab+bc+ca) = (a^2+b^2+c^2)(ab+bc+ca) \geq (ab+bc+ca)^2$$ So, $$a+b+c\geq ab+bc+ca.$$ Q: django NameError: name 'os' is not defined When I try to follow this tutorial to install google-auth2 on my django 1.4 I get this error: Traceback (most recent call last): File "./manage.py", line 11, in import settings File "/home/ubuntu/xx/settings.py", line 140, in GOOGLE_OAUTH2_CLIENT_ID = os.environ['GOOGLE_OAUTH2_CLIENT_ID'] NameError: name 'os' is not defined this line is: 139- LOGIN_REDIRECT_URL = '/' 140- GOOGLE_OAUTH2_CLIENT_ID = os.environ['GOOGLE_OAUTH2_CLIENT_ID'] 141- GOOGLE_OAUTH2_CLIENT_SECRET = os.environ['GOOGLE_OAUTH2_CLIENT_SECRET'] 142- GOOGLE_WHITE_LISTED_DOMAINS = ['mydomain.org'] SOCIAL_AUTH_USER_MODEL = 'auth.User' Any ideas? Thanks [Edit] Solved - a few other issues are in the comments. A: You try to use something from module os, which is not imported, thus you cannot use it -> add its import somewhere at the beggining of 'settings.py': import os edit: if you don't have GOOGLE_OAUTH2_CLIENT_ID in os.environ, don't load it from there, set it directly in settings.py instead: GOOGLE_OAUTH2_CLIENT_ID = 'your-actual-client-id-value' Q: Prometheus error - Error on ingesting samples I am getting following error in Prometheus on monitoring my Node JS base
29
86
32
33
20
0.838046
github_plus_top10pct_by_avg
H693T57 OR 3533H873H98) AND NOT (3630H693H66 OR 3630D387A39)', 'NOT (TP(0330-000098) OR TP(0330H750A85))'] test_dict = dict((k, opt_exp_dict_clean[k]) for k in test_expressions if k in opt_exp_dict_clean) print(test_dict) {'(3530A338A58 OR 3533A500H65 OR 3533-555A57 OR 3533A593A36 OR 3533A637A60 OR 3533A636A67 OR 3533A637D30 OR 3533H370A53 OR 3533H370T63 OR 3533H693H95 OR 3533H693T57 OR 3533H873H98) AND NOT (3630H693H66 OR 3630D387A39)': '535A8300-503', 'NOT (TP(0330-000098) OR TP(0330H750A85))': '336A5305-3'} #Boolean-Normalize opt_disp_dict_norm = {k: (True if v == "Accepted" else False) for k, v in opt_disp_dict_clean.items()} #Replace Boolean Expressions for expression, value in test_dict.items(): expression = expression.replace("XOR", "is not").replace("OR", "or").replace("AND", "and").replace("NOT", "not") #Return Values From True Expressions if eval(expression, opt_disp_dict_norm): print(value) Which returns File "<string>", line 1 (3530A338A58 or 3533A500H65 or 3533-555A57 or 3533A593A36 or 3533A637A60 or 3533A636A67 or 3533A637D30 or 3533H370A53 or 3533H370T63 or 3533H693H95 or 3533H693T57 or 3533H873H98) and not (3630H693H66 or 3630D387A39) ^ SyntaxError: invalid syntax And 'NOT (TP(0330-000098) OR TP(0330H750A85))' returns: File "<string>", line 1 not (TP(0330-000098) or TP(0330H750A85)) ^ SyntaxError: invalid token I believe it is a problem with the format of my terms since this approach works for a generic case (below). How can I make these terms "evaluation friendly" for python? The terms are called "options" that are alphanumeric and () and - are the only special characters. Generic case: dict1 = {'((A OR D OR E) AND F) AND NOT G': 'Pickles', '(A AND B) OR E': 'Tuna', '(NOT G) AND (A OR B OR C OR D OR E)': 'Salami'} dict2 = {'A': 'Accepted', 'B': 'Rejected', 'C': 'Rejected', 'D': 'Accepted', 'E': 'Rejected', 'F': 'Accepted', 'G': 'Rejected', 'Z': 'Accepted'} #Boolean-Normalize dict2_norm = {k: (True if v == "Accepted" el
30
4,586
27
8
295
0.814491
github_plus_top10pct_by_avg
ing dependencies at every node? I tried to run a simple app in a distributed manner to test failover-takeover features but failed. What I want to: The application is myapp_api with a rest api, it has myapp application as a dependency. I want to start myapp_api on 3 nodes, I want the whole app (myapp_api + myapp) to be working only at one node at the same time. What is wrong: The main app (myapp_api) works as expected: only at one node with failover and takeover. But for some reason depended myapp always starts at every node. I want it to be working only at one node at the same time. What I do: My config for the first node as an example. [ {kernel, [{distributed, [{myapp_api, 1000, ['n1@myhost', {'n2@myhost', 'n3@myhost'}]}]}, {sync_nodes_optional, ['n2@myhost', 'n3@myhost']}, {sync_nodes_timeout, 5000} ]} ]. I call erl -sname nI -config nI.config -pa apps/*/ebin deps/*/ebin -s myapp_api at every node. A: Now this gets a bit confusing because you say: I want to start myapp_api on 3 nodes, I want the whole app (myapp_api + myapp) to be working only at one node at the same time. and you add: The main app (myapp_api) works as expected: only at one node with failover and takeover. But for some reason depended myapp always starts at every node. In the first paragraph you say myapp_api should run everywhere, on the second quote you say it works as intended by booting on one node at a time. I'll be assuming here that you want the whole set-up to be a failover, not just the top-level app and I just got confused on the first paragraph. The config file you use shows what happens: [{kernel, [{distributed, [{myapp_api, 1000, ['n1@myhost', {'n2@myhost', 'n3@myhost'}]}]}, {sync_nodes_optional, ['n2@myhost', 'n3@myhost']}, {sync_nodes_timeout, 5000} ]}]. The important bit is that myapp_api has the nodes ['n1@myhost', {'n2@myhost', 'n3@myhost'}] defined. This order means it runs on n1@myhost in top priority, and then on the other nodes with equal priority i
31
139
118
71
439
0.809729
github_plus_top10pct_by_avg
Fig. \[fig.2\]. ![The reflectionless radial exactly solvable potential $V_{2}(r)$ with the barrier. Continuous change of its shape at variation of $C$ ($\gamma_{n}=6$, $r_{0}=0.5$) \[fig.2\]](f32a.eps "fig:"){width="80mm"} ![The reflectionless radial exactly solvable potential $V_{2}(r)$ with the barrier. Continuous change of its shape at variation of $C$ ($\gamma_{n}=6$, $r_{0}=0.5$) \[fig.2\]](f32b.eps "fig:"){width="80mm"} An analysis of wave functions \[sec.3.2\] ----------------------------------------- ### Wave functions for the reflectionless inverse power potential \[sec.3.2.1\] Let’s find a radial wave function describing the scattering of the particle on the inverse power reflectionless potential (\[eq.3.1.5\]) at $l=0$. For the potential $V_{1}(r)$ with zero value of (\[eq.3.1.4\]) one can write its radial wave function (for arbitrary energy level concerned with wave vector $k$) at $l=0$ by such a way (at $\beta=\alpha$): $$\chi_{l=0}^{(1)}(k,r) = \bar{N}_{1} (e^{-ikr} - S_{l=0}^{(1)} e^{ikr}). \label{eq.3.2.1.1}$$ Then, one can find a radial wave function at $l=0$ for the reflectionless potential $V_{2}(r)$ of (\[eq.3.1.5\]) (for the energy level corresponding to the wave vector $k$) on the basis of the second expression of (\[eq.2.3.6\]). Taking into account (\[eq.2.1.4\]) and (\[eq.2.4.9\]), we obtain: $$\begin{array}{lcl} \chi_{l=0}^{(2)}(k,r) & = & \displaystyle\frac{1}{N_{2}} A_{1} \chi_{l=0}^{(1)}(k,r) = \displaystyle\frac{\bar{N}_{1}}{N_{2}} \biggl( \alpha\displaystyle\frac{d}{dr} + W(r) \biggr) \Bigl(e^{-ikr} - S_{l=0}^{(1)} e^{ikr}\Bigl) = \\ % & = & % i\displaystyle\frac{\bar{N}_{1}}{k\alpha N_{2}} % \biggl[ % \biggl( 1 + \displaystyle\frac{iW(r)}{k\alpha} \biggr) % e^{-ikr} - % S_{l=0}^{(2)} % \biggl( 1 - \displaystyle\frac{iW(r)}{k\alpha} \biggr) % e^{ikr} % \biggr] = \\ & = & \chi_{l=0}^{(-)}(k,r) - S_{l=0}^{(2)}\chi_{l=0}^{(+)}(k,r), \end{array} \label{eq.3.2.1.2}$$ where $$\chi_{l=0}^{(
32
783
150
63
1,753
0.785964
github_plus_top10pct_by_avg
ing more specific. Instead of mapping AD groups to application roles, I need to map AD users to existing users in my web app. In other words I want to enable AD authentication only for users in my Users table. A user can access via AD credentials ONLY IF is already registered in application DB. Authorization info for each user are stored in DB. This way, each user can be authenticated both via DB user+password or via AD. Is it possible to achieve this with Spring Security? and how? NOTE I'm using Spring v 3.2.9 and Spring Security v 3.2.3 A: As a workaround I implementend a custom AuthenticationProvider and a custom UserDetailsContextMapper. Becouse ActiveDirectoryLdapAuthenticationProvider is a final class I implemented the ADCustomAuthenticationProvider via composition, this way: public class ADCustomAuthenticationProvider implements AuthenticationProvider { @Autowired private ActiveDirectoryLdapAuthenticationProvider adAuthProvider; @Autowired private UserDao uDao; @Override @Transactional(propagation = Propagation.REQUIRES_NEW) public Authentication authenticate(Authentication authentication) throws AuthenticationException { String principal = authentication.getPrincipal().toString(); String username = principal.split("@")[0]; User utente = uDao.findByUsername(username); if (utente == null) { throw new ADUnregisteredUserAuthenticationException("user [" + principal + "] is not registered"); } return adAuthProvider.authenticate(authentication); } @Override public boolean supports(Class<?> authentication) { return adAuthProvider.supports(authentication); } } In the mapper I extended LdapUserDetailsMapper implementing only mapUserFromContext method. public class ADCustomUserDetailsContextMapper extends LdapUserDetailsMapper { @Autowired private UserDetailsService userDetailsService; // ... the service used for DB authentication @Override public
33
58
84
24
43
0.832614
github_plus_top10pct_by_avg
r Step 3, the statistical properties of $\hat{\theta}$ under the different model specification and estimation options were assessed by summarizing the 1000 results obtained using the following metrics: mean percentage (%) bias, empirical standard error (SE), MSE, coverage (separately for each CI method), convergence, and mean run time (separately for each CI method). Additionally, we considered the median percentage bias in the heterogeneity (τ ^2^) of the true treatment effects also. Definitions of these performance measures are provided in Web Appendix A. ### 3.1.2. Extended set of 38 scenarios changing number of trials, participants, between‐trial distributions, and data generating mechanisms {#sim7930-sec-0009} The base case scenario defined in Section [3.1.1](#sim7930-sec-0008){ref-type="sec"} was extended to further settings, leading to an extensive range of 38 scenarios in total (see Table [1](#sim7930-tbl-0001){ref-type="table"}), which we now summarize. ###### Summary of the different simulation scenarios\* Scenario Data Generation Details Modification From Base Case Scenario --------------- ------------------------------------------------------------------------------------ ------------------------------------------------------------------------------- **Base Case** \(i\) Number of trials, K = 10 ‐ \(ii\) Number of participants in trial i, n ~i~ = 100 (fixed across all trials) \(iii\) Fixed treatment exposure of 50% \(iv\) θ = −9.66 (summary treatment effect; negative value favors treatment group) \(v\) τ ^2^ = 7.79 (between trial variation in θ) \(vi\) β = 159.73 (mean response in control group) \(vii\) τ ~**β**~ ^2
34
1,849
239
21
null
null
github_plus_top10pct_by_avg
on wrong somewhere. A: The upper boundary of your 1st integral should be $\infty$ instead of $2\pi$. Effectively the part above $2\pi$ in your first integral cancels out with the 2nd integral, resulting in a single integral. Q: Move an IWeb Element from one list to another and comparing their count using Selenium ? Objective is to create a automated test for QA which asserts that one List is different from another by the count of elements/items which they possess by using the Selenium WebDriver. This is the webpage for getting the lists : http://demoqa.com/sortable/ and then Connect Lists This is the code : [Test] //Arrange _driver = new ChromeDriver(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)); _driver.Navigate().GoToUrl("http://demoqa.com/sortable/"); List<IWebElement> sortableListOne = _driver.FindElements(By.Id("sortable1")).ToList(); IWebElement sortableListOneFifth = _driver.FindElement(By.XPath(@"//*[@id=""sortable1""]/li[5]")); List<IWebElement> sortableListTwo = _driver.FindElements(By.Id("sortable2")).ToList(); IWebElement sortableListTwoForth = _driver.FindElement(By.XPath(@"//*[@id=""sortable2""]/li[4]")); //Act Actions action = new Actions(_driver); action.DragAndDrop(SortableListOneFifth, SortableListTwoForth) .Perform(); So i tried : //Assert var list1 = _sortPage.SortableListOne.Count; var list2 = _sortPage.SortableListTwo.Count; list1.Should().NotBe(list2); The error message : Message: Did not expect list1 to be 1. Both lists are returning the count of 1 so they are always the same and not returning the IWeb elements of lists. Do i need to create a for cycle to iterate each list ? Ideas on how to proceed ? A: It looks sortableListOne and sortableListTwo WebElements are identified using id and only one matched elements are found and hence it is returning as 1. Please find the sortableListOne and sortableListTwo WebElements using the xpath as below and it Code: List<IWebElement> sortableListOne =
35
488
23
36
139
0.823149
github_plus_top10pct_by_avg
CSS file, allowing you to determine what the changes are and add them to your Sass file. Save the edited CSS file as FileA.css. Recompile your Sass file into FileB.css Load files FileA.css and FileB.css into a diff viewer, something like DiffChecker or a desktop app like Kaleidoscope. Determine the changes and add the appropriate Sass to your original .sass file. Q: List item inside model always null on post - Asp.net MVC I am trying to post model which contains List<> item looks like below: public class AddSubscriptionPlanModel { public AddSubscriptionPlanModel() { AllFeatures = new List<Feature>(); } public int Id { get; set; } public int SubscriptionPlanId { get; set; } public int SubscriptionId { get; set; } public string Name { get; set; } public bool IsActive { get; set; } [Display(Name = "No Of Users")] public int? NoOfUsers { get; set; } [Display(Name = "Duration Type")] public DurationType DurationType { get; set; } public int Duration { get; set; } public decimal Amount { get; set; } public int SubscriptionPlanTrailId { get; set; } public int FeatureId { get; set; } public DateTime CreatedDateUtc { get; set; } public DateTime LastUpdatedUtc { get; set; } public int CreatedBy { get; set; } public int LastUpdatedBy { get; set; } public List<Feature> AllFeatures { get; set; } } I am populating all required fields on get method and feeding List from database public ActionResult Mapping(int id) { var features = FeatureManager.GetAllFeatures(); var model = new Ejyle.DevAccelerate.Web.App.Models.SubscriptionPlan.AddSubscriptionPlanModel(); model.AllFeatures = features; model.Id = id; model.SubscriptionId = id; model.NoOfUsers = 20; model.SubscriptionPlanId = 1; model.SubscriptionPlanTrailId = 1; model.Amount = 1000; model.CreatedBy = 1; model.LastUpdatedBy = 1; model.FeatureId = 1; model.Duration = 20; return View(model); } And my view code
36
128
83
52
1,041
0.795299
github_plus_top10pct_by_avg
els at EAL 6 and EAL 7 of CC. The SKPP enforces PIFP with requirements at the gross partition level as well as at the granularity of individual subjects and resources. A subset of the exported resources are active and are commonly referred to as *subjects*. Flows occur between a subject and a resource, and between the subject’s partition and the resource’s partition, in a direction defined by a *mode*. In *read* mode, the subject is the destination of the flow. In *write* mode the subject is the source of the flow. [[[Fig.]{}]{}]{} \[fig:skpp\] illustrates an allocation of TOE (Target of Evaluation, a concept in CC) resources. The resources inside of each rectangle are bound to that partition. Allowed information flows are indicated by the directed arrows. For instance, Subject 2 is allowed to write Resource 6 and Subject 3 is allowed to read Resource 9. By this policy abstraction, subjects in a partition can have different access rights to resources in another partition. Resources 7, 8 and 10 illustrate this finer grained control of information flows. ![Allocation of TOE Resources [@SKPP07][]{data-label="fig:skpp"}](FCS-14226-fig2.pdf){width="3.0in"} SKPP defines a partition-to-partition policy ($P2P_p$) and a subject-to-resource ($S2R_p$) policy (also known as a *least privilege policy*). Flow rules, P2P and S2R, are associated with each policy: $$\begin{aligned} &S2R: [s:subject, r:resource, m:mode] \\ &P2P: [sub\_p: partition, res\_p: partition, m: mode] \end{aligned}$$ The PIFP policy of SKPP is: $$\begin{aligned} AL&LOWED([s: subject, r: resource, m: mode]) = \\ & \begin{aligned} S2&R_p \in sys.policy \rightarrow (\\ &S2R(s,r).m=allow \ \vee \\ &(S2R(s,r).m=null \wedge P2P(s.p,r.p).m=allow) \\ \end{aligned}\\ &) \ \wedge \ P2P_p \in sys.policy \rightarrow P2P(s.p,r.p).m=allow \\ \end{aligned}$$ where $sys.policy$ indicates which policies are configured to be active. In the $S2R_p$ policy, the $S2R$ rules override the $P2P$ rules everywhere except there is a null entry in the $S2R$ rule set. Note
37
96
789
74
368
0.811856
github_plus_top10pct_by_avg
roblem. Otherwise it doesn't hold. Q: How to get store object from existing store object in ExtJs I am using ExjJs 4.2 .I have two grids displaying different data. In one javascript file i have to include both the grids. I am loading the store for the first grid like var store = Ext.create('Ext.data.Store', { model: 'Writer.Person', autoLoad: true, proxy: { type: 'ajax', url : 'findPatientRecordAction', reader: { type: 'json', successProperty: 'success', root: 'data', messageProperty: 'message' }, writer: { type: 'json', encode: true, root: 'data' }, fields: ['id','notes', 'startDate', 'endDate'], }, }); The JSON object store looks like this : "data":[{"id":35,"notes":"hiii","startDate":"2013-04-30","endDate":"2013-05-02"}]} , "details":[{"id":14,"document":"docpath12345","date":"2013-04-28"}] Actually the first grid will display only the 'data' part of JSON and the second grid will display the 'details' part of JSON. So ideally i should not load the store object again for the second grid(what i am doing now).I want to declare one more store type variable and reuse value of 'store' (the 'documents' part of store) to become the store for second grid as I am loading the second store as of now like this var store2 = Ext.create('Ext.data.Store', { model: 'Writer.Document', autoLoad: true, proxy: { type: 'ajax', url : 'findPatientRecordAction', reader: { type: 'json', successProperty: 'success', root: 'details',
38
1,298
89
50
233
0.816971
github_plus_top10pct_by_avg
lete, the question once it's been answered. See also Close all the typo questions Q: Route-Me: Alpstein fork - Customize cluster icon and display cluster count I am using Route-Me: Alpstein fork for developing an iOS app. The original Route-Me/Mapbox code had an option to customize the cluster icon and also the the cluster count. I've been looking for a way to do this with the Route-Me: Alpstein fork. Something similar to this: - (RMMapLayer *)mapView:(RMMapView *)mapView layerForAnnotation:(RMAnnotation *)annotation { if (annotation.isUserLocationAnnotation) return nil; RMMapLayer *layer = nil; if (annotation.isClusterAnnotation) { layer = [[RMMarker alloc] initWithUIImage:[UIImage imageNamed:@"circle.png"]]; layer.opacity = 0.75; layer.bounds = CGRectMake(0, 0, 75, 75); [(RMMarker *)layer setTextForegroundColor:[UIColor whiteColor]]; [(RMMarker *)layer changeLabelUsingText:[NSString stringWithFormat:@"%i", [annotation.clusteredAnnotations count]]]; } else { layer = [[RMMarker alloc] initWithMapboxMarkerImage]; } return layer; } I cannot see 'isClusterAnnotation' defined anywhere in the source. How can I achieve the same results using the Route-Me: Alpstein fork? Any help would be greatly appreciated. A: In my project I used the following, inside the mapView:layerForAnnotation: method of the map delegate: if ([annotation.annotationType isEqualToString:@"RMClusterAnnotation"]) { UIImage *clusterImage = [UIImage imageNamed:@"foo.png"]; RMMarker *newMarker = [[RMMarker alloc] initWithUIImage:clusterImage]; // this is how I managed to count the annotations inside a cluster NSInteger annotationsInCluster = [((RMQuadTreeNode *)annotation.userInfo).annotations count]; // you can add a label to the annotation with the number of clustered annotations [newMarker changeLabelUsingText: [NSString stringWithFormat:@"%i", annotationsInCluster]]; return newMarker; } Hope this
39
2,213
28
44
39
0.833223
github_plus_top10pct_by_avg
lso supports our free energy conjecture; our calculation of $\sigma_8$ would be very different if $\beta=3$, say, was used instead of $\beta=2$. With $\alpha_\Lambda=1.51$ so close to the experimental lower bound for $\alpha_\Lambda$ of $1.35$, direct measurement of $\alpha_\Lambda$ may also be possible in the near future. Interestingly, $\Omega_m-\Omega_{B} = 0.196_{-0.026}^{+0.025}$ is nearly equal to $\Omega_{\hbox{\scriptsize asymp}}$ in value. Correspondingly, $\Omega_B$ [@WMAP] is nearly equal to $\Omega_{\hbox{\scriptsize Dyn}}$. It would be tempting to identify $\Omega_{\hbox{\scriptsize asymp}}$ with $\Omega_m-\Omega_B$, especially since matter in $\rho_{\hbox{\scriptsize{asymp}}}(r)$ is not “visible” to inferred-mass measurements. That $\Omega_{\hbox{\scriptsize Dyn}}$ would then be identified with $\Omega_B$ is consistent with the fact that most of the mass inferred through gravitational dynamics are indeed made up of baryons. We did not differentiate between normal and dark matter in our theory, however. Without a specific mechanism funneling nonbaryonic matter into $\rho_{\hbox{\scriptsize{asymp}}}$ and baryonic matter into $\rho-\rho_{\hbox{\scriptsize{asymp}}}$, we cannot at this point rule out the possibility that $\Omega_m-\Omega_B=\Omega_{\hbox{\scriptsize{asymp}}}$ and $\Omega_B\approx\Omega_{\hbox{\scriptsize Dyn}}$ is a numerical accident. The author would like to thank John Garrison for his numerous suggestions, comments, and generous support during this research. He would also like to thank K.-W. Ng H. T. Cho and Clifford Richardson for their helpful criticisms. [21]{} natexlab\#1[\#1]{}bibnamefont \#1[\#1]{}bibfnamefont \#1[\#1]{}citenamefont \#1[\#1]{}url \#1[`#1`]{}urlprefix\[2\][\#2]{} \[2\]\[\][[\#2](#2)]{} , [ ]{}, [ ]{}, [ ]{}, [ ]{}, [ ]{}, [ ]{}, [ ]{}, [ ]{}, [ ]{}, [ ]{}, [ ]{}, [ ]{}, [ ]{}, [ ]{}, [ ]{}, [ ]{}, [ ]{}, [ ]{}, , ****, (). , [ ]{}, [ ]{}, [ ]{}, [ ]{}, [ ]{}, [ ]{}, [ ]{}, [ ]{}, [ ]{}, [ ]{}, [ ]{}, [ ]{}, [ ]{}, [�
40
731
418
65
4,121
0.767982
github_plus_top10pct_by_avg
de esta * clase. * * @param name | Nombre del KeyStore. * @param password | Contraseña para proteger el KeyStore. */ public void createKeyStore(String name, String password) { try { KeyStore createKeyStore = KeyStore.getInstance(KeyStore.getDefaultType()); createKeyStore.load(null, password.toCharArray()); try (FileOutputStream fileOutputStream = new FileOutputStream(name)) { createKeyStore.store(fileOutputStream, password.toCharArray()); fileOutputStream.close(); } catch (Exception ex) { } } catch (IOException | KeyStoreException | NoSuchAlgorithmException | CertificateException ex) { } } /** * Carga un KeyStore y almacena la instancia en la propiedad keyStore de * esta clase. * * @param name | Nombre del KeyStore. * @param password | Contraseña para proteger el KeyStore. */ public void loadKeyStore(String name, String password) { try { this.keyStore = KeyStore.getInstance("JKS"); try (FileInputStream fileInputStream = new FileInputStream(name)) { this.keyStore.load(fileInputStream, password.toCharArray()); } } catch (KeyStoreException | IOException | NoSuchAlgorithmException | CertificateException ex) { } } /** * Guarda una clave privada en el keyStore. El KeyStore debe estar cargado. * * @param alias | Alias para almacenar la clave privada. * @param password | Contraseña para almacenar la clave privada. * @param privateKey | PrivateKey a almacenar. * @param x509Certificate | Certificado para guardar la clave privada. */ public void savePrivateKey(String alias, String password, PrivateKey privateKey, X509Certificate x509Certificate) { Certificate[] certificate = new Certificate[1]; certificate[0] = (Certificate) x509Certificate; try { this.keyStore.setKeyEntry(a
41
8
60
31
447
0.809554
github_plus_top10pct_by_avg
hings First, setup the app: var app = angular.module('myApp', [ 'ui.router' ]); Next, configure the app with the various states. You can use angular-ui-router's $stateParams service to expose any parameters in the url, which can be handy if you need to fetch any data from a resource/service: app.config(function($stateProvider, $urlRouterProvider) { // for any unknown routes, default to the '/things' url $urlRouterProvider.otherwise('/things') $stateProvider .state('things', { url: '/things', templateUrl: 'things.html', controller: function($scope, $state) { // add items to the scope $scope.items = ['Thing 1', 'Thing 2', 'Thing 3']; // create an action that will change the state $scope.goToDetails = function(scope) { $state.go('details', { x: scope.item }) } } }) // create the details state .state('details', { url: '^/things/:x', templateUrl: 'details.html', controller: function($scope, $stateParams) { // use $stateParams service $scope.data = 'I am ' + $stateParams.x } }); }); Hopefully this helps and please let me know if you have any questions! Q: Is it possible for a visitor on a Schengen visa to have the visa extended under extenuating circumstances? A friend of mine travelled to France on a Schengen Visa as she was already pregnant to a French national. They plan to marry but are having problems with the relevant paperwork, including having the paperwork translated into French. The baby is due in March and the Schengen visa expires in February. Can the Schengen visa be extended on the grounds of the late stage of pregnancy? Can they get married in France under these circumstances, in other words, can she be granted a Temporary Resident's Permit without leaving France? A: This is a very nuanced question and I don't think anybody here is going to be qualified enough to answer it definitively. According to the French government, under no circumstances
42
120
110
43
null
null
github_plus_top10pct_by_avg
terial cost reduction potential.^\[^ [^55^](#amp210060-bib-0055){ref-type="ref"} ^\]^ Besides the manufacturing costs, the final sale price of the vaccine is also expected to include R&D costs, costs of clinical trials, marketing and supply chain costs and a profit margin. ###### Parameters influencing RNA vaccine production performance and cost +------------------------------------------------------------------+------------------+-------------+---------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Parameter | Range | Unit | Influencing and determining factors | Reference | +:=================================================================+:=================+:============+:==============================================================+:============================================================================================================================================================================+ | RNA amount per dose | 0.1‐10 for saRNA | μg/dose | Clinical trials | [3](#amp210060-bib-0003){ref-type="ref"}, [10](#amp210060-bib-0010){ref-type="ref"}, [11](#amp210060-bib-0011){ref-type="ref"}, [54](#amp210060-bib-0054){ref-type="ref"} α | | | | | |
43
295
184
88
null
null
github_plus_top10pct_by_avg
{ PublicKey publicKey = null; try { Certificate certificate = this.keyStore.getCertificate(alias); publicKey = certificate.getPublicKey(); } catch (KeyStoreException ex) { } return publicKey; } } Y estas son las llamadas que hago. EncryptionRSA encryptionRSA = new EncryptionRSA(); encryptionRSA.buildParKey(); X509Certificate x509Certificate = encryptionRSA.generateX509Certificate(email); KeyStoreManager keyStoreManager = new KeyStoreManager(); keyStoreManager.createKeyStore(email, password); keyStoreManager.loadKeyStore(email, password); keyStoreManager.savePrivateKey(alias, password, encryptionRSA.getPrivateKey(), x509Certificate); keyStoreManager.saveCertificate(alias, x509Certificate); El problema que tengo es que me crea el javakeystore bien, pero cuando compruebo si ha guardado la clave privada y el certificado, me aparece como un jks vacío (decir que lo compruebo desde consola con keytool). Adjunto los metodos para cear el certificado. public X509Certificate generateX509Certificate(String subjectDN) { X509Certificate x509Certificate = null; try { Provider provider = new BouncyCastleProvider(); Security.addProvider(provider); long now = System.currentTimeMillis(); Date startDate = new Date(now); // X500Name dnName = new X500Name(subjectDN); X500Name dnName = new X500Name("C = DE, O = Organiztion"); BigInteger certSerialNumber = new BigInteger(Long.toString(now)); Calendar calendar = Calendar.getInstance(); calendar.setTime(startDate); calendar.add(Calendar.YEAR, 1); Date endDate = calendar.getTime(); String signatureAlgorithm = "SHA512WithRSA"; ContentSigner contentSigner = new JcaContentSignerBuilder(signatureAlgorithm).build(this.privateKey); JcaX509v3CertificateBuilder certBuilder = new JcaX509v3CertificateBuilder
44
995
13
28
504
0.807664
github_plus_top10pct_by_avg
et("imageButton")); textView.setText((String)listItems.get(position).get("textView")); imageView.setBackgroundResource((Integer)listItems.get(position).get("imageView")); //addListener(convertView); return convertView; } } Could anyone help me out this?thank you. A: if you want to start same activity on onItemClick then no need to use switch case for starting new activity on every row click just change your code as: listView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view , int position,long id) { Log.i("mm", " onItemClick "); Intent intent=new Intent(GroupActivity.this,ListViewGroup.class); GroupActivity.this.startActivity(intent); } }); Q: Convert dot to ascii: nested subgraph not recognized by Graph::Easy::Parser::Graphviz? I'm trying go-callvis to visualize call graph of a Go program: go-callvis -debug -group pkg -format dot github.com/syncthing/syncthing/cmd/stindex Output: https://gist.github.com/quantonganh/d2052370bfcae6b1788465c9b5dcffd9 From this output, I want to convert to ASCII art instead of an image by using graph-easy: ❯ graph-easy syncthing-cmd-stindex.dot Warning: Ignoring unknown attribute 'lheight' for class graph at /Library/Perl/5.18/Graph/Easy/Parser.pm line 1302. Warning: Ignoring unknown attribute 'lwidth' for class graph at /Library/Perl/5.18/Graph/Easy/Parser.pm line 1302. Warning: Ignoring unknown attribute 'pad' for class graph at /Library/Perl/5.18/Graph/Easy/Parser.pm line 1302. Warning: Ignoring unknown attribute 'penwidth' for class graph at /Library/Perl/5.18/Graph/Easy/Parser.pm line 1302. Warning: Ignoring unknown attribute 'penwidth' for class node at /Library/Perl/5.18/Graph/Easy/Parser.pm line 1302. Warning: Ignoring unknown attribute 'lheight' for class graph at /Library/Perl/5.18/Graph/Easy/Parser.pm line 1302. Warning: Ignoring unknown attribute 'lwidth' for class gra
45
223
41
29
56
0.830621
github_plus_top10pct_by_avg
ot what I need. A: The problem is that you place inputChars[x] into matrix[row][column] based on the outcome of a condition, but x is incremented unconditionally: for (int row = 0; row < matrix.length; row++, x++) { // ^^^ Replacing unconditional increment in the loop with a conditional increment on assignment should fix this problem: for (int row = 0; row < matrix.length; row++) { ... matrix[row][column] = Character.toString(inputChars[x++]); ... } Q: C++ how to identify unsigned types? Let's say I want to write an absolute value function for every type. Something like: template <class T> T MyAbsVersion(T num) { return (num > 0) ? num : num*-1; } However, I'd like to decline numbers of type unsigned. Any good way to do that? Thanks A: Use std::is_signed to accept numbers of only signed type template<class T , typename std::enable_if< std::is_signed<T>::value >::type* = nullptr > T myabs(T num) { return (num > 0) ? num : num*-1; } Demo Here Q: How do i get facebook album id from url? Im trying to publish to an album on a facebook page (I can post to the wall no problem - i have all the permissions). The Facebook graph API says the album id is the value of aid. But the url looks like: https://www.facebook.com/media/set/?set=a.531274833612778.1073741825.193687907371474&type=3 So what is the album id? A: For the sake of this question having an answer (I missed out @CBroe comment the first time I landed here). The album ID is the first number right between a. and the next following . (dot). In this case: 531274833612778 Q: split views.py into multiple files I am having some trouble splitting my views.py file into multiple files in a views folder. I tried the methods from this question, but I keep getting an error message. file structure: users/ __init__.py urls.py views/ __init__.py sign_in_out_up.py urls.py: from users import views as user urlpatterns = patterns('', url(r'^signup/', user.sig
46
11
104
55
374
0.811695
github_plus_top10pct_by_avg
$. The other constraints are identities, which all members of ${\mathbb{S}}$ satisfy – in other words, $Q_2 = Q_3 = {\mathbb{S}}$. The general solution is $Q = Q_1 \cap Q_2 \cap Q_3 = Q_1 \cap {\mathbb{S}} \cap {\mathbb{S}} = Q_1$, or $Q = \lbrace (\lambda, {\mathit{f}}, (\psi, \phi)) \in {\mathbb{S}} \colon \lambda_0 = \Delta(\lambda, \psi) \rbrace$. An understandable abuse of terminology says that the solution set is $\lambda_0 = \Delta(\lambda, \psi)$, which is technically a constraining equation. Cone {#S:CONE_SECTION} ---- A cone is a construct prepared with the iterative converse of an actuated automaton. It consists of all finite backwards walks converging to a given point. The term [cone]{} is more ideologic than geometric. ### Description {#S:CONE_DESCRIPTION} The actuated automaton possesses a non-deterministic[^4] converse relation. See §\[S:ITERATIVE\_CONVERSE\]. A collection of reverse walks is realized through repetitive re-application of the converse, converging to a designated *crux* step. These iterative chains may be localized (trimmed to finite length) by enforcing some stopping criterion. This construction results in the cone, a structured set of possible localized walks eventually leading to the crux step. The starting points of such walks are known as *precursor* steps of the crux step. ### Inductive generation {#S:CONE_GENERATION} Let ${\mathbb{S}}$ be a step space containing crux step ${\mathit{s}}_{\text{crux}}$. Suppose $V \colon {\mathbb{S}} \to {\mathbb{S}}$ is an iterative operator with converse $\tilde{V} \colon {\mathbb{S}} \to {\mathscr{P}({{\mathbb{S}}})}$. (base clause) Let base protoset $G_\heartsuit^{(0)} = \lbrace {\mathit{s}}_\text{crux} \rbrace$ be the $0^{\text{th}}$ predecessor generation of ${\mathit{s}}_{\text{crux}}$. (inductive clause) The ${(n+1)}^{\text{st}}$ generation predecessors are defined in terms of the $n^{\text{th}}$ generation: $$G_\heartsuit^{(n+1)} = \bigcup_{{\mathit{s}} \in G_\heartsuit^{(n)}} \tilde{V}({\mathit{s}}).$$ This definition
47
1,415
207
73
1,499
0.788819
github_plus_top10pct_by_avg
self.allSprites = pygame.sprite.Group() self.obstacles = pygame.sprite.Group() def new(self): # create a new game # add obstacles to list for i in range(OBSTICLES_AMOUNT): Obstacle(self.allSprites, self.obstacles) while self.running: self.allSprites.update() for e in pygame.event.get(): if e.type == pygame.QUIT: self.running = False self.draw() self.clock.tick(60) def draw(self): self.screen.fill(WHITE) self.allSprites.draw(self.screen) for sprites in self.obstacles: sprites.update() pygame.display.update() if __name__ == '__main__': Game().new() Q: Pascal IDE for Mac OS X i'm a beginner Pascal programmer and I recently migrated to the Mac OS X. Today I spent many hours searching for a good Pascal IDE for this OS and found nothing. I used to write code with Geany on Windows and it worked like a charm, I also enjoyed the compiling and running capacity of Geany. Do you know any Geany-like IDE or at least one that highlights, compiles and runs pascal code on the Mac OS X? Thank you very much! A: Let's try Lazarus, integrated development environment for Free Pascal. http://www.lazarus.freepascal.org/ A: People use XCode with a suitable set of templates, but XCode lost pascal syntax highlighting a way back. There are other options: Pascal Gladiator Lightweight IDE But I also still like Lazarus best. Q: How to fix when someone edits css output of an existing sass file A person directly edited the css output file. Am I in trouble here? He made edits all throughout the file and if I'm understanding correctly, my changes will overwrite his when I recompile. Is there anyway to keep everything but still work in my scss files? Could I take the entire css file and try the reverse css to scss path to get everything together? A: One option would be to save the edited CSS file and then compare it to your compiled
48
1,590
254
78
405
0.810712
github_plus_top10pct_by_avg
dom}{\beta}}}$. This concludes $\prod\Theta \not= \prod\Phi$ for sub-case A2. The proofs for subordinate cases of B are the same as A, reversing the roles of $\Theta$ and $\Phi$. Taken together, these sub-case analyses show that exhaustively $\Theta \not= \Phi$ implies $\prod\Theta \not= \prod\Phi$. By contraposition, $\Theta = \Phi$ if $\prod\Theta = \prod\Phi$. \[T:SPACE\_BIJECTION\_ENSEMBLE\] Choice spaces and generating ensembles are in one-to-one correspondence via the general Cartesian product. Theorem \[T:ENSEMBLE\_UNIQ\_SPACE\] asserts that any ensemble generates only one unique choice space, and \[T:SPACE\_UNIQ\_ENSEMBLE\] asserts that any choice space has only one unique generating ensemble. \[N:CARTESIAN\_PRODUCT\_INVERSE\] By Theorem \[T:SPACE\_BIJECTION\_ENSEMBLE\], the Cartesian product is invertible, providing a mapping from choice spaces to generating ensembles. There is need for a symbol designating this inverse. In preference to $\prod^{-1}$, for present purpose we borrow the coproduct symbol $\coprod$ from another field, since there is no danger of confusion. \[D:FINITE\_CHOICE\_SPACE\] A *finite* choice space is a choice space (definition \[D:CHOICE\_SPACE\]) whose generating ensemble has a finite index set. ### Dyadic Operators {#S:DYADIC_OPERATORS} This section presents binary operators on ensembles and choice spaces whose intended usage will value notational compactness. To this end these operators will be displayed through dyadic notation, which indicates an operator application implicitly by simple juxtaposition of the operator’s arguments, forgoing explicit rendering of the operation’s symbol as a prefix, infix, or suffix. For reason of denotational style, these operators will be called products despite that they suggest sums. \[D:DYADIC\_ENSEMBLE\_PRODUCT\] Let $\Theta$ and $\Phi$ be disjoint (definition \[D:DISJOINT\_ENSEMBLES\]) ensembles. The dyadic product $(\Theta,\Phi) \mapsto \Theta\Phi$ is $$\Theta\Phi = \Theta \cup \Phi.$$ An immediate consequence of this definitio
49
1,403
213
82
null
null
github_plus_top10pct_by_avg
ted, and can be expressed either as $p^{-1}\{0,1\} = \{0,1\} \times \mathbb R = (\{0\} \times \mathbb R) \cup (\{1\} \times \mathbb R)$. Also, the whole vertical strip $p^{-1}[0,1] = [0,1] \times \mathbb R$ is saturated. Regarding your very final question, the expression $p^{-1}(b)$ represents a different subset of $X$ for each different value of $b \in Y$. In my example, for $b=0$ we have $p^{-1}(b) = p^{-1}(0) = \{0\} \times \mathbb R$, whereas for $b=1$ we have $p^{-1}(b) = p^{-1}(1) = \{1\} \times \mathbb R$. A: $A \subseteq X$ is saturated for an equivalence relation $R$ on $X$, if $x \in A$ and $xRy$ implies $y \in A$ too. So if $A$ contains a member of an equivalence class it contains all of the class. This sort of explains the name: it "absorbs" with every point all its equivalent points as well: such a set is a union of classes. If $q:X \to X/{R}$ is the map associated with that relation, so $q(x)$ is the class that $x$ belongs to, this translates to: if $A \cap q^{-1}(y)$ is non-empty (so $A$ intersects the class $y$) it contains that whole class $q^{-1}(y)$.. A quotient map is just the canonical map for its induces equivalence relation $xRx'$ iff $q(x)=q(x')$. We can also say that $A$ is saturated iff $A=q^{-1}[q[A]]$, which is in formulaic form what I said at the beginning. Q: SQL Previous Record Query using multiple columns I am trying to create a table that has both the current value in and the previous months value using an SQL query in Power BI. I'm querying a Redshift database through ODBC. However I cannot get the result I am expecting... The code below shows the current idea (I have tried many tweaks on this but this is the closest I can get). select entity, DateAdd(mm,-1,CAST('01-' + "submission period" AS Date)) AS "submission period", value, DateAdd(mm,-2,CAST('01-' + "submission period" AS Date)) as previous_period, ( select TOP 1 value from table1 b2 where DateAdd(mm,-2,CAST('01-' + b2."submission period" AS Date)) = CAST('01-' + b1."submission period" as Date)
50
4,059
71
38
1,448
0.789414
github_plus_top10pct_by_avg
p.Name); I'd advise you not to mix and match your query expressions and dot notation so much though - it's quite confusing at the moment. Q: the dialog desn't show correctly when it's created in sub-thread I'm trying to add a pop-up message function in my project.And I make it run in a subthread since I need a realtime notification.But I find if the notification dialog is created in my subthread(started by AfxBeginThread),all the elements(buttons,urls....) of the dialog are not shown.The message box is just a blank dialog. If I extract the function and start it by a button then it works fine.Here's the function,it's quite simple. UINT sendNotification(LPVOID pParam) { int x = GetSystemMetrics(SM_CXSCREEN); int y = GetSystemMetrics(SM_CYSCREEN); testPopDlg *testPop = new testPopDlg; testPop->Create(IDD_TEST,0); CRect lprect(0,0,0,0); testPop->GetWindowRect(lprect); int w = lprect.Width(); int h = lprect.Height(); testPop->web.Navigate("http://www.google.com",NULL,NULL,NULL,NULL); testPop->ShowWindow(SW_SHOW); for(int k=0;k<20;k++) //slide out { testPop->MoveWindow(x-w,y-h*k/20,w,y-h*k/20,1); Sleep(20); } Sleep(5000); //will close after 5 sec return 0; } Why this function doesn't work right in subthread? A: To use a dialog on a different thread in MFC you should create it on a UI thread. To create a UI thread you basically have to create a class derived from CWinThread. See also this code project article. Q: Proof strategy - Borel $\sigma-$fields How does one go about proving the following: Every open set $A$ in the topological space $(\mathbb{R}^d,\|\cdot\|)$ (with the norm topology) is the union of all the open balls $B_\epsilon(q)$ whose center $q$ and radius $\epsilon>0$ are rational. In fact, the result that I'm aiming at is to show that $\mathcal{B}(\mathbb{R}^d)$, i.e. the Borel $\sigma-$field in $\mathbb{R}^d,d<\infty$ is the $\sigma-$field generated by the class of sets that are of the form $$O:=\times_{j=1}^d(a_j,b_j]$
51
220
138
30
232
0.816977
github_plus_top10pct_by_avg
ile Path (or Anything Else) in VS 2005 Title Bar You just have to add a little Visual Basic macro to the EvironmentEvents macro section and restart Visual Studio. Note: The path will not show up when you first load Visual Studio, but it will whenever you change which file you are viewing. There is probably a way to fix this, but it doesn't seem like a big deal. A: Check out the latest release of VSCommands 2010 Lite. It introduced a feature called Friendly Solution Name where you can set it to display the solution file path (or any part of it) in Visual Studio's main window title. More details: http://vscommands.com/releasenotes/3.6.8.0 and http://vscommands.com/releasenotes/3.6.9.0 Q: Simple brute forcer not working I am trying to write a very simple brute forcer to try to crack a password protected zip file. The password for the file is "red". import zipfile; zfile = zipfile.ZipFile('password_archive.zip') words = open('/usr/share/dict/words') for word in words.readlines(): try: password = word.strip('/n') zfile.extractall(pwd=password) print "Password found: "+ password exit(0) except Exception, e: print e Console: ('Bad password for file', <zipfile.ZipInfo object at 0x1004ca500>) ('Bad password for file', <zipfile.ZipInfo object at 0x1004ca500>) ('Bad password for file', <zipfile.ZipInfo object at 0x1004ca500>) ('Bad password for file', <zipfile.ZipInfo object at 0x1004ca500>) ('Bad password for file', <zipfile.ZipInfo object at 0x1004ca500>) ('Bad password for file', <zipfile.ZipInfo object at 0x1004ca500>) ('Bad password for file', <zipfile.ZipInfo object at 0x1004ca500>) ('Bad password for file', <zipfile.ZipInfo object at 0x1004ca500>) Password found: Abasgi Not really sure what is going on here. Abasgi isn't the correct password, but the script seems to fail on an incorrect password, and seems to find the correct one. I think I have set the password variable in the correct place in the loop. A: You need to change: password = word.strip('
52
1,592
164
57
161
0.821697
github_plus_top10pct_by_avg
- \frac{c^{2}}{b^{2}} \right)} - \frac{(k_{1} + k_{2})^{2} b^{2} }{4 \pi} \exp{\left( - \frac{2 c^{2}}{b^{2}} \right)}. \end{aligned}$$ With the conditions fixed as $k_{1} = 50$ and $b = 1$, we can plot $\operatorname{{E}}[\Pe(Z)]$ and $\operatorname{{V}}[\Pe(Z)]$ for the Laplace and the Gauss distributions as follows: [cc]{} ![Plots for the Laplace distribution](Laplace-Ex1.pdf "fig:"){height="4cm"} \[fig:winter\] ![Plots for the Laplace distribution](Laplace-Va1.pdf "fig:"){height="4cm"} \[fig:fall\] [cc]{} ![Plots for the Gauss distribution](Gauss-Ex1.pdf "fig:"){height="4cm"} \[fig:winter\] ![Plots for the Gauss distribution](Gauss-Va1.pdf "fig:"){height="4cm"} \[fig:fall\] Parameter value minimizing the expected value --------------------------------------------- Here, we determine the value of $c = C$ that gives the minimum value of $\operatorname{{E}}[\Pe(Z + c)]$. Since $$\begin{aligned} \frac{d}{dc} \G\left(2a, \left\lvert \frac{c}{b} \right\rvert^{\frac{1}{a}} \right) &= - \frac{c}{a b} \exp{\left(- \left\lvert \frac{c}{b} \right\rvert^{\frac{1}{a}} \right)}; \\ \frac{d}{dc} \g\left(a, \left\lvert \frac{c}{b} \right\rvert^{\frac{1}{a}} \right) &= \operatorname{{sgn}}(c) \frac{1}{a b} \exp{\left(- \left\lvert \frac{c}{b} \right\rvert^{\frac{1}{a}} \right)}, \end{aligned}$$ we have $$\begin{aligned} \frac{d}{dc} \operatorname{{E}}[\Pe(Z + c)] = \frac{k_{1} - k_{2}}{2} + \operatorname{{sgn}}(c) \frac{k_{1} + k_{2}}{2 \G(a)} \g\left(a, \left\lvert \frac{c}{b} \right\rvert^{\frac{1}{a}} \right). \end{aligned}$$ We will denote the value of $c$ satisfying $\frac{d}{dc} \operatorname{{E}}[\Pe(Z + c)] = 0$ as $C$. Then, from the first derivative test, we find that $\operatorname{{E}}[\Pe(Z + c)]$ has a minimum value at $c = C$. $c$ Less than $C$ $C$ More than $C$ ----------------------------------------------- --------------------- ----- --------------------- $\frac{d}{dc} \operatorname{{E}}[\Pe(Z + c)]$ Negative $0$
53
1,091
288
87
null
null
github_plus_top10pct_by_avg
tted as red dots. Four genes that received high regulation criterion values, yet were not found to be cell cycle regulated by the original Spellman analysis, are labeled.](ABI2009-284251.005){#fig5} ###### Percentages of correctly classified genes in the simulation whose results are depicted in [Figure 1](#fig1){ref-type="fig"}. Temporal variance Regulation criterion ----- ------------------- ---------------------- -------------- ----------------- 1% (0/10) 0% (970/990) 98.0% (10/10) 100% (980/990) 99.0% 5% (2/50) 4.0% (932/950) 98.1% (19/50) 38% (949/950) 99.9% 10% (7/100) 7% (887/900) 98.6% (19/100) 19% (899/900) 99.9% 20% (7/200) 3.5% (787/800) 98.4% (20/200) 10% (800/800) 100% ###### The "goodness of rank" (GR) measure results for gene ranking obtained by applying the KM-algorithm to the complete and partitioned data sets with *n* = 2000 genes and *T* time point observations. *T* 20 40 100 --------------------- -------- -------- -------- Complete data set 0.0421 0.1543 0.6434 Partitioning method 0.2012 0.2982 0.5349 [^1]: Recommended by Zhongming Zhao Introduction {#s1} ============ Due to advances in operation techniques and novel treatments (targeted therapy and PD-L1 immunotherapy) for patients with non-small cell lung carcinoma (NSCLC), the prognosis of NSCLC is improved. However, the 5-years survival rate of NSCLC patients is still \<20% and NSCLC remains a major health problem worldwide. Therefore, it is urgent to discover novel targets to regulates the carcinogenesis and metastasis of NSCLC and to develop new therapeutic agents for the treatment of NSCLC ([@B1], [@B2]). Recently, accumulating evidence indicates that abnormal regulation of acetylation processes plays a vital role in lung carcinogenesis. For example, histone deacetylases (HDACs) and histone acetyltransferases (HATs) can significantly change the nucleosome co
54
116
211
106
null
null
github_plus_top10pct_by_avg
\Psi, \Phi \rangle$ be a basis. Any mapping ${\mathit{f}} \colon {\prod{\Psi}} \to {\prod{\Phi}}$ is a functionality. As a basis, definition \[D:BASIS\] establishes that $\Psi$ and $\Phi$ are ensembles with $\Phi \subseteq \Psi$. Since $\Psi$ and $\Phi$ are ensembles, definition \[D:CHOICE\_SPACE\] asserts that ${\prod{\Psi}}$ and ${\prod{\Phi}}$ are choice spaces. Theorem \[T:SUBSET\_IFF\_SUBSPACE\] provides that ${\prod{\Phi}}$ is a subspace of ${\prod{\Psi}}$ because $\Phi \subseteq \Psi$. By virtue of ${\mathit{f}} \in {{\prod{\Phi}}}^{{\prod{\Psi}}}$, then ${\mathit{f}} \colon {\prod{\Psi}} \to {\prod{\Phi}}$ is a mapping from one choice space to another, which is a subspace of the first. These conditions satisfy the premises of definition \[D:FUNCTIONALITY\]. In its programming sense, the term [function]{} will not be used here. A mathematical functionality differs from a software function; functionalities lack arguments. By virtue of its calling protocol, a programming function is effectively a class of functionalities. ### Procedure {#S:PROCEDURE} Procedures are sequences in a finite set of functionalities: \[D:CATALOG\_OF\_FUNCTIONALITY\] Let $\langle \Psi, \Phi \rangle$ be a basis. A finite subset ${\mathscr{F}} \subseteq {{\prod{\Phi}}}^{{\prod{\Psi}}}$ is a *catalog* of functionality. \[D:PROCEDURE\] Let $\langle \Psi, \Phi \rangle$ be a basis and ${\mathscr{F}} \subseteq {{\prod{\Phi}}}^{{\prod{\Psi}}}$ be a catalog of functionality. A *procedure* is a sequence $\lbrace {\mathit{f}}_n \rbrace \colon {\mathbb{N}}\to {\mathscr{F}}$. After noting the functionality’s successful generalization of the frame, the next question is whether the procedure correspondingly abstracts the process. We find that not all processes are [computable]{} as procedures based on a finite number of functionalities. ### Covering {#S:COVERING} The relation holding between frame ${\mathbf{f}} \in {\prod{\Psi}} \times {\prod{\Phi}}$ and functionality ${\mathit{f}} \colon {\prod{\Psi}} \to {\prod{\Phi}}$ is membership:
55
509
331
91
2,990
0.775583
github_plus_top10pct_by_avg
�怠慢君主。 Q: The XPath @root-node-position attribute info I couldn't find the @root-node-position XPath attribute/selector info. Would you give me a link of where i can read about it? Is it XPath 2.0? The code (not mine) is ../preceding-sibling::div[1]/div[@root-node-position]/div applied to this HTML: <div class="left"> <div class='prod2'> <div class='name'>Dell Latitude D610-1.73 Laptop Wireless Computer </div>2 GHz Intel Pentium M, 1 GB DDR2 SDRAM, 40 GB </div> <div class='prod1'> <div class='name'>Samsung Chromebook (Wi-Fi, 11.6-Inch) </div>1.7 GHz, 2 GB DDR3 SDRAM, 16 GB </div> </div> <div class="right"> <div class='price2'>$239.95</div> <div class='price1 best'>$249.00</div> </div> Firstly i fetch a price text under class='right' with this query : //DIV[contains(@class,'best')] and then i apply the above mentioned XPath with @root-node-attribute under class='left' to retrieve the rest of the record info. A: The @root-node-position is a non-standard XPath attribute that is only supported by Visual Web Ripper. You can read more about non-standard XPath methods, attributes and axis supported by Visual Web Ripper here, only for registered users. Q: Why won't this for loop execute? I'm making a simple program that gets the users balance from the entered ID. For some reason the for loop doesn't execute when an ID from the listof_ID array is entered: #include <stdlib.h> #include <stdio.h> #include <string.h> int main() { int cntr; int ID; int listof_ID[] = {001, 002, 003, 004, 005}; float listof_BAL[] = {338.90, 745.87, 897.32, 665.36, 102.45}; puts("**Check Your Balance** \n"); printf("**Please Enter Your ID >> "); scanf("%d", &ID); for(cntr = 0; cntr > 5; cntr++) { if(ID == listof_ID[cntr]) { puts("Your balance is "); printf("%.2f", listof_BAL[cntr]); break; } } return 0; } A: for(cntr = 0; cntr > 5; cntr++) Should be
56
87
116
69
1
0.852825
github_plus_top10pct_by_avg
</td> </tr> A: There are few points for you to consider: Seems like you have syntax collision in your html, because Django and Vue.js use same {{ and }} to put variable. But, as Django will process your html before Vue, it will replace <h4 class="box-title">{{ product.name }}</h4> by what it will find in context (Django tepmlate context on server side). You may check source or your page in browser, and probably you will see at that line: <h4 class="box-title"></h4> Because it will not find python product variable (and you actually meant js(vue) variable). Solution: use another Vue delimiters. See https://vuejs.org/v2/api/#delimiters. For example use [[ instead of {{ in Vue: an option to your Vue instance delimiters: ['[[', ']]'], and change that line (and other where you mean Vue variables) to <h4 class="box-title">[[ product.name ]]</h4> In Vue data you have not product.sell_price variable, as when you doing {% for product in products %} { "id": {{product.id}}, "name": "{{product.name}}", "image": "/media/{{product.image}}", "price": {{product.sell_price}} }, {% endfor %} you will have product.price, not product.sell_price in Vue. Or you have to change line above to "sell_price": {{product.sell_price}} Soon you will face troubles with item variable. As you have item in django context, not in Vue data. You should add items to Vue data as you did for products. In general consider change of your approach from mixing django template and Vue code to: Django delivers data to Vue Vue generating All html and doing your js functions OR use Django Rest framework(https://www.django-rest-framework.org/) to provide rest API and use Vue only on frontend, load your data from server and put your changes to server by REST calls (using axios for example) Good luck. Q: WhereGreaterThan returns no results in LuceneQuery (RavenDB) I'm having an issue querying for values that are greater than a certain value with lucene. My data is dynamic, so Lin
57
1,186
188
83
1,038
0.795341
github_plus_top10pct_by_avg
d web application. level=warn ts=2019-08-02T18:23:48.658364708Z caller=scrape.go:932 component="scrape manager" scrape_pool=batch_web target=https://example.com:443/metrics msg="Error on ingesting samples that are too old or are too far into the future" num_dropped=6 Any pointers on why this could be happening and how can I solve this? A: The error message appears to be quite clear|precise. The metrics that its trying to scrape appear to be timestamped (possibly the problem!) and are either too old or too far into the future. Generally, prometheus metrics don't include a timestamp. If you can drop the timestamps, that would solve the problem. If you can't drop the timestamps, then correct them so that they're ~current. You may have solved this issue more quickly by searching Google for the error message. Q: Showing that Fourier coefficients tend to zero Let $f \in L^2[0,1].$ The $n$th Fourier coefficient of $f$ is given by $$\hat f(n) = \int_0^1 f(t)e^{-2\pi int} \, dt$$ The Fourier exponentials $u_n(t) = e^{2\pi int}$ are orthonormal in $L^2[0,1].$ Using Bessel's inequality, we have $$\sum_n|\hat f(n)|^2=\sum_n\lvert \langle f,u_n\rangle \rvert^2 \leq \lVert f\rVert^2=\int_0^1 \lvert f \rvert^2 < \infty$$ so $\lvert \hat{f}(n)\rvert ^2 \to 0$ as $\lvert n \rvert \to \infty$ by Cauchy's criterion, which in turn implies that the $\hat{f}(n)$ go to zero. I additionally want to show that for measurable $A \subset [0,1]$, we have that $$\int_Ae^{2\pi int} \to 0 \text{ as } n \to \infty$$ What is the correct way to approach this? Do we treat this as the Fourier transform of the characteristic function $\chi_A?$ Thank you! A: \begin{align} & \int_Ae^{2\pi int} \, dt = \int_0^1 f(t) e^{2\pi int} \, dt \quad \text{if } f(t) = \begin{cases} 1 & \text{if } t\in A, \\ 0 & \text{if } t\notin A. \end{cases} \\[10pt] & \text{And } f\in L^2[0,1]. \end{align} Q: pointer to value in array? So I need to have a pointer to a value in a const char array. But I can't quite get it to work without error
58
595
121
79
871
0.798563
github_plus_top10pct_by_avg
argument types Should i always firest try to delete function or is there some syntaxis for this cases? A: As usual, the fine manual is the place to go: CREATE [ OR REPLACE ] FUNCTION CREATE OR REPLACE FUNCTION will either create a new function, or replace an existing definition. Q: Open New tab in browser I want to open new tab in all browser. I had written the following code: <asp:LinkButton ID="TotalRegular_LinkButton" runat="server" Font-Underline="false" OnClientClick="window.open('AllMember.aspx?Index=1','new window','width=950,height=500,scrollbars=no,status=no,toolbar=no,resizable=no,location=no,menubar=no,directories=no');"> <%# Eval("TotalRegular")%> </asp:LinkButton> It opens the tab in Mozilla Firefox (Win XP) but not in Windows 7. And in case of Internet Explorer, it doesn't open new tab at all. Any Suggestion guys where am I going wrong? A: Instead of new window (2nd param), use "_blank". Hopefully, this helps. From http://www.w3schools.com/jsref/met_win_open.asp: <asp:LinkButton ID="TotalRegular_LinkButton" runat="server" Font-Underline="false" OnClientClick="window.open('AllMember.aspx?Index=1','_blank','width=950,height=500,scrollbars=no,status=no,toolbar=no,resizable=no,location=no,menubar=no,directories=no');"> <%# Eval("TotalRegular")%> </asp:LinkButton> Q: Android Toolbar Change Menu action items dynamically I have a Toolbar (android.support.v7.widget.Toolbar) and one Action Menu Item on it. I want to programmatically populate submenu for the menu item. I could not find a way to do it until I set the toolbar as ActionBar by setSupportActionBar(toolbar). In this case I can modify menu items in onPrepareOptionsMenu(). Is there a way to change menu items programmatically without setSupportActionBar(toolbar)? The only action item is inflated by toolbar.inflateMenu(R.menu.menu_main) menu_main.xml: <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" too
59
351
106
62
21
0.83794
github_plus_top10pct_by_avg
+ C)]$ for the Laplace and the Gauss distributions](Laplace-DV.pdf "fig:"){height="4cm"} \[fig:winter\] ![Plots of $\operatorname{{V}}[\Pe(Z)] - \operatorname{{V}}[\Pe(Z + C)]$ for the Laplace and the Gauss distributions](Gauss-DV.pdf "fig:"){height="4cm"} \[fig:fall\] To prove Theorem $\ref{thm:3.4}$, we use the following lemma: \[lem:3.5\] For $a > 0$ and $x > 0$, we have $$\begin{aligned} x^{a} \g(a, x)^{2} - x^{a} \G(a)^{2} + 2 \g(a, x) \G(2a, x) > 0. \end{aligned}$$ The proof of Lemma $\ref{lem:3.5}$ is presented in Section $5.2$. Now we can prove Theorem $\ref{thm:3.4}$. It follows from the equation $(\ref{C})$ that $$\begin{aligned} \frac{(k_{1}^{2} - k_{2}^{2}) b C}{2 \G(a)} \G\left(2a, \left\lvert \frac{C}{b} \right\rvert^{\frac{1}{a}} \right) &= - \operatorname{{sgn}}(C) \frac{k_{2} - k_{1}}{k_{1} + k_{2}} \frac{(k_{1} + k_{2})^{2} b \lvert C \rvert}{2 \G(a)} \G\left(2a, \left\lvert \frac{C}{b} \right\rvert^{\frac{1}{a}} \right) \\ &= - \frac{(k_{1} + k_{2})^{2} b \lvert C \rvert}{2 \G(a)^{2}} \g\left(a, \left\lvert \frac{C}{b} \right\rvert^{\frac{1}{a}} \right) \G\left(2a, \left\lvert \frac{C}{b} \right\rvert^{\frac{1}{a}} \right), \allowdisplaybreaks \\ \operatorname{{sgn}}(C) \frac{(k_{1}^{2} - k_{2}^{2}) b^{2}}{2 \G(a)} \g\left(3a, \left\lvert \frac{C}{b} \right\rvert^{\frac{1}{a}} \right) &= - \operatorname{{sgn}}(C) \frac{k_{2} - k_{1}}{k_{1} + k_{2}} \frac{(k_{1} + k_{2})^{2} b^{2}}{2 \G(a)} \g\left(3a, \left\lvert \frac{C}{b} \right\rvert^{\frac{1}{a}} \right) \\ &= - \frac{(k_{1} + k_{2})^{2} b^{2}}{2 \G(a)^{2}} \g\left(a, \left\lvert \frac{C}{b} \right\rvert^{\frac{1}{a}} \right) \g\left(3a, \left\lvert \frac{C}{b} \right\rvert^{\frac{1}{a}} \right). \end{aligned}$$ Hence, substituting $c = C$ in equation $(2)$ of Lemma $\ref{lem:3.1}$, we have $$\begin{aligned} \operatorname{{V}}[\Pe(Z + C)] &= \frac{(k_{1} + k_{2})^{2} C^{2}}{4} - \frac{(k_{1} + k_{2})^{2} b \lvert C \rvert}{\G(a)^{2}} \g\left(a, \left\lvert \frac{C}{b} \right\rvert^{\frac{1}{a}} \right) \G\left(2a,
60
906
200
97
null
null
github_plus_top10pct_by_avg
s = function(baseInput){ console.log('> new BaseClass(%s)', Array.prototype.slice.call(arguments).toString()); var basePrivateVar = (baseInput)?('(private)' + baseInput):'baseSecret'; this.basePublicVar = (baseInput)?('(public)' + baseInput):'baseNotSecret'; function secretTellBaseSecret(){ console.log('> BaseClass::secretTellBaseSecret(%s)', Array.prototype.slice.call(arguments).toString()); return basePrivateVar; } this.tellSecret = function(){ console.log('> BaseClass::tellSecret(%s)', Array.prototype.slice.call(arguments).toString()); var x = secretTellBaseSecret(); return secretTellBaseSecret(); }; }; BaseClass.prototype = { tellSecret: function(){ console.log('> BaseClass.prototype.tellSecret(%s)', Array.prototype.slice.call(arguments).toString()); return this.tellSecret(); } }; var AdvancedClass = function(baseInput, advInput){ console.log('> new AdvancedClass(%s)', Array.prototype.slice.call(arguments).toString()); BaseClass.call(this, baseInput); var advPrivateVar = (advInput)?('(private)' + advInput):'advSecret'; this.advPublicVar = (advInput)?('(public)' + advInput):'advNotSecret'; function secretTellAdvSecret(){ console.log('> AdvancedClass::secretTellAdvSecret(%s)', Array.prototype.slice.call(arguments).toString()); return avdPrivateVar; }; this.tellASecret = function(){ console.log('> AdvancedClass::tellSecret(%s)', Array.prototype.slice.call(arguments).toString()); return secretTellAdvSecret.call(this); }; }; AdvancedClass.prototype = Object.create(BaseClass.prototype, { tellBaseSecret: { value: function(){ console.log('> AdvancedClass.prototype.tellBaseSecret', Array.prototype.slice.call(arguments).toString()); return BaseClass.prototype.tellSecret.apply(this, arguments); }, enumerable: true } }); AdvancedClass.prototype.constructor = AdvancedClass; var A1 = new BaseClass("A1's sec
61
705
81
39
231
0.817031
github_plus_top10pct_by_avg
ds the best trade-off between predictive performance and training time, but when AdaBoost is used, our experiments show that multiple subset evaluation is not generally beneficial. Avenues of future research include comparing multiple subset evaluation with base learners other than logistic regression. It is unlikely that training RMSE of the internal models will be a reliable indicator when selecting splits based on more complex models such as decision trees or random forests, so other metrics may be needed. Also, it may be beneficial to choose subsets such that maximum ensemble diversity is achieved, possibly through information theoretic measures such as variation of information [@meilua2003comparing]. Existing meta-heuristic approaches to constructing individual nested dichotomies like genetic algorithms [@lee2003binary; @wever2018ensembles] could also be adapted to optimise ensembles in this way. Acknowledgements ================ This research was supported by the Marsden Fund Council from Government funding, administered by the Royal Society of New Zealand. [^1]: Appropriate values for $\alpha$ for a given $\lambda$ can be found in Table 3 of [@harter1961expected]. --- abstract: | In cyber-physical systems, software may control safety-significant operations. This report discusses a method to structure software testing to measure the statistical confidence that algorithms are true to their intended design. The subject matter appears in two main parts: theory, which shows the relationship between discrete systems theory, software, and the actuated automaton; and application, which discusses safety demonstration and indemnification, a safety assurance metric. The recommended form of statistical testing involves sampling algorithmic behavior in a specific area of safety risk known as a hazard. When this sample is random, it is known as a safety demonstration. It provides evidence for indemnification, a statistic expressing an assured upper bound for accident probability. The method obtains res
62
746
399
110
null
null
github_plus_top10pct_by_avg
y augmenting a catalog of loci to the building blocks of processes and procedures, namely frames and functionalities. \[D:STEP\_SPACE\] Suppose $\Lambda$ is a catalog of loci. Let basis $\langle \Psi, \Phi\rangle$ underly frame space ${\mathbf{F}} = {\prod{\Psi}} \times {\prod{\Phi}}$ and catalog of functionality ${\mathscr{F}} \subseteq {{\prod{\Phi}}}^{{\prod{\Psi}}}$. A *step space* ${\mathbb{S}}$ is the Cartesian product ${\mathbb{S}} = \Lambda \times {\mathscr{F}} \times {\mathbf{F}}$. The volatile excitation, whose generating ensemble is $\Psi \setminus \Phi$, is intrinsically part of the definition of step space. Lest this implicit fact be forgotten, we shall adopt explicit but redundant notation as reminders. \[D:STEP\_SPACE\_PROJECTION\] Let ${\mathit{s}} = (\lambda,{\mathit{f}},{\mathbf{f}})$ be a member of step space ${\mathbb{S}} = \Lambda \times {\mathscr{F}} \times {\mathbf{F}}$. Define the *locus* projection $\mho_\Lambda \colon {\mathbb{S}} \to \Lambda$ by setting $\mho_\Lambda(\lambda,{\mathit{f}},{\mathbf{f}}) = \lambda$. Similarly define the *frame* and *functionality* projections by $\mho_{\mathbf{F}}(\lambda,{\mathit{f}},{\mathbf{f}}) = {\mathbf{f}}$ and $\mho_{\mathscr{F}}(\lambda,{\mathit{f}},{\mathbf{f}}) = {\mathit{f}}$ respectively. Definition \[D:CONJOINT\] considers the covering relation between a frame and a functionality. *Consistency* is the same principle applied to the context of a step: \[D:CONSISTENT\_STEP\] Let ${\mathit{s}} = (\lambda,{\mathit{f}},{\mathbf{f}})$ be a member of step space ${\mathbb{S}} = \Lambda \times {\mathscr{F}} \times {\mathbf{F}}$. The step ${\mathit{s}}$ is *consistent* if $\mho_{\mathbf{F}}({\mathit{s}}) = {\mathbf{f}} \in {\mathit{f}} = \mho_{\mathscr{F}}({\mathit{s}})$ (that is, its frame is a member of its functionality). #### Sequence projection {#S:SEQUENCE_PROJECTION} \[D:STEP\_SPACE\_WALK\] Let ${\mathbb{S}} = \Lambda \times {\mathscr{F}} \times {\mathbf{F}}$ be a step space and ${\mathscr{I}}$ be a denumerable index set. A *walk* is a seq
63
323
147
101
null
null
github_plus_top10pct_by_avg
e and extended it for opening files that are extracted from the setup archive into a temporary folder (a folder that is deleted when the installer terminates): [Setup] AppName=My Program AppVersion=1.5 DefaultDirName={pf}\My Program [Files] ; the dontcopy flag tells the installer that this file is not going to be copied to ; the target system Source: "File.txt"; Flags: dontcopy [Code] var LinkLabel: TLabel; procedure LinkLabelClick(Sender: TObject); var FileName: string; ErrorCode: Integer; begin FileName := ExpandConstant('{tmp}\File.txt'); // if the file was not yet extracted into the temporary folder, do it now if not FileExists(FileName) then ExtractTemporaryFile('File.txt'); // open the file from the temporary folder; if that fails, show the error message if not ShellExec('', FileName, '', '', SW_SHOW, ewNoWait, ErrorCode) then MsgBox(Format('File could not be opened. Code: %d', [ErrorCode]), mbError, MB_OK); end; procedure InitializeWizard; begin LinkLabel := TLabel.Create(WizardForm); LinkLabel.Parent := WizardForm; LinkLabel.Left := 8; LinkLabel.Top := WizardForm.ClientHeight - LinkLabel.ClientHeight - 8; LinkLabel.Cursor := crHand; LinkLabel.Font.Color := clBlue; LinkLabel.Font.Style := [fsUnderline]; LinkLabel.Caption := 'Click me to read something important!'; LinkLabel.OnClick := @LinkLabelClick; end; procedure CurPageChanged(CurPageID: Integer); begin LinkLabel.Visible := CurPageID <> wpLicense; end; Q: Getting rid of a warning in Android Studio Android studio seems to think SparseArray values cannot be null. When I write public static void foo() { SparseArray<Object> sparseArray = new SparseArray<Object>(); sparseArray.put(0, null); if (sparseArray.valueAt(0) == null) Log.d("MyClass", "Hello World"); } I get the warning condition 'sparseArray.valueAt(0) == null' is always 'false' I'd just like to know what annotation or comment I need to put to get rid of the warning. I don't want to disable inspections, just get rid of thi
64
416
48
47
69
0.828866
github_plus_top10pct_by_avg
rendering features Edit 2: Signature of the method posting to: [HttpPost] public ActionResult Mapping(AddSubscriptionPlanModel model) { } A: But On post, all properties have the value except AllFeatures list item property which always shows count = 0. AllFeatures is a generic list of Feature. When you do this: @Html.HiddenFor(model => model.AllFeatures) The Razor view engine will render this: <input id="AllFeatures" name="AllFeatures" type="hidden" value="System.Collections.Generic.List`1[Namespace.Feature]"> <!--Where Namespace is the Namespace where Feature is defined. --> In other words, HiddenFor calls the ToString() on the item and simply puts that into the input tag's value attribute. What happens upon POST When you post the form, the DefaultModelBinder is looking for a property named AllFeatures but of type string so it can assign this to it: System.Collections.Generic.List`1[Namespace.Feature] It does not find one since your model does not have AllFeatures of type string, so it simply ignores it and binds all the other properties. AllFeatures list item property which always shows count = 0. Yes, it will and this is not the AllFeatures list which you posted but the one from the constructor which clearly is an empty list with a count 0: public AddSubscriptionPlanModel() { AllFeatures = new List<Feature>(); } I am not sure why you are sending all the features to the client (browser) and then you need to post it back to the server. Solution To fix the issue, simply remove this line: @Html.HiddenFor(model => model.AllFeatures) Now it will not cause any confusion during binding and MVC will bind the items in the loop to the AllFeatures property. In fact, the only code you really need, as far as I can tell from your question is this(I could be wrong if you need the hidden fields for some other reason. But if you just want the user to edit the AllFeatures, you do not need any of the hidden fields): @for (int i = 0; i < Model.AllFeatures.Count; i++) { <t
65
75
9
56
944
0.797089
github_plus_top10pct_by_avg
1 = (TextView) findViewById(R.id.answer); n1 = Double.parseDouble(e1.getText().toString()); n2 = Double.parseDouble(e2.getText().toString()); if (n1.toString().length()< 0 || n2.toString().length()< 0){ t1.setText("Please enter a number into both the base and height"); }else { answer1 = ((n1 * n2) / 2); t1.setText(Double.toString(answer1)); } } A: First check if there is input in both EditTexts and only if there is convert it to Double: if (e1.getText().length() == 0 || e2.getText().length() == 0) { t1.setText("Please enter a number into both the base and height"); } else { n1 = Double.parseDouble(e1.getText().toString()); n2 = Double.parseDouble(e2.getText().toString()); answer1 = ((n1 * n2) / 2); t1.setText(Double.toString(answer1)); } EditText.getText() will never return null (as per source code) so it's safe to use methods on it (such as length(). Q: ping class doesn't work in published net core web app I have a very simple ping endpoint in net core web API controller. It works locally. [HttpGet("ping")] public IActionResult Ping() { string host = "www.google.com"; Ping servicePing = new Ping(); var reply = servicePing.Send(host); return Ok($"{reply.Status}"); } But on published Azure application, when I go to that endpoint it returns 500 status code for internal server error. I've tried adding some nugget packages, using async, but it's always the same - works locally, but not when published. I also tried checking in Azure portal, maybe their servers are blocking pinging? edit: from Azure portal app service diagnostics report: at System.Net.NetworkInformation.Ping.InitialiseIcmpHandle at System.Net.NetworkInformation.Ping.DoSendPingCore at System.Net.NetworkInformation.Ping.GetAddressAndSend at System.Net.NetworkInformation.Ping.GetAddressAndSend at System.Net.NetworkInformation.Ping.Send at TestApi.Controllers.WeatherForecastController.Ping at Microsof
66
12
146
54
394
0.811004
github_plus_top10pct_by_avg
"Partywear Frock": ["10.10.1(pink)", "10.10.1(black)"], "Discount:0%": ["900", "1200"], "Unit:Quantity": ["50", "30"] } } self.inventory_widget = QtGui.QTreeWidget(columnCount=7, expandsOnDoubleClick=False, indentation=0, focusPolicy=QtCore.Qt.NoFocus, iconSize=QtCore.QSize(40,60)) self.inventory_widget.setColumnWidth(2, 350) self.inventory_widget.setStyleSheet("QWidget {background-color: black;color: white;}") header = self.inventory_widget.header() header.hide() delegate = InventoryDelegate(self.inventory_widget) self.inventory_widget.setItemDelegate(delegate) for key, value in self.inventory_dict.items(): icon = QtGui.QIcon("./{}.png".format(key)) it = QtGui.QTreeWidgetItem() self.inventory_widget.addTopLevelItem(it) it.setIcon(0, icon) k = list(value.keys()) for i, t in enumerate([key] + k): it.setText(i+1, t) e = [[] for _ in value[k[0]]] for k, v in value.items(): for i, val in enumerate(v): e[i].append(val) for r in e: child = QtGui.QTreeWidgetItem() for i, e_ in enumerate(r): child.setText(i+2, e_) it.addChild(child) self.inventory_widget.expandAll() self.setCentralWidget(self.inventory_widget) if __name__ == '__main__': import sys app = QtGui.QApplication(sys.argv) settingobj= Inventory_Items() settingobj.showFullScreen() sys.exit(app.exec_()) A: Assuming you want to change the color of the rows top-levels then you must overwrite the initStyleOption() method: class InventoryDelegate(QtGui.QStyledItemDelegate): def initStyleOption(self, option, index): super(InventoryDelegate, self).initStyleOption(option, index) if not index.parent().isValid()
67
51
14
35
138
0.823165
github_plus_top10pct_by_avg
b.config Windows Azure I am using a shared website from Windows Azure. I would like to encrypt parts of my web.config, however, I get this error: Failed to decrypt using provider 'RsaProtectedConfigurationProvider'. Error message from the provider: The RSA key container could not be opened. I have a page in my site that will encrypt that file and it does, however, after a few hours I get this error. Do I need to send my machine key over to Azure or do they have one I can use? To encrypt my config file, I use this code: /// <summary> /// About view for the website. /// </summary> /// <returns>Action Result.</returns> public ActionResult About() { Configuration objConfig = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath); AppSettingsSection objAppsettings = (AppSettingsSection)objConfig.GetSection("appSettings"); if (!objAppsettings.SectionInformation.IsProtected) { objAppsettings.SectionInformation.ProtectSection( "RsaProtectedConfigurationProvider"); objAppsettings.SectionInformation.ForceSave = true; objConfig.Save(ConfigurationSaveMode.Modified); } return View(); } A: It might not be exactly what you are looking for, but you could use the Configuration tab in the Azure dashboard to overwrite the AppSettings at runtime so the web.config doesn't store any actual sensitive data. http://www.windowsazure.com/en-us/manage/services/web-sites/how-to-configure-websites/#howtochangeconfig App Settings – Specify name/value pairs that will be loaded by your web application on start up. For .NET sites, these settings will be injected into your .NET configuration AppSettings at runtime, overriding existing settings. For PHP and Node sites these settings will be available as environment variables at runtime. Q: Continuar execução depois que aceitar a Permissão Android Estou fazendo um teste usando o Google Maps. Ela está funcionando
68
10
54
60
1,810
0.785502
github_plus_top10pct_by_avg
run, including significance tests, are available in the supplementary materials. Individual Nested Dichotomies ----------------------------- **Dataset** **Classes** **Instances** **Features** ---------------- ------------- --------------- -------------- audiology 24 226 70 krkopt 18 28056 7 LED24 10 5000 25 letter 26 20000 17 mfeat-factors 10 2000 217 mfeat-fourier 10 2000 77 mfeat-karhunen 10 2000 65 mfeat-morph 10 2000 7 mfeat-pixel 10 2000 241 MNIST 10 70000 784 optdigits 10 5620 65 page-blocks 5 5473 11 pendigits 10 10992 17 segment 7 2310 20 usps 10 9298 257 vowel 11 990 14 yeast 10 1484 9 : \[tab:datasets\]The datasets used in our experiments. Restricting the sample space of nested dichotomies through multiple subset evaluation is expected to have a greater performance impact on smaller ensembles than larger ones. This is because in a larger ensemble, a poorly performing ensemble member does not have a large impact on the overall performance. On the other hand, in a small ensemble, one poorly performing ensemble member can degrade the ensemble performance significantly. In the extreme case, where a single nested dichotomy is trained, there is no need for ensemble diversity, so a technique for improving the predictive performance of an individual nested dichotomy should be effective. Therefore, we first compare the performance of single nested dichotomies for differ
69
4,304
156
20
null
null
github_plus_top10pct_by_avg
andom number, insert it in the trails vector randomizedTrials(i) = currentTrial; % now drop the value conditionTrials(1) = []; i = i+1; end The loop essentially states: %while at least 1 zero present in the randomizedTrials vector, check if the next value violates N_DUPS_ALLOWED. If no violation, pop it from the conditionTrials vector and append it to the randomizedTrials vector. Otherwise, re-permute the trials and try again. I also wrote in a check to make sure we don't loop forever... as might be the case if we come toward the end of the vector and we get many replicates. Q: How to delete application requests? Question: How to delete an application request using the facebook-actionscript-api? I am trying to delete application requests making this call in Actionscript: Facebook.api(full_request_id, callback, "delete", "POST"); The Actionscript API then throws the following error: Exception fault: ReferenceError: Error #1069: Property access_token not found on String and there is no default value. at com.facebook.graph.core::AbstractFacebook/api()[C:\Users\facebookGraphApi\api\com\facebook\graph\core\AbstractFacebook.as:134 Which is logical as the script at that point tries to access the value of params which is now the String "delete": if (params.access_token == null) { params.access_token = accessToken; } Related questions: AS3 API: Deleting App Invites A: The following worked for removal of application requests: var full_request_id : String = request_id + "_" + user_id; var method : String = "/" + full_request_id; Facebook.deleteObject(method, callback); @see AbstractFacebook.as The actionscript-api will then add the property 'method' with value 'delete' to the parameters of your call: protected function deleteObject(method:String, callback:Function = null):void { var params:Object = {method:'delete'}; api(method, callback, params, URLRequestMethod.POST); } if (params.access_token == null) { params.access_token = accessToken; } Q: Which module could prod
70
969
181
85
122
0.824216
github_plus_top10pct_by_avg
bunch of hidden inputs which have to be in the $_POST array when the form is submitted. For example: <?php function my_function($var1, $var2) { // Initialize the $ctrls variable $ctrls = ''; // Builds the form button $ctrls = '<form action="" method="post"> <input type="hidden" name="var1" value="'.$var1.'" /> <input type="hidden" name="var2" value="'.$var2.'" /> <input type="submit" value="my button" id="pgn"?> </form>'; return $ctrls; } ?> This has been working fine. However, now I have additional variables I need to begin including, the number of which will vary depending upon the page from which the function is being called. My intended solution is to create an array to store all the other variables so that the number variables that have to be passed to the function will always be fixed. For example: function my_function($var1, $var2, $array) Then on the page that is calling the function I would define the arrays as follows: $array = array("var3" => "abc", "var4"=>"def", "var5"=>"ghi"); What I want to do next, which isn't working, is to modify the function as follows: <?php function my_function($var1, $var2, $array) { // Initialize the $ctrls variable $ctrls = ''; // Builds the form button $ctrls = '<form action="" method="post"> <input type="hidden" name="var1" value="'.$var1.'" /> <input type="hidden" name="var2" value="'.$var2.'" /> ' foreach($array as $key=>$value) { ' <input type="hidden" name="'.$key.'" value="'.$value.'" /> ' } ' <input type="submit" value="my button" id="pgn"?> </form>'; return $ctrls; } The intended result was for the foreach loop to add as many hidden inputs as I had rows in the array. However the page that calls the function won't load when the foreach loop is added to the function. I also tried to echo the $key and $value variables in the foreach loop, and didn't have any success with that either. Looking
71
9
20
46
190
0.819578
github_plus_top10pct_by_avg
eEntities returns a saveMap, I think I should be able to remove the invalid entities from the change set and continue to save the valid entities, but then how do I report the invalid parts to the client? Is it possible to do a partial save of only the valid entities and at the same time, report a sensible error to the client to describe the parts of the save that failed? A: Breeze does not currently support a save mechanism that both saves and returns an error at the same time. While possible this seems a bit baroque. As you pointed out, you can 1) Throw an exception inside of the BeforeSaveEntities and fail the save. You can even specify which specific entity or entities caused the failure and why. In this case the entire save is aborted. or 2) Remove 'bad' items from the saveMap within the BeforeSaveEntities and save only a subset of what was passed in. In this case you are performing a partial save. But we don't support a hybrid of these two. Please add this to the Breeze User Voice if you feel strongly and we can see if other members of the community feel that this would be useful. Q: Problema con Java KeyStore Tengo una clase para manejar los keystore. import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.security.cert.Certificate; import java.security.Key; import java.security.KeyStore; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; import java.security.PrivateKey; import java.security.PublicKey; import java.security.UnrecoverableEntryException; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; /** * Clase encargada de administrar el KeyStore. * * @author Jose Montes */ public class KeyStoreManager { private KeyStore keyStore; /** * Constructor. */ public KeyStoreManager() { } /** * Crea un nuevo KeyStore con el nombre y contraseña pasado por parametros, * una vez creado almacena la instancia en la propiedad keyStore
72
4
123
81
463
0.808935
github_plus_top10pct_by_avg
uce this tag-cloud image? Is there a drupal module that could produce an image like this. I think it's some sort of a tag cloud or something. alt text http://img830.imageshack.us/img830/2544/screenshot199.jpg A: Yes. http://sudosys.be/?q=drupal_tag_cloud Also check out http://drupal.org/project/tagadelic Q: Mongodb $addToSet duplicates I'm building an app with mongodb and node js. It is about creating polls, and I want to add new options on database and increase the number of votes for each submit. All works fine but on the first search it duplicates the option rather than just update the vote here is the code: let newChoice = function(option) { this.option = choice; this.votes = 0; }; let New = new newChoice(choice); poll.update({_id: id}, {$addToSet: {"options": New, $exists: false}}, function(err, doc){ if (err) { console.log(err); } else { console.log(doc) } }); poll.update({_id: id, "options.option": choice}, {$inc: {"options.$.votes": 1}}, function(err, vote) { if (err) { console.log( err); } }); res.redirect("/show/"+id); }); and here is the way that I store on db "options": [ { "option": " pizza", "votes": 0 }, { "option": "burger ", "votes": 0 } Any idea how to prevent duplicates? A: You may conditionally insert if the option with your choice and votes=0 doesn't exist already db.coll.update( {_id: id, 'options.option': {$ne: my_choice}}, {$push: {options: {'option': my_choice, 'votes': 0}}}); After this operation, your update command for incrementing the count will work as expected. Q: Does exist an only spring mvc archetype? Im searching a spring mvc archetype with no hibernate implementations because i found an appfuse archetype but it comes with hibernate... A: I don't know of any archetypes containing only Spring MVC but you can Use SpringSource Tools Suite's Spring MVC template project (imho you should use STS anyway for Spring development) OR Use Spring Roo to generate a skeleton for you; create a dummy entity then create controller fo
73
62
72
93
137
0.823265
github_plus_top10pct_by_avg
ounded. [^1]: This material is partially based upon work supported by the National Science Foundation under Grant No DMS-0902628. Part of this paper was written while the author was a Leibniz Fellow at the Mathematisches Forschungsinstitut Oberwolfach. [^2]: 2000 Mathematics Subject Classifications: 03E15, 03E45, 03E60. [^3]: Keywords: Mouse, inner model theory, descriptive set theory, hod mouse. [^4]: i.e., closed under $\forall^{\mathbb{R}}$ and non-selfdual [^5]: We drop $\a$ and $a$ from our notation as the embedding doesn’t depend on them [^6]: Recall the direct limit construction that converges to $\H|\Theta$. Here $\pi_{\P, \emptyset, \infty}$ is the direct limit embedding given by $\emptyset$-iterability embeddings. For more details see either of the aforementioned papers. --- abstract: | Identification schemes are interactive protocols typically involving two parties, a *prover*, who wants to provide evidence of his or her identity and a *verifier*, who checks the provided evidence and decide whether it comes or not from the intended prover. In this paper, we comment on a recent proposal for quantum identity authentication from Zawadzki [@Zawadzki19], and give a concrete attack upholding theoretical impossibility results from Lo [@Lo97] and Buhrman et al. [@Buhrman12]. More precisely, we show that using a simple strategy an adversary may indeed obtain non-negligible information on the shared identification secret. While the security of a quantum identity authentication scheme is not formally defined in [@Zawadzki19], it is clear that such a definition should somehow imply that an external entity may gain no information on the shared identification scheme (even if he actively participates injecting messages in a protocol execution, which is not assumed in our attack strategy). author: - 'Carlos E. González-Guillén[^1]' - 'María Isabel González Vasco[^2]' - 'Floyd Johnson[^3]' - 'Ángel L. Pérez del Pozo[^4]' bibliography: - 'QIA.bib' title: Concerning Quantum Identity Authentica
74
145
642
112
null
null
github_plus_top10pct_by_avg
--- author: - | Meelis Kull\ Department of Computer Science\ University of Tartu\ `meelis.kull@ut.ee`\ Miquel Perello-Nieto\ Department of Computer Science\ University of Bristol\ `miquel.perellonieto@bris.ac.uk`\ Markus Kängsepp\ Department of Computer Science\ University of Tartu\ `markus.kangsepp@ut.ee`\ Telmo Silva Filho\ Department of Statistics\ Universidade Federal da Paraíba\ `telmo@de.ufpb.br`\ Hao Song\ Department of Computer Science\ University of Bristol\ `hao.song@bristol.ac.uk`\ Peter Flach\ Department of Computer Science\ University of Bristol and\ The Alan Turing Institute\ `peter.flach@bristol.ac.uk`\ title: | Beyond temperature scaling:\ Obtaining well-calibrated multi-class probabilities with Dirichlet calibration\ Supplementary material --- Source code =========== The instructions and code for the experiments can be found on . Proofs ====== \[thm:equiv\] The parametric families $\vmuh_{DirGen}(\vq; \valpha,\vpi)$, $\vmuh_{DirLin}(\vq; \MW,\vb)$ and $\vmuh_{Dir}(\vq; \MA,\vc)$ are equal, i.e. they contain exactly the same calibration maps. We will prove that: 1. every function in $\vmuh_{DirGen}(\vq; \valpha,\vpi)$ belongs to $\vmuh_{DirLin}(\vq; \MW,\vb)$; 2. every function in $\vmuh_{DirLin}(\vq; \MW,\vb)$ belongs to $\vmuh_{Dir}(\vq; \MA,\vc)$; 3. every function in $\vmuh_{Dir}(\vq; \MA,\vc)$ belongs to $\vmuh_{DirGen}(\vq; \valpha,\vpi)$. #### 1. Consider a function $\muh(\vq)=\vmuh_{DirGen}(\vq; \valpha,\vpi)$. Let us start with an observation that any vector $\vx=(x_1,\dots,x_k)\in(0,\infty)^k$ with only positive elements can be renormalised to add up to $1$ using the expression $\softmax(\vln(\vx))$, since: $$\begin{aligned} \softmax(\vln(\vx))=\vexp(\vln(\vx))/(\sum_i \exp(\ln(x_i)))=\vx/(\sum_i x_i)\end{aligned}$$ where $\vexp$ is an operator applying exponentiation element-wise. Therefore, $$\begin{aligned} \muh(\vq)=\softmax(\vln(\pi_1 f_1(\vq),\
75
129
241
118
876
0.798485
github_plus_top10pct_by_avg
TICLES_AMOUNT): self.obstacle = Obstacle() self.obstaclesList.append(self.obstacle) # make new sprite using list for i in self.obstaclesList: self.allSprites.add(i) self.obstacles.add(i) self.gameLoop() def gameLoop(self): # main game loop while self.running: self.draw() def draw(self): self.screen.fill(WHITE) self.allSprites.draw(self.screen) for sprites in self.obstaclesList: sprites.update() self.allSprites.update() A: Your code is fixed by adding missing imports adding missing constants renaming animate to update in the Obstacle class calling pygame.display.update after drawing using a Clock to limit the framerate adding event handling adding code to create a Game instance Some more improvements: no need for obstaclesList if you already have obstacles you can pass Groups directly to Sprite's __init__ function remove a Sprite when it's no longer on the screen Here's the code: import pygame import random OBSTICLES_AMOUNT = 8 WIDTH, HEIGHT = 800,600 TITLE='some game of falling stuff' BLUE = pygame.color.THECOLORS['blue'] WHITE = pygame.color.THECOLORS['white'] class Obstacle(pygame.sprite.Sprite): def __init__(self, *args): pygame.sprite.Sprite.__init__(self, *args) self.image = pygame.Surface((30, 30)) self.image.fill(BLUE) self.rect = self.image.get_rect() self.rect.x = random.randrange(0, WIDTH - self.rect.width) self.rect.y = random.randrange(-100, -40) self.velY = 6 def update(self): self.rect.y += self.velY if self.rect.y > HEIGHT: self.kill() class Game(pygame.sprite.Sprite): def __init__(self): pygame.sprite.Sprite.__init__(self) pygame.init() pygame.mixer.init() self.clock = pygame.time.Clock() self.screen = pygame.display.set_mode((WIDTH, HEIGHT)) pygame.display.set_caption(TITLE) self.running = True self.clock = pygame.time.Clock()
76
3,942
33
90
698
0.802154
github_plus_top10pct_by_avg
−0.648836 STARD13 0.013644 −0.642635 THBD 0.010984 −0.635682 GJA1 0.035288 −0.633043 PKIA 0.022944 −0.617443 CDC27 0.012718 −0.584214 NR2F2 0.013187 −0.575433 CHD9 0.048841 −0.573992 CXCL12 0.003888 −0.538192 NAB2 0.011359 0.527142 SLC25A5 0.029859 0.534298 PEG10 0.018256 0.549699 SLIT2 0.005701 0.551934 BASP1 0.026759 0.594218 TGIF1 0.030148 0.605397 ALDH1A3 0.010848 0.653685 ZNF148 0.031228 0.661078 CDH2 0.038832 0.862357 miRNA, microRNA. ###### Significant regulation of miRNAs in the specific miRNA-mRNA interacting regulatory network. miRNA P-value log~2~ (fold-change) ------------ ----------- ---------------------- miR-7 0.0041392 −1.7320437 miR-137 0.0088043 0.9341108 miR-144 0.0059723 −0.8403724 miR-139-5p 0.0147834 −0.5824534 miR-145 0.0087553 −0.5871226 miR-296-5p 0.0124989 −0.5545413 miR-10a 0.0061396 −0.7961598 miR-452 0.0325921 −0.5399825 miR-493 0.0186862 0.6062014 miR/miRNA, microRNA. ###### Node-degree analysis of miRNA-mRNA interactions. Node Degree ------------ -------- miR-144 10 miR-137 9 miR-145 5 miR-7 5 ZNF148 4 miR-139-5p 3 PKIA 3 TGFBR2 3 TRAM2 3 TGIF1 2 miR/miRNA, microRNA. ERRATUM {#h0.0} ======= Volume 5, no. 3, doi: 10.1128/mBio.01125-14, 2014. In the Results and Discussion section (PDF page 3, line 11), TCA should have been introduced as an abbreviation for tricarboxylic acid, not trichloroacetic acid. In the Supplemental Material, for Table S1B (Fisher Exact Test in Stationary Phase of Growth), the explanation of the parts of the table should read as follows: Top to bottom parts: Genes are ordered from highest to lowest FDR values Upper part: Genes with significant lower expression in FS v
77
2,503
153
64
null
null
github_plus_top10pct_by_avg
raphs: club = re.findall('(?i)CLUB:[\s]*([\S\s]+?)\n', paragraph) names_numbers = re.findall('(?i)([\d]+)[\n]{1,3}[\s]*([\S\ ]+)', paragraph) for i in range(len(names_numbers)): if len(club) == 1: print(club[0]+' | '+names_numbers[i][1]+' | '+names_numbers[i][0]) >>> reorder(string) ['Team', 'Name', 'Number'] BOHEMIANS | James Talbot | 1 BOHEMIANS | Derek Pender | 2 BOHEMIANS | Darragh Leahy | 3 CORK CITY | Mark McNulty | 1 CORK CITY | Colm Horgan | 2 CORK CITY | Alan Bennett | 3 DERRY CITY | Peter Cherrie | 1 DERRY CITY | Conor McDermott | 2 DERRY CITY | Ciaran Coll | 3 Q: Problem adding image to UIView I'm making an app with a piano and each key will be it's own subclass. I tried making the keys a subclass of UIButton, but after having some problems getting the methods to be called, I checked online and found out that others were also having problems subclassing UIButtons. So then I tried subclassing a UIView. The problem was that I tried adding an image to it, but it showed up as a black box. Here is the code from the CustomView @implementation Keys - (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { self.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"whitekey.gif"]]; } return self; (I've confirmed that the problem isn't whitekey.gif) Here is the code from the viewController - (void)viewDidLoad { [super viewDidLoad]; Keys *whiteKey = [[Keys alloc] initWithFrame:CGRectMake(0, 0, 100, 300)]; [self.view addSubview:whiteKey]; } Is it better if I subclass UIImageView? A: You should be using UIImageView. An image view object provides a view-based container for displaying either a single image or for animating a series of images. http://developer.apple.com/library/ios/#documentation/uikit/reference/UIImageView_Class/Reference/Reference.html Maybe a UIView as a container, with a UIImageView with the piano key image, with additi
78
3,460
2
70
74
0.828617
github_plus_top10pct_by_avg
\{ 0,0,...,0 \right\}$ 3. **function** Class = *svmpredict*($\mathbf{x}$) 4. **for** i = 1 to $N_{S}$ **do** 5.     $K\left\langle \mathbf{x},\mathbf{s}_{i} \right\rangle = exp\left( {- \frac{\left| \middle| \mathbf{x} \right. - \mathbf{s}_{i}{||}_{2}}{2\sigma^{2}}} \right)$ 6. **end for** 7. **for** j = 1 to $N_{Cl}$ **do** 8.     **for** k = j+1 to $N_{Cl}$ **do** 9.         $f\left( \mathbf{x} \right) = \sum_{i = 1}^{N_{S}}C_{i(jk)}K\left\langle \mathbf{x},\mathbf{s}_{i} \right\rangle - \rho$ 10.         **if** $f\left( \mathbf{x} \right) > 0$ **then** 11.            $v\left( j \right)$++ 12.         **else** 13.            $v\left( k \right)$++ 14.     **end for** 15. **end for** 16. Class ← index of $max\left( v \right)$ 3.4. Gateway Application {#sec3dot4-sensors-17-00869} ------------------------ The proposed system is completed with a mobile personal gateway, which is implemented on a smartphone. The personal gateway application, written in Java on Android, connects via BT to the wearable node and allows to perform a set of test and tuning operations. In particular, the embedded system implements three operation modes: Streaming Mode (SM), Update Mode (UM) and Classification Mode (CM). The transmission of a dedicated control string from the app to the board manages the transitions between the operation modes and the CM is the default mode used for stand-alone control of the prosthesis. SM is used to stream EMG data to the gateway device, useful to test the positioning and functionality of the system and to collect example gestures for a personalized training of the SVM algorithm. Finally, UM allows to update the trained SVM model on the device. The personalized setup of the system is performed under the supervision of a clinician and it requires the user to correctly position the sensors, test their activation and to collect a training dataset composed by a few repetition of each gesture to recognize. When the SVM model is
79
3,181
605
68
3,812
0.769969
github_plus_top10pct_by_avg
y the conjunction $A\geq B,~B\geq A$. Constraints of the form $A =/= B$, yield two disjunctive cases. One obtained by replacing the $=/=$ in the pre- and postcondition by $>$ and one obtained by replacing it by $<$. The other conditions – i.e. $>,<$ and $\leq$ – are transformed into $\geq$-constraints in the obvious way. Implications with only one consequence are obtained by creating one implication for each consequence, with the pre-condition of the original implication. The resulting implications allow to apply Proposition \[prop:rem\_imp\]. These inequalities of the form, $p\geq0$, are then transformed into a set of *diophantine constraints*, i.e. constraints without universally quantified variables, by requiring that all coefficients of $p$ are non-negative. As proposed in [@DBLP:journals/corr/abs-0912-4360], the resulting diophantine constraints are then transformed into a SAT-problem. The constraints are then proven to have solutions by a SAT solver by inferring one possible solution. Evaluation ========== We have implemented our analysis and integrated it within our existing non-termination analyzer $pTNT$. The analyzer can be downloaded from\ http://www.cs.kuleuven.be/\~dean/iclp2011.html. We tested our analysis on a benchmark of 16 programs similar to those in the paper. These programs are also available online. To solve the resulting SAT-Problem, MiniSat [@ES03] is used. $ $ linear-class, 3 bits linear-class, 4 bits max2-class, 3 bits max2-class, 4 bits ----------- ---------------------- ---------------------- -------------------- -------------------- count\_to $+$ $+$ $+$ $+$ constants $+$ $+$ $+$ $OS$ int1 $+$ $+$ $+$ $+$ int2 $+$ $+$ $+$ $+$ int3 $+$ $+$
80
283
317
120
null
null
github_plus_top10pct_by_avg
iver" statement => "SELECT * from volunteer" } jdbc { jdbc_connection_string => "jdbc:mysql://localhost/homestead" jdbc_user => "homestead" jdbc_password => "secret" jdbc_driver_library => "/home/vagrant/Code/mysql-connector-java-5.1.38-bin.jar" jdbc_driver_class => "com.mysql.jdbc.Driver" statement => "SELECT * from contact" } } output { elasticsearch { document_id => "%{uid}" hosts => "localhost" } } My intention is to copy every table into a Type. How do I specify this? edit: "type" instead of "index" Thank you! A: What you can do is simply to add a field (using add_field) in each input denoting the type name which you want the data to be indexed in and then use that variable as the type name in the elasticsearch output. input { jdbc { jdbc_connection_string => "jdbc:mysql://localhost/homestead" jdbc_user => "homestead" jdbc_password => "secret" jdbc_driver_library => "/home/vagrant/Code/mysql-connector-java-5.1.38-bin.jar" jdbc_driver_class => "com.mysql.jdbc.Driver" statement => "SELECT * from volunteer" add_field => {"type" => "volunteer"} } jdbc { jdbc_connection_string => "jdbc:mysql://localhost/homestead" jdbc_user => "homestead" jdbc_password => "secret" jdbc_driver_library => "/home/vagrant/Code/mysql-connector-java-5.1.38-bin.jar" jdbc_driver_class => "com.mysql.jdbc.Driver" statement => "SELECT * from contact" add_field => {"type" => "contact"} } } output { elasticsearch { hosts => ["localhost"] index => "homestead" document_type => "%{type}" <--- specify the index here document_id => "%{uid}" } } Be aware though that using the same index to host several different mapping types might lead to type conflicts. The short story is that two different fields with the same name in two different types MUST ALWAYS have the same type
81
7
70
61
9
0.842493
github_plus_top10pct_by_avg
tten as $$\left\{ \begin{array}{r c l} B_{ij} &\sim& \mathcal{B}(p) \ \ i.i.d, \ i<j \\ B_{ii}&=&0 \\ B_{ij}&=&B{ji} \end{array} \right.$$ The graph $\tilde{G}$ of the new model, is derived from a deterministic graph with an exact cluster structure, whose edges have been disturbed Erdös Renyi random graph. For instance, this perturbation may arise because of a partial knowledge of the graph. Let $\tilde{A}$ be the adjacency matrix associated to $\tilde{G}$. $\tilde{A}$ is defined as follows: $\tilde{A}$ $ =A_* \bigoplus\limits^2 B$ where $\tilde{A}_{ij} = A_{ij*} + B_{ij} \ [2]$, namely, $\tilde{A}_{ij}= \left\{ \begin{array}{ll} 0 \ \ \mbox{ if } B_{ij}=1 \mbox{ and } A_{ij}=1 \\ \mbox{ or } B_{ij}=0 \mbox{ and } A_{ij}=0,\\ 1 \ \ \mbox{ if } B_{ij}=1 \mbox{ and } A_{ij}=0 \\ \mbox{ or } B_{ij}=0 \mbox{ and } A_{ij}=1. \end{array} \right. $ Graph clustering through spectral clustering {#section3} ============================================= Spectral clustering algorithm ----------------------------- Looking first at the ideal graph model, let $A_*$ and $D_*$ the adjacency and degree matrices associated to the graph $G_*$. Spectral clustering algorithm is based on graph Laplacian matrices. Among them, three different variants are used: - the Unormalized Laplacian: $L_*=D_*-A_*$, - the Symmetric Laplacian: $L_{sym*}=D_*^{-\frac{1}{2}}A_*D_*^{-\frac{1}{2}}$, - the Random Walk Laplacian: $L_{rw*}=I-D_*^{-1} A_*$. The original spectral clustering method has been proposed by [@Luxburg07] to cluster the nodes of the graph into $k$ connected components. The idea behind spectral clustering is to use the first $k$ eigenvectors (corresponding the $k$ smallest eigenvalues) a normalized or unormalized version of the Laplacian matrix (derived from the adjacency one) to recover the connected components of the graph. If these matrices are so appealing in graph clustering, it is because of the following proposition: \[prop1\](Number of connected components): The multiplicity $k$
82
303
214
115
991
0.796153
github_plus_top10pct_by_avg
(" ", el, maxsplit=4) for el in input] print(res) Output: [['a1', 'a2', 'a3', 'a4', 'Hello! welcome'], ['b1', 'b2', 'b3', 'b4', 'how are you'], ['c1', 'c2', 'c3', 'c4', 'you are welcome']] [Program finished] Ref: https://docs.python.org/2/library/re.html A: I assume that you meant each sublist only contains 5 elements and the last one can have space between words. If that was the case then you simply need to iterate through input list and split each string by only with maximum 5 elements (4 is the highest index) input = ['a1 a2 a3 a4 Hello! welcome','b1 b2 b3 b4 how are you','c1 c2 c3 c4 you are welcome'] list1 = [] for i in input: list1.append(i.split(' ', 4)) print(list1) Q: How to open file inside folder in current directory using fopen I want to open a file that is inside a folder in the current working directory like so: fopen("/folder/file.txt","r"); I'm unable to do so in this way, i get a "No such file or directory" error. How can i do this properly? Thank you in advance for any help. A: You have to mention that is a current directory. Try this, fopen("./folder/file.txt","r"); Or fopen("folder/file.txt","r"); If you mentioning like this /folder/file.txt it will search the directory from the root directory. So this is the reason for getting the error. Q: If the left regular representation of a finite group G contains an odd permutation, then G has a subgroup of index 2 I got to the point where I showed: $$[\pi(G):A_G \cap \pi(G)]=2$$ I have a trouble convincing myself of the final step. So if $\pi:G \rightarrow S_G$ is faithful (i.e. $\pi$ is injective), then $G$ can be identified with $\pi(G)$ and thus the preimage of $A_G \cap \pi(G)$ gives the subgroup of index as required. Is there any other (possibly, more "formal") way to argue this? Thanks! A: Let $f = \operatorname{sgn}\circ \pi$ be the composite map $f:G\to S_n \to C_2$ to the cyclic group of order $2$. There are two cases: Case I: $f(G)$ is trivial. Then $\pi(G) \subset A_n$. Case II: $f(G)=C_2$. Then, by the fi
83
604
114
103
1,251
0.792075
github_plus_top10pct_by_avg
return finalMessage; } /** * Función para descifrar mensaje con la clave privada. * * @param encrypted | Mensaje a descifrar. * @return | byte[] descifrado. */ public byte[] decryptMessage(byte[] encrypted) { byte[] finalMessage = null; try { Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding"); cipher.init(Cipher.DECRYPT_MODE, this.privateKey); finalMessage = cipher.doFinal(encrypted); } catch (IllegalBlockSizeException | NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | BadPaddingException ex) { } return finalMessage; } /** * Función para descifrar mensaje con la clave privada. * * @param encrypted | Mensaje a descifrar. * @return | String descifrado. */ public String decryptMessage(String encrypted) { byte[] finalMessage = null; try { Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1PADDING"); cipher.init(Cipher.DECRYPT_MODE, this.privateKey); byte[] encryptedByte = Base64.getDecoder().decode(encrypted); finalMessage = cipher.doFinal(encryptedByte); } catch (IllegalBlockSizeException | NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | BadPaddingException ex) { } return new String(finalMessage); } /** * Crea un certificado X509Certificate con las claves RSA generadas en la * clase. Se llamará a EncryptionRSA.buildParKey() si no se ha generado las * claves publica/privada. * * @param subjectDN | SubjectDN para el certificado X509Certificate; * @return X509Certificate | Certificado X509Certificate creado. */ public X509Certificate generateX509Certificate(String subjectDN) { X509Certificate x509Certificate = null; try { Provider provider = new BouncyCastleProvider(); Security.addProvider(provider); long now = System.cu
84
1,684
115
53
348
0.812446
github_plus_top10pct_by_avg
l figure that out later. Anyways ideas/suggestions would be helpful! =) A: If you want to get the noun elements which are in the office, you have to call office to write them. for (int x=0; x < office.length(); x++) { //this is same as what you do temp = temp + " paragraph " + office.get(x).noun; } Q: How to exclude read only fields using :input in jquery? thus far i've only been using some basic jquery selectors and functions. but i'm looking at this clear form function and i can't figure out how to add it so i can remove hidden inputs and readonly input from getting cleared. can anybody help? thanks. function clearForm(form) { // iterate over all of the inputs for the form // element that was passed in $(':input', form).each(function() { var type = this.type; var tag = this.tagName.toLowerCase(); // normalize case // it's ok to reset the value attr of text inputs, // password inputs, and textareas if (type == 'text' || type == 'password' || tag == 'textarea') this.value = ""; // checkboxes and radios need to have their checked state cleared // but should *not* have their 'value' changed else if (type == 'checkbox' || type == 'radio') this.checked = false; // select elements need to have their 'selectedIndex' property set to -1 // (this works for both single and multiple select elements) else if (tag == 'select') this.selectedIndex = -1; }); }; A: If the elements have a readonly attribute in their declaration, you can use jQuery’s :not() selector: $(':input:not([readonly])', form) Otherwise filter the read-only elements with something like this: $(':input', form).each(function() { if (this.readOnly) return; // … }); Q: Difference between OnTouch and OnClick Android Is there any difference between OnTouchListener and OnClickListener? I am not asking from programming point of view, but from User Experience point of view. Which one is better to use? Do we need to implement both? A: which one is better to use? It really depends on your req
85
428
91
95
630
0.803625
github_plus_top10pct_by_avg
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
16

Collection including Adanato/github_sim_300