_id
stringlengths
2
6
partition
stringclasses
3 values
text
stringlengths
4
46k
language
stringclasses
1 value
title
stringclasses
1 value
d8701
train
Use backticks to escape column (and table) names, not quotes INSERT INTO highscore(`Name`,`Score`) VALUES (@Name, @Score) A: Single-word column names don't need to be escaped (I don't think MySQL allows it, but I may be wrong);therefore, this should work: INSERT INTO highscore(Name,Score) VALUES (@Name, @Score); You may give an alias to a column, using spaces when you run a select statement, but I simply avoid them in general.
unknown
d8702
train
Surely it should be Default 960px and up? with 60*12 + 20* = 960px? If you allow for 20px padding before the first column, 20px between each each column and 20px after the last column the total is 12*(60+20) + 20 = 980px should the size of my PSD be 940px still (as it would normally?) or should it be 960px? Yes, design for 940px wide. As long as the device window is 980px or more it will display full width. If you are coming from 960.gs, the design width is the same. The difference is that bootstap has an extra 10px margin at the start and end of every row so it needs a 980px wide window to display full width. If you are looking for bootstap layout templates for the different widths, here is one good source https://benstewart.net/2012/06/bootstrap-responsive-photoshop-templates/ A: From bootstrap, this is correct... * *Large display 1200px and up *Default 980px and up *Portrait tablets 768px and above *Phones to tablets 767px and below *Phones 480px and below
unknown
d8703
train
Is this an installation using IBM Installation Mananger? If you've used it to install Worklight on Tomcat then it has also deployed a worklight.war file during installation. Make sure you undeploy this .war file via the Tomcat Manager view (typically http://localhost:8080/manager). I would also go to the file system and make sure no other files remain (the .war file, worklight.home, ...). Next, deploy your own .war file (probably nantian.war or alike).
unknown
d8704
train
You are right that LowerCaseTokenizer will remove all non-letters. It would very useful (as far as providing a meaningful answer) to see your schema, as I don't believe just using the lowercase filter factory should generate a Tokenizer of any kind. At any rate, though, there are plenty of other options for tokenizers. Both Standard or Classic might suit your needs better. Something along the line of: <analyzer> <tokenizer class="solr.StandardTokenizerFactory"/> <filter class="solr.LowerCaseFilterFactory"/> </analyzer> Might do well for you.
unknown
d8705
train
try this, instead of appending, try to access the index of the array. $data[] = array( 'check_date'=>$this->input->post('check_date'), 'device'=>$this->input->post('device')[$i], 'ip_address'=>$this->input->post('ip_address')[$i], 'nat_ip'=>$this->input->post('nat_ip')[$i], 'check_os'=>$this->input->post('check_os')[$i], 'app_name'=>$this->input->post('app_name')[$i], 'check_app_a'=>$this->input->post('check_app_a')[$i], 'check_app_b'=>$this->input->post('check_app_b')[$i], 'remark'=>$this->input->post('remark' )[$i], 'report'=>$this->input->post('report')[$i], ); A: Try This: $data_table = $this->input->post(NULL, TRUE); if (empty($data_table['device'])) { redirect('admin/viewServerChecklist?message=error'); } $required = array('device', 'ip_address', 'nat_ip', 'check_os', 'app_name', 'check_app_a', 'check_app_b', 'remark', 'report'); $data = array(); foreach ($data_table['device'] as $key => $value) { // check list table. if value required not exist. continue to next index $row = array(); foreach ($required as $key2 => $value2) { if (!isset($data_table[$value2][$key])) continue; $row[$value2] = $data_table[$value2][$key]; } // since check_date is not array. we need to parse to row data $row['check_date'] = $data_table['check_date']; $data[] = $row; } $this->db->insert_batch('server_checklist', $data); /*foreach($_POST['data'] as $d) { $this->db->insert('server_checklist',$d); } */ redirect('admin/viewServerChecklist');
unknown
d8706
train
Tinkered around and a solution: Go to Phpstorm Preferences (on Mac, 'Settings' on PC) > Editor > Colors & Fonts > PHP > PHP Code > Background On my Mac the background color was set incorrectly to white (inherited). I then unchecked "Use Inherited Attributes" and set it to black. Problem fixed. I don't know why this was set to white as on my PC it is set to black. I had done a phpstorm full settings export from pc, and imported to mac, using the generated settings.jar file so I can't say why this did not import properly. Don't know if something changed between versions 9.0 and 10.0 or whether it got skipped somehow during import.
unknown
d8707
train
Knife-Reporting plugin is used to analyze the reports sent by clients to the server. [knife runs help ] run this command to find the new functionalists given by knife reporting. Question Seems to be a similar question. chef doc has the code for handling the report and sending it to the server. It has to be shipped with chef handler cookbook and enabled before chef run. For getting json files which contains all info about node run as report. Get chef_handler from community. Add recipe[chef_handler::json_file] in your run list. This will get the report as a json file and store in your /var/chef/reports (can be changed in chef_handler cookbook) in client machine.
unknown
d8708
train
I suggest to use Activity instead of FragmentActivity.Hope it works
unknown
d8709
train
If you're working with a pure memory table, there should not be any problem to query record count by the RecordCount property. Maybe you expect having NULL and empty value records included in a filtered view when having filter Value LIKE '%%', but it's not so. When having dataset like this: ID | Value 1 | NULL 2 | '' 3 | 'Some text' And applying filter like this: var S: string; begin S := ''; FDMemTable.Filtered := False; FDMemTable.Filter := 'Value LIKE ' + QuotedStr('%' + S + '%'); FDMemTable.Filtered := True; { ← FDMemTable.RecordCount should be 1 here for the above dataset } end; The empty and NULL value records should not be included in the view. Here is a short proof: var S: string; MemTable: TFDMemTable; begin MemTable := TFDMemTable.Create(nil); try MemTable.FieldDefs.Add('ID', ftInteger); MemTable.FieldDefs.Add('Value', ftString, 500); MemTable.IndexDefs.Add('PK_ID', 'ID', [ixPrimary]); MemTable.CreateDataSet; MemTable.AppendRecord([1, NULL]); MemTable.AppendRecord([2, '']); MemTable.AppendRecord([3, 'Some text']); S := ''; MemTable.Filtered := False; MemTable.Filter := 'Value LIKE ' + QuotedStr('%' + S + '%'); ShowMessage(Format('Total count: %d', [MemTable.RecordCount])); { ← should be 3 } MemTable.Filtered := True; ShowMessage(Format('Filtered count: %d', [MemTable.RecordCount])); { ← should be 1 } MemTable.Filtered := False; ShowMessage(Format('Total count: %d', [MemTable.RecordCount])); { ← should be 3 } finally MemTable.Free; end; end; A: I think this is just a minor FD quirk. The code below works as expected, with Cds_NaMenu declared as a TFDMemTable (though it would have been nice if you could have dropped the Cds_ to avoid confusion). The key difference, I think, is the call to .Locate after the filter is cleared. The reason I put it there is because it causes the dataset to scroll and, I imagine, to recalculate its RecordCount as a result. Probably any other operation which causes a scroll would have the same effect, even MoveBy(0) - try it. procedure TForm1.FormCreate(Sender: TObject); var _recCount : Integer; ID : Integer; sTexto : String; begin sTexto := 'xxx'; // added Cds_NaMenu.FieldDefs.Add('ID', ftInteger); Cds_NaMenu.FieldDefs.Add('MN_TELA_CODIGO', ftInteger); Cds_NaMenu.FieldDefs.Add('MN_MENU_PESQUISA', ftString, 500); Cds_NaMenu.FieldDefs.Add('DISPONIBILIDADE', ftInteger); Cds_NaMenu.IndexDefs.Add('Ordem', 'MN_TELA_CODIGO', []); Cds_NaMenu.CreateDataSet; Cds_NaMenu.LogChanges := False; Cds_NaMenu.IndexName := 'Ordem'; Cds_NaMenu.Append; Cds_NaMenu.FieldByName('ID').AsInteger := 666; // added Cds_NaMenu.FieldByName('DISPONIBILIDADE').AsInteger := 1; Cds_NaMenu.Post; _recCount := Cds_NaMenu.RecordCount; // Result = 1 ID := Cds_NaMenu.FieldByName('ID').AsInteger; // added Cds_NaMenu.Filter := 'DISPONIBILIDADE=1 AND MN_MENU_PESQUISA like ' + QuotedStr('%' + sTexto + '%'); Cds_NaMenu.Filtered := True; _recCount := Cds_NaMenu.RecordCount; // Result = 0; Cds_NaMenu.Filtered := False; Cds_NaMenu.Filter := ''; // Now force the dataset to scroll if Cds_NaMenu.Locate('ID', ID, []) then; // added _recCount := Cds_NaMenu.RecordCount; // Result = 1; Caption := IntToStr(_recCount); // added end;
unknown
d8710
train
Seems you can use map padding GoogleMap.setPadding(): public void setPadding (int left, int top, int right, int bottom) Sets padding on the map. This method allows you to define a visible region on the map, to signal to the map that portions of the map around the edges may be obscured, by setting padding on each of the four edges of the map. Map functions will be adapted to the padding. For example, the zoom controls, compass, copyright notices and Google logo will be moved to fit inside the defined region, camera movements will be relative to the center of the visible region, etc.
unknown
d8711
train
If you clear the app data, shared preferences will also be cleared, you have to store in your database or cloud. A: there is a trick for that, it is not a normal way but works: <application android:label="MyApp" android:icon="@drawable/icon" android:manageSpaceActivity=".ActivityOfMyChoice"> by adding this line to your manifest instead of "Clear Data" button for "Manage Space" which launches ActivityOfMyChoice will be shown, it calls your activity and the Activity and you can finish your activity there like this: public class ActivityOfMyChoice extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); finish(); } } for me, this method worked! let me know about the result for more info, if you want to save your data even after "clear data" you might use the database to save your data and save your database in a file out of your application place in the device.
unknown
d8712
train
The cleanest way would be to use sqlite databases. Using SharedPreferences is much easier, especially for beginners. You could do it like that: You save a 3rd item, the actual entry count as SharedPreference. Everytime you save a new entry you increment this counter. Then you append the current counter number to the TIME and SCORE keys. // Saves a new entry | Attention: code not tested! save(int score, int time){ SharedPreference pref = ... SharedPreference.Editor editor = ... int newEntryID = pref.getInt("numEntries", 0) + 1; editor.setInt("numEntries", newEntryID); editor.setInt("score" + newEntryID, score); editor.setString("time" + newEntryID, time); editor.commit(); } Assuming "score" is the SharedPreference-Key for SCORE and same for the time. Reading would be of the same scheme. for(int i=0; i<numEntries; ++i){ pref.getInt("score" + i, 0); ... } A: using the shared preference you can store both, 1) first you have to store time, once this is done you have to store score mapped on the given time, you are doing this way, edit.putString("DATA", strTime+" "+intScore); But you can take different approach if you have only one player playing at one time, edit.putString("TIME", strTime); edit.putString(strTime, strScore); 1:10 .............. 175 So here first you mapped your time with TIME and then you mapped score 175 with 1:10 Hope this will help you A: Good idea would be to define Java bean holding score ( say with 2 Fields, time in seconds / points / maybe date / name / whatrever else fields you like to store). You can easily do following with them: * *sort in a list and limit their amount ( you do not like to have 10000 of score entries, 100 will be anough ) *marshall this list to / from JSON ( Shameless self advertising: https://github.com/ko5tik/jsonserializer ) *store JSON in a shared preference or in a private application file (I store up to 100 local highscore entries, and 1000 all time scores and use files)
unknown
d8713
train
Let's have the size of the screen size of 480 (pixels), with the original diameter of the ball being 10 pixels. Original size of ball = bOriginal = 10 Distance represented by screen = s = 480 Distance ball has travelled = x Diameter of the ball = b = bOriginal You would have a flag for when the ball reaches a certain distance from the edge of the screen. After which you have your velocity, which you already know; this can also be thought of as the rate the ball is moving towards the edge of the screen, therefore the rate at which the screen must expand with respect to the size of the ball to ensure the total distance the ball has travelled is included within the size of the screen. If x >= 475 ratio of screen size to distance = r = 480 / (x+5) b = bOriginal * r end This will demonstrate a "zoom-out" in that the ball will get continually smaller to ensure that the total distance travelled fits into the size of the screen.
unknown
d8714
train
You can use moment-timezone. * *Install the moment-timezone: npm install --save moment-timezone *Install types: npm install -D @types/moment-tipes *Import to your service: import "moment-tipes" In your angular service: public convertDate(selectedTimezone: string): void { this.date = moment(this.date).tz(selectedTimezone).format("DD/MM/YYYY - HH:mm"); }
unknown
d8715
train
This is a bug with MetPy's wet_bulb_temperature function in handling NumPy scalars, so thank you for identifying the issue! A pull request fixing this has been submitted, which should make it into the upcoming MetPy v1.3.0 release. For now, you will need to somehow override the array shape recognition that exists in wet_bulb_temperature. Converting from a NumPy scalar to a Python scalar as you discovered is one such way to do so. Another is converting to 1D NumPy arrays, like the following: Twb = mpcalc.wet_bulb_temperature( *(np.atleast_1d(arg) for arg in (MUp[0], MUp[1], MUp[2])) )
unknown
d8716
train
I think you can to do two separate groupby: df = df.sort_values(['team','round']) out = (df.groupby(['team','home_dummy']).tail(6) .groupby(['team','home_dummy'])['points'].mean() .unstack('home_dummy') .add_prefix('mean_home_') ) out['mean_total'] = df.groupby('team').tail(6).groupby('team')['points'].mean() Output: home_dummy mean_home_0 mean_home_1 mean_total team Athlético-PR 29.806667 38.271667 33.108333 Another option is to write a udf so as to reduce the two groupby to one: def last6mean(x): return x.tail(6).mean() out = (df.groupby(['team','home_dummy'])['points'] .apply(last6mean) .unstack('home_dummy') .add_prefix('mean_home_') ) out['mean_total'] = df.groupby('team')['points'].apply(last6mean) A: You can create two dataframes for filtering for the 6 largest with groupby and then get the means and merge together: First make sure they are numeric: df['round'] = df['round'].astype(int) df['points'] = df['points'].astype(float) OR df['round'] = pd.to_numeric(df['round'], errors='coerce') df['points'] = pd.to_numeric(df['points'], errors='coerce') Then, you can run the following: df1 = (df.loc[df.index.isin(df.groupby('team')['round'].nlargest(6).reset_index().iloc[:,1]), ['team', 'points']].groupby('team')['points'].mean().rename('mean_total').reset_index()) df2 = (df.loc[df.index.isin(df.groupby(['team','home_dummy'])['round'].nlargest(6).reset_index().iloc[:,2]), ['team', 'home_dummy', 'points']].groupby(['team','home_dummy'])['points'].mean() .unstack(1).add_prefix('mean_home_').reset_index()) df1.merge(df2, on='team') Out[1]: team mean_total mean_home_0 mean_home_1 0 Athlético-PR 33.108333 29.806667 38.271667 You could also create a function to make cleaner: def f(df, cols): return df.loc[df.index.isin(df.groupby(cols)['round'].nlargest(6).reset_index().iloc[:, len(cols)]), cols + ['points']].groupby(cols)['points'].mean() (f(df, ['team']).rename('mean_total').reset_index().merge( f(df, ['team', 'home_dummy']).unstack(1).add_prefix('mean_home_').reset_index())) Out[2]: team mean_total mean_home_0 mean_home_1 0 Athlético-PR 33.108333 29.806667 38.271667 A: I know that there's already awesome answers here, but I'd just like to share one using pivot_table: If your DataFrame looks something like this team home_dummy round points 0 A 0 1 3 1 A 0 2 4 2 A 1 3 7 3 A 1 4 8 4 B 0 1 3 5 B 1 2 6 6 B 1 3 9 7 B 0 4 12 8 C 0 1 5 9 C 1 2 5 10 C 1 3 5 11 C 0 4 5 Then you could do something like: N = 2 df['points'] = df['points'].astype(float) result = df.pivot_table(index='team', columns='home_dummy', values='points', aggfunc=lambda x: x.tail(N).mean()) result.rename({i: f"mean_home_{i}" for i in result.columns}, axis=1, inplace=True) result.columns.name = None result['mean_total'] = df.groupby('team').tail(N).groupby('team')['points'].mean() Which will give you the following dataframe mean_home_0 mean_home_1 mean_total team A 3.5 7.5 5.5 B 7.5 7.5 7.5 C 5.0 5.0 5.0
unknown
d8717
train
The timestamp query parameter is added only in development mode, i.e. if you start the next.js app with: npx next dev To start a production build, run: npx next build npx next start This will allow caching of all JS files, as well as make them much leaner and faster by removing all of the development and debug tools.
unknown
d8718
train
Try this # add a white space before MDF if location is MDF so that MDF locations come before all others # (white space has the lowest ASCII value among printable characters) sorted(dev_dict.values(), key=lambda d: " MDF" if (v:=d['location'])=='MDF' else v) # another, much simpler way (from Olvin Roght) sorted(dev_dict.values(), key=lambda d: d['location'].replace('MDF', ' MDF')) # [{'hostname': 'router-a-1.nunya.com', 'location': 'MDF'}, # {'hostname': 'core-1.nunya.com', 'location': 'MDF'}, # {'hostname': '...', 'location': '...'}, # {'hostname': 'switch-1.nunya.com', 'location': 'IDF01'}, # {'hostname': 'switch-2.nunya.com', 'location': 'IDF02'}, # {'hostname': 'switch-30.nunya.com', 'location': 'IDF30'}] Click here to see the complete ASCII table.
unknown
d8719
train
in Java String literals are not allowed more than one line . so you can do using '+' like String sql= "SELECT m.month,IFNULL(x.cnt, 0) AS cnt FROM "+ " (SELECT 1 AS month UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9 UNION SELECT 10 UNION SELECT 11 UNION SELECT 12) AS m "+ " LEFT JOIN (SELECT DATE_FORMAT(date, '%c') as month, COUNT(*) AS cnt FROM ssl_sales where YEAR(date)=2017 AND status_ssl='new' GROUP BY month) AS x ON m.month = x.month "+ " ORDER BY m.month DESC"; or write it in one line String sql="SELECT m.month,IFNULL(x.cnt, 0) AS cnt FROM (SELECT 1 AS month UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9 UNION SELECT 10 UNION SELECT 11 UNION SELECT 12) AS m LEFT JOIN (SELECT DATE_FORMAT(date, '%c') as month, COUNT(*) AS cnt FROM ssl_sales where YEAR(date)=2017 AND status_ssl='new' GROUP BY month) AS x ON m.month = x.month ORDER BY m.month DESC";
unknown
d8720
train
Did it! Okay so API.get doesn't like body's being passed in. Instead, it wants a query parameter. So the lambda params looks like: var params = { TableName: event.stageVariables.user, FilterExpression: "handle = :handle", ExpressionAttributeValues: { ":handle": event["queryStringParameters"]["handle"] } }; And the front end function is: export async function scanHandles(){ return new Promise((resolve, reject) => { let { auth } = store.getState() let handle = auth.handle_update let path = `/u/scan-handle?handle=${handle}` let myInit = { headers: { 'Content-Type': 'application/json' }, } API.get(apiName, path, myInit) .then((resp) => { // if false, then handle does not exist // if true, then handle already exists resolve(resp) }) .catch((error) => { console.warn('Scan Handle', error) reject(error) }) }) } Works on both iOS and Android. Wonder why it wasn't working before?
unknown
d8721
train
Observing the methods on the other scanned classes, they are protected methdos, so I change it to public to solve the problem.
unknown
d8722
train
@XmlTransient works, but with getter. I tested it with EclipseLink/MOXy 2.7.7. So try @XmlTransient public Parent getParent() { return parent; }
unknown
d8723
train
The "push" is just a synching between two git repositories. In a typical case its the synching between the copy of the git repo on your local machine to a central repo. AFAIK the push is not really recorded as an artifact in the git meta data. So you cannot refer a push by any identifier. So to get to your question, you will be able to find differences between two different commits, or two different states of the same branch assuming it has not been pushed/synced. Here are a few commands that will help you do that: git log --oneline --name-only develop..origin/develop This will give you a list of all commits between the local develop branch and the remote develop branch, this will also give you list of all the files changed in that commit. If you dont want file names just remove the --name-only arg. And if you want to visualize, you can use git log --oneline --name-only --graph develop..origin/develop. THe develop..origin/develop``` can be tags, commits or branches. In git speak ```tree-ish. You can potentially tag pushes and then figure out the diff between tags.
unknown
d8724
train
I guess I just found a solution, I added a term that if the mouse moves to do nothing, my new code: private void LateUpdate() { //When mouse button is released if (Input.GetMouseButtonUp(0)) { //If the mouse moves after clicking if (Input.GetAxis("Mouse X") < 0 || (Input.GetAxis("Mouse X") > 0)) { //Do nothing } else { //If no movement is detected, then send ray to object and trigger event RaycastHit hit; //Create a ray that projects at the position of the clicked mouse position Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); //If the ray hits the target object if (Physics.Raycast(ray, out hit, 100.0f)) { //Load the scene that corresponds to the clicked object LoadScene(hit.transform.gameObject); } } } } A: Most click implementations detect both the mouse down and mouse up events to determine if an object was clicked. I would suggest something like this... if(Input.GetMouseButtonDown(0)) { mouseWasPressedOverObject = IsMouseOverObject(); } else if(Input.GetMouseButtonUp(0)) { if(mouseWasPressedOverObject && IsMouseOverObject()) { //Object clicked } mouseWasPressedOverObject = false; }
unknown
d8725
train
The return value is available in Jest v23. Apps bootstrapped using create-react-app with react-scripts-ts as of today (Aug 1, 2018) are using Jest v22. create-react-app will be updated to use Jest v23 in the near future. In the meantime, testing the return value is possible using Sinon fakes. In this case the updated test looks like this: // Button.unit.test.tsx import { mount, shallow } from "enzyme"; import * as React from "react"; import * as sinon from 'sinon'; import { Button, IButtonProps } from "./Button"; interface IOnClickParamsTest { a: number, b: number } describe('App component', () => { it('renders without crashing', () => { shallow( <Button /> ); }); it('test the onClick method', () => { const onClick = sinon.fake((event: React.MouseEvent<IButtonProps<IOnClickParamsTest>>, params: IOnClickParamsTest) => params.a + params.b); const onClickParams: IOnClickParamsTest = { a: 4, b: 5 }; const buttonComponent = mount( <Button<IOnClickParamsTest> onClick={onClick} handlersParams={{ onClickParams }} /> ); buttonComponent.simulate("click"); expect(onClick.calledOnce).toBe(true); expect(onClick.firstCall.args[1]).toBe(onClickParams); expect(onClick.returnValues[0]).toBe(9); }); });
unknown
d8726
train
What if you match your output with: { $match: { "SubCategory.Brand.Offer": {"$exists": true} } This should return only documents the have a Brand and an Offer. You can check here: mongoplayground EDIT: to remove also the Offers that are empty, please check this option here: mongoplayground_2
unknown
d8727
train
Use word-wrap: break-word to break the text up in the middle of a word: .container { width: 200px; word-wrap: break-word; }​ Demo: http://jsfiddle.net/8yL6j/1/ A: It seems that you would like browsers to put as many characters on a line that fit there and then break, with no regard to normal line breaking behavior, rules of languages, etc., then use word-break: break-all on the element.
unknown
d8728
train
int Math.Sign(Double value) returns an integer ... (-1/0/1). Double.Nan doesn't seem like an integer. Probably that's the main reason why it throws an exception. It could also be discussed why Int.NaN doesn't exist, we already had that discussion at Why is Nan (not a number) only available for doubles? The behaviour of Math.Sign(Double) is documented at https://msdn.microsoft.com/en-us/library/ywb0xks3(v=vs.110).aspx
unknown
d8729
train
The hardcoded values of 200 and 550 will not work when the navbar dimensions are adjusted for diffeerent size screens. I've changed it to retrieve the offsetWidth and offsetLeft of the (.navbar-toggle button or .nav-item[0]) and .navbar-brand image to bounce back. body { margin: 0; padding: 0; } div{ width: 100%; height: 100%; } .navbar-default { background: none; } .navbar{ position: fixed; z-index: 10; padding: 10px 0 10px 10px; top: 0; width: 100%; } footer{ background-color:#e6e6e6; } .jumbotron{ background-image: url('download.jpeg'); color: white; background-attachment: fixed; background-repeat: no-repeat; background-size: cover; min-height: 400px; margin-top: 0px; margin-bottom: 8px; } a{ color:#2e5984; } .navbar-brand{ height: 60px; width: 100px; } #aboutusimg{ background-size: 100%; background-image: url(download.jpeg); background-repeat:no-repeat; height: 400px; } /* slider */ .carousel .carousel-item { width: 100%; height: 100vh; background-size: cover; background-position: center; } .carousel .carousel-item:first-of-type { background-image: url('download.jpeg'); } .carousel .carousel-item:nth-of-type(2) { background-image: url("download.jpeg"); } .carousel .carousel-item:last-of-type { background-image: url("download.jpeg"); } .carousel-control-prev-icon, .carousel-control-next-icon { width: 50px; height: 50px; } /* partners slider, about page */ /* carousel */ h2{ text-align:center; padding: 20px; } /* Slider */ .slick-slide { margin: 0px 20px; } .slick-slide img { width: 100%; } .slick-slider { position: relative; display: block; box-sizing: border-box; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-touch-callout: none; -khtml-user-select: none; -ms-touch-action: pan-y; touch-action: pan-y; -webkit-tap-highlight-color: transparent; } .slick-list { position: relative; display: block; overflow: hidden; margin: 0; padding: 0; } .slick-list:focus { outline: none; } .slick-list.dragging { cursor: pointer; cursor: hand; } .slick-slider .slick-track, .slick-slider .slick-list { -webkit-transform: translate3d(0, 0, 0); -moz-transform: translate3d(0, 0, 0); -ms-transform: translate3d(0, 0, 0); -o-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); } .slick-track { position: relative; top: 0; left: 0; display: block; } .slick-track:before, .slick-track:after { display: table; content: ''; } .slick-track:after { clear: both; } .slick-loading .slick-track { visibility: hidden; } .slick-slide { display: none; float: left; height: 100%; min-height: 1px; } [dir='rtl'] .slick-slide { float: right; } .slick-slide img { display: block; } .slick-slide.slick-loading img { display: none; } .slick-slide.dragging img { pointer-events: none; } .slick-initialized .slick-slide { display: block; } .slick-loading .slick-slide { visibility: hidden; } .slick-vertical .slick-slide { display: block; height: auto; border: 1px solid transparent; } .slick-arrow.slick-hidden { display: none; } /* lil dude */ #riding{ width: 50px; height: 40px; z-index: 30; position: fixed; top: 25px; left: 0px; transform: rotateY(0deg); } #message{ color: white; position: fixed; top: 0; left: 0; } <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> <title>CountrySideBycicling</title> <link rel="stylesheet" href="main.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-social/5.1.1/bootstrap-social.min.css"> <script src="https://kit.fontawesome.com/8333c8288f.js" crossorigin="anonymous"></script> </head> <body> <!-- lil dude --> <h6 id="message"></h6> <img src="../lil dude/riding.gif" alt="riding" id="riding"> <script> let message = document.getElementById('message'); let speed = 5; let lastspeed = 0; let counter = 0; let x = 50; let y = 25; let mX = 0; let mY = 0; //flipping and animating function move() { x += speed; document.getElementById('riding').style.left=(x + "px"); var v=document.getElementsByClassName('navbar-toggler')[0]; if(v&&v.offsetLeft===0) v=document.getElementsByClassName('nav-item')[0]; var w=document.getElementsByClassName('navbar-brand')[0]; if (speed > 0 && x + document.getElementById('riding').style.width >= (v&&(v.offsetLeft-v.offsetWidth))) { speed = -5; document.getElementById('riding').style.transform="rotateY(150deg)"; } if (speed < 0 && x <= (!w||(w.offsetLeft+w.offsetWidth))) { speed = 5; document.getElementById('riding').style.transform="rotateY(0deg)"; } if (speed == 0) { document.getElementById('riding').src="../lil dude/stop.gif"; message.style.top = (y - 40 + "px"); message.style.left = (x + 50 + "px"); message.innerHTML = "Wear a Helmet!"; setTimeout(reset, 2000);console.log('hi'); } else requestAnimationFrame(move); } //mouse move collision detection window.addEventListener('mousemove', function(e) { mX = e.clientX; mY = e.clientY; if (mX >= x && mX <= x + 50 && mY >= y && mY <= y + 40) { lastspeed = speed || lastspeed; if (counter == 0) { slow(); counter = 1; } } console.log(mX + " " + mY) }); //braking it function slow() { document.getElementById('riding').src="../lil dude/brake.gif"; do { if (speed > 0){ speed -= 0.1; } else if(speed < 0) { speed += 0.1; } } while (Math.abs(speed)>0.01); speed=0; } //reset function reset() { document.getElementById('riding').src="../lil dude/riding.gif"; message.innerHTML = ""; do { if (lastspeed > 0) { speed += 0.1; } else if (lastspeed < 0) { speed -= 0.1; }console.log(lastspeed,speed); } while(5-Math.abs(speed) > 0.01); move(); counter = 0; } move(); </script> <nav class="navbar navbar-expand-lg navbar-dark bg-dark static-top"> <div class="container"> <a class="navbar-brand" href="#"> <!-- logo --> <img class = "navbar-brand" src="https://w7.pngwing.com/pngs/764/321/png-transparent-bicycle-shop-cycling-logo-fixed-gear-bicycle-cyclist-top-sport-bicycle-logo.png" alt=""> </a> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="navbarResponsive"> <ul class="navbar-nav ml-auto"> <li class="nav-item active"> <a class="nav-link" href="index.html">Home <span class="sr-only">(current)</span> </a> </li> <li class="nav-item"> <a class="nav-link" href="about.html">About</a> </li> <li class="nav-item"> <a class="nav-link" href="gallery.html">Gallery</a> </li> <li class="nav-item"> <a class="nav-link" href="services.html">Services</a> </li> <li class="nav-item"> <a class="nav-link" href="contacts.html">Contact</a> </li> <li class="nav-item"> <a class="nav-link" href="brands.html.html">Brands</a> </li> </ul> </div> </div> </nav> <div style="height: 50;"></div> <div class="jumbotron text-center"> <div class="container"> <div style="height: 25px;"></div> <h1>CountrySideBycicling</h1> <div style="height: 25px;"></div> <p> Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam officiis aperiam temporibus exercitationem hic provident nesciunt, quod officia neque quam sint dicta, mollitia commodi illo necessitatibus inventore blanditiis eveniet maiores. </p> <div style="height: 25px;"></div> <button class="btn btn-primary">Read More</button> </div> </div> <!-- Page Content --> <div class="container"> <!-- Heading Row --> <div class="row align-items-center my-5"> <div class="col-lg-7"> <img class="img-fluid rounded mb-4 mb-lg-0" src="http://placehold.it/900x400" alt=""> </div> <!-- /.col-lg-8 --> <div class="col-lg-5"> <h1 class="font-weight-light">Business Name or Tagline</h1> <p>This is a template that is great for small businesses. It doesn't have too much fancy flare to it, but it makes a great use of the standard Bootstrap core components. Feel free to use this template for any project you want!</p> <a class="btn btn-primary" href="#">Call to Action!</a> </div> <!-- /.col-md-4 --> </div> <!-- /.row --> <!-- Call to Action Well --> <div class="card text-white bg-secondary my-5 py-4 text-center"> <div class="card-body"> <p class="text-white m-0">This call to action card is a great place to showcase some important information or display a clever tagline!</p> </div> </div> <!-- /.col-md-4 --> </div> <!-- /.row --> </div> <!-- /.container --> <!-- Content section --> <section class="py-5"> <div class="container"> <h1>Section Heading</h1> <p class="lead">Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aliquid, suscipit, rerum quos facilis repellat architecto commodi officia atque nemo facere eum non illo voluptatem quae delectus odit vel itaque amet.</p> </div> </section> <!-- Image Section - set the background image for the header in the line below --> <section class="py-5 bg-image-full" style="background-image: url('https://unsplash.it/1900/1080?image=1081');"> <!-- Put anything you want here! There is just a spacer below for demo purposes! --> <div style="height: 200px;"></div> </section> <!-- Content section --> <section class="py-5"> <div class="container"> <h1>Section Heading</h1> <p class="lead">Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aliquid, suscipit, rerum quos facilis repellat architecto commodi officia atque nemo facere eum non illo voluptatem quae delectus odit vel itaque amet.</p> </div> </section> <!-- slider --> <div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel"> <ol class="carousel-indicators"> <li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li> <li data-target="#carouselExampleIndicators" data-slide-to="1"></li> <li data-target="#carouselExampleIndicators" data-slide-to="2"></li> </ol> <div class="carousel-inner" role="listbox"> <div class="carousel-item active"></div> <div id="target" class="carousel-item"></div> <div class="carousel-item"></div> </div> <a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev"> <span class="carousel-control-prev-icon" aria-hidden="true"></span> <span class="sr-only">Previous</span> </a> <a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next"> <span class="carousel-control-next-icon" aria-hidden="true"></span> <span class="sr-only">Next</span> </a> </div> <div style="height: 50px;"></div> </div> </div> <div class="container"> <!-- Content Row --> <div class="row"> <div class="col-md-4 mb-5"> <div class="card h-100"> <div class="card-body"> <h2 class="card-title">Card One</h2> <p class="card-text">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Rem magni quas ex numquam, maxime minus quam molestias corporis quod, ea minima accusamus.</p> </div> <div class="card-footer"> <a href="#" class="btn btn-primary btn-sm">More Info</a> </div> </div> </div> <!-- /.col-md-4 --> <div class="col-md-4 mb-5"> <div class="card h-100"> <div class="card-body"> <h2 class="card-title">Card Two</h2> <p class="card-text">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quod tenetur ex natus at dolorem enim! Nesciunt pariatur voluptatem sunt quam eaque, vel, non in id dolore voluptates quos eligendi labore.</p> </div> <div class="card-footer"> <a href="#" class="btn btn-primary btn-sm">More Info</a> </div> </div> </div> <!-- /.col-md-4 --> <div class="col-md-4 mb-5"> <div class="card h-100"> <div class="card-body"> <h2 class="card-title">Card Three</h2> <p class="card-text">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Rem magni quas ex numquam, maxime minus quam molestias corporis quod, ea minima accusamus.</p> </div> <div class="card-footer"> <a href="#" class="btn btn-primary btn-sm">More Info</a> </div> </div> </div> </div> </div> <!-- Footer --> <footer class="page-footer font-small mdb-color pt-4"> <!-- Footer Links --> <div class="container text-center text-md-left"> <!-- Footer links --> <div class="row text-center text-md-left mt-3 pb-3"> <!-- Grid column --> <div class="col-md-3 col-lg-3 col-xl-3 mx-auto mt-3"> <h6 class="text-uppercase mb-4 font-weight-bold">CountrySideBycicling</h6> <p>Here you can use rows and columns to organize your footer content. Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p> </div> <!-- Grid column --> <hr class="w-100 clearfix d-md-none"> <!-- Grid column --> <div class="col-md-2 col-lg-2 col-xl-2 mx-auto mt-3"> <h6 class="text-uppercase mb-4 font-weight-bold">Brand Sites</h6> <p> <a href="#!">Bikesite</a> </p> <p> <a href="#!">Bikesite</a> </p> <p> <a href="#!">Bikesite</a> </p> </div> <!-- Grid column --> <hr class="w-100 clearfix d-md-none"> <!-- Grid column --> <div class="col-md-3 col-lg-2 col-xl-2 mx-auto mt-3"> <h6 class="text-uppercase mb-4 font-weight-bold">Useful links</h6> <p> <a href="gallery.html">Gallary</a> </p> <p> <a href="brands.html">Brands</a> </p> <p> <a href="about.html">About</a> </p> </div> <!-- Grid column --> <hr class="w-100 clearfix d-md-none"> <!-- Grid column --> <div class="col-md-4 col-lg-3 col-xl-3 mx-auto mt-3"> <h6 class="text-uppercase mb-4 font-weight-bold">Contact</h6> <p> <i class="fas fa-home mr-3"></i> windsor, oh, cox road</p> <p> <i class="fas fa-envelope mr-3"></i> [email protected]</p> <p> <i class="fas fa-phone mr-3"></i> + 01 234 567 88</p> </div> <!-- Grid column --> </div> <!-- Footer links --> <hr> <!-- Grid row --> <div class="row d-flex align-items-center"> <!-- Grid column --> <div class="col-md-7 col-lg-8"> <!--Copyright--> <p class="text-center text-md-left">© 2020 Copyright: <a href="http://www.countrysidebicycling.com/"> <strong>countrysidebicycling.com</strong> </a> </p> </div> <!-- Grid column --> <!-- Grid column --> <div class="col-md-5 col-lg-4 ml-lg-0"> <!-- Social buttons --> <div class="text-center text-md-right"> <ul class="list-unstyled list-inline"> <li class="list-inline-item"> <a class="btn btn-social-icon btn-vk"> <span class="fa fa-facebook"></span> </a> </li> <li class="list-inline-item"> <a class="btn btn-social-icon btn-vk"> <span class="fa fa-instagram"></span> </a> </li> <li class="list-inline-item"> <a class="btn btn-social-icon btn-vk"> <span class="fa fa-twitter"></span> </a> </li> <li class="list-inline-item"> <a class="btn btn-social-icon btn-vk"> <span class="fa fa-pinterest"></span> </a> </li> </ul> </div> </div> <!-- Grid column --> </div> <!-- Grid row --> </div> <!-- Footer Links --> </footer> <script src="jquery.slim.min.js"></script> <script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script> <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script> </body> </html> here is the css
unknown
d8730
train
please check this, hope it will work :-) var slider = document.getElementById("myRange"); var output = document.getElementById("dynamicSet"); var isShow = true output.innerHTML = slider.value update=()=>{ output.innerHTML = slider.value; // Display the default slider value console.log(slider.value) } // Update the current slider value (each time you drag the slider handle) //let update = () => output.innerHTML = slider.value; slider.addEventListener('input', update); <div class="slidecontainer"> <p>Aantal sets: <span id="dynamicSet"></span></p> <input type="range" min="1" max="10" value="50" class="slider" id="myRange"> </div> A: you can try this let update = () => { output.innerHTML = slider.value; console.log(slider.value) }
unknown
d8731
train
Test with this: general.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if(isChecked){ silent.setChecked(false); } } }); silent.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if(isChecked){ general.setChecked(false); } } }); if general switch is inactive and silent switch is active, when you press general, this change your state to active and you change silent switch to inactive. A: When you say disabled first thing I imagine is switch can not to be touchable. Like in the picture. If you want to do something like this you should add in setOnClickListener block something like ; silent.setEnabled(false) But I think you meant that; When the silent switch is ON general switch is OFF and when the general switch is ON silent switch is OFF Than you can use setChecked method. Like this; general.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v){ myAudioManager.setRingerMode(AudioManager.RINGER_MODE_NORMAL); Toast.makeText(MainActivity.this,"General Mode Activated",Toast.LENGTH_LONG).show(); silent.setChecked(false); } }); silent.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { myAudioManager.setRingerMode(AudioManager.RINGER_MODE_SILENT); Toast.makeText(MainActivity.this,"Silent Mode Activated",Toast.LENGTH_LONG).show(); general.setChecked(false); } });
unknown
d8732
train
It seems that you have been relying on the description of NSData returning a string of the form <xxxx> in order to retrieve the value of your data. This is fragile, as you have found, since the description function is only meant for debugging and can change without warning. The correct approach is to access the byte array that is wrapped in the Data object. This has been made a little bit more tricky, since Swift 2 would let you copy UInt8 values into a single element UInt16 array. Swift 3 won't let you do this, so you need to do the math yourself. var wavelength: UInt16? if let data = characteristic.value { var bytes = Array(repeating: 0 as UInt8, count:someData.count/MemoryLayout<UInt8>.size) data.copyBytes(to: &bytes, count:data.count) let data16 = bytes.map { UInt16($0) } wavelength = 256 * data16[1] + data16[0] } print(wavelength) A: Now, you can use String(bytes: characteristic.value!, encoding: String.Encoding.utf8), to get the string value of the characteristic.
unknown
d8733
train
I think the issue is caused because the save() function isn't bound to the correct object, so instead you can use Angular component interaction features. You can use @Output decorator and emit an event that will be handled by parent component. First, update your TopbarComponent to add that event: topbar.component.ts export class TopbarComponent implements OnInit { @Input() config: any[] | undefined; @Output() save: EventEmitter<any> = new EventEmitter(); constructor(private location: Location) {} ngOnInit(): void {} onSave() { this.save.emit(); //fnct(); } } topbar.component.html there was a typo on in button start tag > <ul class="sidebar-items"> <ng-container *ngFor="let btn of config"> <li> <button (click)="onSave()"> <span class="label" >{{btn.label}}</span> </button> </li> </ng-container> </ul> Next, update the TranslationEditorComponent component to bind to that event: translation-editor.component.html <topbar [config]="currentTopBarConfig" (save)="save()"></topbar> You can do the same for other types of events like delete or update. Refer to Angular docs for more details about components interaction and sharing data https://angular.io/guide/inputs-outputs A: Your this context has been changed when you call fnct();. In order to pass the this context to the function you can use javascript bind method. So you just need to change the config property: summaryTopbarConfig = [ { "label": "Save Text", "function": this.save.bind(this), //bind current context } ]; Read more about bind: https://www.w3schools.com/js/js_function_bind.asp
unknown
d8734
train
If the shell is started as it is stated in the docs: vertx run -conf '{"telnetOptions":{"port":5000}}' maven:io.vertx:vertx-shell:3.2.1 it wont be able to commuicate with other verticles, as it is not in any cluster. The solution is to add --cluster and --cluster-host flags: vertx run -conf '{"telnetOptions":{"port":5000}}' maven:io.vertx:vertx-shell:3.2.1 --cluster --cluster-host localhost
unknown
d8735
train
I have found some information about how to do that, although you need to have root permissions to inject events in the system or another app running on it. Here you can find further information : http://www.pocketmagic.net/2012/04/injecting-events-programatically-on-android/#.UReb1KWIes0 http://www.pocketmagic.net/2013/01/programmatically-injecting-events-on-android-part-2/#.UReb3aWIes2
unknown
d8736
train
Object names in an Access database are limited to 64 characters (ref: here). When creating an ODBC linked table in the Access UI the default behaviour is to concatenate the schema name and table name with an underscore and use that as the linked table name so, for example, the remote table table1 in the schema public would produce a linked table in Access named public_table1. If such a name exceeds 64 characters then Access will throw an error. However, we can use VBA to create the table link with a shorter name, like so: Option Compare Database Option Explicit Sub so38999346() DoCmd.TransferDatabase acLink, "ODBC Database", "ODBC;DSN=PostgreSQL35W", acTable, _ "public.hodor_hodor_hodor_hodor_hodor_hodor_hodor_hodor_hodor_hodor", _ "hodor_linked_table" End Sub (Tested with Access 2010.)
unknown
d8737
train
At the .cproject file you can find the tool id (use the superClass field, without the number) and for each tool you can find a list of options ids. At the invocation line you need to specify the tool id, the option id and the value for the option, like in the following example (adding my_lib_location to the libraries search path): -Tp cdt.managedbuild.tool.gnu.c.linker.exe.release gnu.c.link.option.paths=my_lib_location
unknown
d8738
train
It is usually not a good idea to mix RewriteRule and Redirect 301 directives. They can conflict with each other in unexpected ways. You depend of RewriteRule so you should implement your redirects with more of them. Redirect 301 can't redirect based on query strings (?...) in the URL, so you need to implement RewriteRules for that redirect anyway. When you have rules for redirecting specific URLs, they should go at the top of the .htaccess file so that they take precedence over the other more general rules. I would recommend disabling the directory index because I fear it would conflict with your RewriteRule ^index\.php$ / [R=301,L] rule. I don't see RewriteEngine On in your .htaccess file, despite that your snippet you posted to start with has it. Try this as your .htaccess: # Disable index.html, index.php default functionality DirectoryIndex disabled RewriteEngine On # Permanent URL redirect RewriteCond %{QUERY_STRING} ^slug=konsolidasi-tanah-frequently-asked-questions$ RewriteRule ^blog\.php$ https://jpi.or.id/blog/2021/02/11/pengertian-konsolidasi-tanah [R=301,L] RewriteRule ^blog/2021/02/11/konsolidasi-tanah-frequently-asked-questions$ https://jpi.or.id/blog/2021/02/11/pengertian-konsolidasi-tanah [R=301,L] # Forward URLs without .php extension to existing PHP file RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule ^(.*)$ $1.php # Redirect index.php URLs to the directory RewriteRule ^index\.php$ / [R=301,L] RewriteRule ^(.*)/index\.php$ /$1/ [R=301,L] # Use index.php as a front controller RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php/$1 [L]
unknown
d8739
train
Without actually knowing what the code is doing it looks like the WPF rendering thread is not catching up, I would suggest you try a few things: * *Try this on different machines / graphics cards and see if the same behavior is happening *Can you check is your CPU is doing extensive work? *Check if your memory is constantly increasing? *Profile the application (garbage collections, generations sizes, etc) However, best is to start looking at the code this might just be a bug that messes up the UI. See some troubleshooting tips here Graphics card troublehooting Windows Presentation Foundation (WPF) differs from prior application platforms on Windows in that it uses its own DirectX-based hardware-accelerated rendering pipeline, when available, to draw the contents of any WPF windows.Prior application platforms were typically much less dependent on display driver quality because the bulk of their rendering was done in software rather than hardware. As a result, the visual quality of WPF applications is heavily dependent on the quality of the system’s display device and its display drivers. Faulty display devices may cause drawing artifacts within WPF applications or elsewhere on the desktop when an application uses the WPF hardware-rendering pipeline.
unknown
d8740
train
You could try these: * *Go to VSCode settings and go to extensions, and then find Python. Then find Default Interpreter Path. If the path it says is python, change it to your installation path. *Check your PATH and see if Python is in it. *Reinstalling VSCode or Python. A: It's an issue with the Python Extension update. Use conda run for conda environments for running python files and installing modules. (#18479) changelog(28 February 2022). But it has some problems, I had submitted an issue on GitHub. The debugger can take the correct python interpreter which you have selected in the VSCoe, while the command conda run xxx can not. It will persist in the base instead of the NeoNatal environment. It can not select the sub environment under Anaconda3 envs. Execute sys.executable you will find it. If execute the python script directly in the terminal likes python pythonFileName.py instead of conda run xxx it will be working again. Update: Workaround: * *Set "python.terminal.activateEnvironment" to false in the settings.json. *Downgrade to the previous version of the extension which works fine(avoid conda run). *Try out the following VSIX which has the potential fix: https://github.com/microsoft/vscode-python/suites/5578467772/artifacts/180581906, Use Extension: Install from VSIX command to install the VSIX. Reason: Conda has some problems: conda run -n MY-ENV python FILE.py uses the base interpreter instead of environment interpreter. Running using conda run inside already activated environment should be the same as running it outside conda run does not remove base environment components from $PATH
unknown
d8741
train
NSTimeInterval timeInterval = date.timeIntervalSinceReferenceDate; NSDate *anotherDate = [NSDate dateWithTimeIntervalSinceReferenceDate: timeInterval]; Try the code below. date and anotherDate will be identical. NSCalendar *calendar = [NSCalendar currentCalendar]; calendar.timeZone = [NSTimeZone timeZoneForSecondsFromGMT:0]; NSDateComponents *components = [[NSDateComponents alloc] init]; [components setDay:10]; [components setMonth:5]; [components setYear:1934]; NSDate *date = [calendar dateFromComponents:components]; NSLog(@"%@", date); NSTimeInterval timeInterval = [date timeIntervalSinceReferenceDate]; NSDate *anotherDate = [NSDate dateWithTimeIntervalSinceReferenceDate:timeInterval]; NSLog(@"%@", anotherDate); UPDATE: It's incorrect because you get timestamp (time interval) from that website which use UNIX timestamp. Also, it's incorrect because you use timeIntervalSinceNow which will likely change every time you call the method because it's relative to the current time. If you want the date/time interval that compatible with that website. Use: NSTimeInterval timeInterval = date.timeIntervalSince1970; NSDate *anotherDate = [NSDate dateWithTimeIntervalSince1970:timeInterval]; You can copy the timeInterval from the code above (-1188000000) and paste it on the website and it will give you a correct date. Internally, NSDate store time interval relative to reference date (Jan 1st, 2001). The website you mentioned is UNIX timestamp that relative to Jan 1st, 1970. A: This is just worked! NSString *strdate = @"10-05-1932"; NSDateFormatter *df = [[NSDateFormatter alloc] init]; [df setDateFormat:@"MM-dd-yyyy"]; NSDate *date = [df dateFromString:strdate]; NSLog(@"%@",date); NSTimeInterval interval = [date timeIntervalSince1970]; NSLog(@"%f", interval); NSDate *date2 = [NSDate dateWithTimeIntervalSince1970:interval]; NSLog(@"%@",date2); Thanks to @sikhapol
unknown
d8742
train
in Android Studio you can click on Analyze in the toolbar at the top > Inspect code > Whole Project after AS is finished you will have a list of lint errors you can go through
unknown
d8743
train
The only problem that I found was " = 'wb'"; so put a comma instead: import requests import os ebert_review_urls = [ 'https://d17h27t6h515a5.cloudfront.net/topher/2017/September/59ad9900_1-the-wizard-of-oz-1939-film/1-the-wizard-of-oz-1939-film.txt', 'https://d17h27t6h515a5.cloudfront.net/topher/2017/September/59ad9901_2-citizen-kane/2-citizen-kane.txt'] folder_name = 'ebert_reviews' if not os.path.exists(folder_name): os.makedirs(folder_name) for url in ebert_review_urls: response = requests.get(url) with open(os.path.join(folder_name, url.split('/')[-1]), 'wb') as file: file.write(response.content) print(os.listdir(folder_name))
unknown
d8744
train
Use h:outputText to display the data and not the implicit JSF output. Check this related question and see if it solves your problem.
unknown
d8745
train
Your have two problems in your original code: * *"closePanel()" is a string. *closePanel() attempts to (or would if it wasn't a string) call the function and assign it's output to xButton.onclick It should be this instead: xButton.onClick = closePanel; This will assign a reference to the function closePanel() to xButton.onClick, calling closePanel() when the xButton.onClick event is triggered. Remember you can use this inside the declaration of closePanel() to reference the clicked element.
unknown
d8746
train
The solution is simple: remove the / from <xsl:template match="/*"> to get <xsl:template match="*"> Otherwise you'd only sort the elements at the root node level. A: You were close, but your second template only matched the root element. Change it like this: <xsl:template match="rows|row"> <xsl:copy> <xsl:apply-templates select="@*"/> <xsl:apply-templates select="*"> <xsl:sort select="@sortOrder" data-type="text" order="ascending"/> <xsl:sort select="@fileName" data-type="text" order="ascending"/> </xsl:apply-templates> </xsl:copy> </xsl:template>
unknown
d8747
train
When you're using SPF with DMARC, you should only go as far as ~all anyway; you can configure DMARC to report everything that does not obtain a pass status, including softfails. The way to phase it in is to configure your services to sign everything with DKIM, set your DMARC to pct=100, saying that receivers should expect everything to be signed, configure your ruf and rua parameters so that you get to hear about any delivery problems, and then set p=none. This will allow you to see any problems. Leave it like tat for a while and see if anything is reported, then when you're ready set p=quarantine, and ultimately p=reject. You do need to be absolutely sure of all your mail sources before you can get to that point though.
unknown
d8748
train
Your confusion is that temp is different to head. It's not. They are both variables holding references to the same Node object. Changes made via either variable are reflected in the (same) object they reference. When you add a Node to temp, you add it to the real list.
unknown
d8749
train
Ace uses jshint, which have an option to set a list of global variables. Ace supports changeOptions call on worker to modify default options it passes to jshint, but doesn't have a way to pass list of gloabals You can add it by changing line at https://github.com/ajaxorg/ace/blob/v1.1.8/lib/ace/mode/javascript_worker.js#L130 to lint(value, this.options, this.options.globals); and from your code calling editor.session.$worker.call("changeOptions", [{ globals: {foo: false, bar: false...}, undef: true, // enable warnings on undefined variables // other jshint options go here check jshint site for more info }]); the change to worker.js#L130 is simple enough and should be accepted if you make a pull request to ace
unknown
d8750
train
The error message tells you that you gave an array, not a string. Basically its saying $paylod = array('something'=>'somethingelse'); So it is expecting you provide it with $payload['something'] so that it knows what string to decode. have you installed/enabled php5 JSON support? When I set up laravel on a fresh ubuntu 13.10 server I had to run: sudo apt-get install php5-json among other needed modules (like mcrypt) for laravel 4 to work.
unknown
d8751
train
you can get the index of each element as well as the element itself using enumerate command: for (i,row) in enumerate(cells): for (j,value) in enumerate(row): print i,j,value i,j contain the row and column index of the element and value is the element itself. A: How about this: import itertools for cell in itertools.chain(*self.cells): cell.drawCell(surface, posx, posy) A: It's clear you're using numpy. With numpy you can just do: for cell in self.cells.flat: do_somethin(cell) A: No one has an answer that will work form arbitrarily many dimensions without numpy, so I'll put here a recursive solution that I've used def iterThrough(lists): if not hasattr(lists[0], '__iter__'): for val in lists: yield val else: for l in lists: for val in iterThrough(l): yield val for val in iterThrough( [[[111,112,113],[121,122,123],[131,132,133]], [[211,212,213],[221,222,223],[231,232,233]], [[311,312,313],[321,322,323],[331,332,333]]]): print(val) # 111 # 112 # 113 # 121 # .. This doesn't have very good error checking but it works for me A: If you need to change the values of the individual cells then ndenumerate (in numpy) is your friend. Even if you don't it probably still is! for index,value in ndenumerate( self.cells ): do_something( value ) self.cells[index] = new_value A: It may be also worth to mention itertools.product(). cells = [[x*y for y in range(5)] for x in range(10)] for x,y in itertools.product(range(10), range(5)): print("(%d, %d) %d" % (x,y,cells[x][y])) It can create cartesian product of an arbitrary number of iterables: cells = [[[x*y*z for z in range(3)] for y in range(5)] for x in range(10)] for x,y,z in itertools.product(range(10), range(5), range(3)): print("(%d, %d, %d) %d" % (x,y,z,cells[x][y][z])) A: Just iterate over one dimension, then the other. for row in self.cells: for cell in row: do_something(cell) Of course, with only two dimensions, you can compress this down to a single loop using a list comprehension or generator expression, but that's not very scalable or readable: for cell in (cell for row in self.cells for cell in row): do_something(cell) If you need to scale this to multiple dimensions and really want a flat list, you can write a flatten function.
unknown
d8752
train
First, note that increase-key must be (log) if we wish for insert and find-min to stay (1) as they are in a Fibonacci heap. If it weren't you'd be able to sort in () time by doing inserts, followed by repeatedly using find-min to get the minimum and then increase-key on the head by with ∀:> to push the head to the end. Now, knowing that increase-key must be (log), we can provide a straightforward asymptotically optimal implementation for it. To increase a node to value , first you decrease-key(,−∞), then delete-min() followed by insert(,). Refer here
unknown
d8753
train
You can pass your value as a GET parameter in the controller URL: $(document).ready(function () { var url = document.URL; var index = url.indexOf("?email="); var email; /* If there is an EMAIL in URL, check directory to confirm it's valid */ if (index > -1) { /* There is an email */ email = url.substr((index + 7)); email = email.substr(0, (email.length - 4)) + "@@mymail.ca"; /* Check directory to see if this email exists */ window.location.href = '/CheckDirectory/Home?email=' + email; } }); A: To answer your question of Is there a way to fill in the ??? with the email above? No. The Razor code is similar to, say, PHP, or any other server-side templating language - it's evaluated on the server before the response is sent. So, if you had something like @Url.Action("checkdirectory", "home") in your script, assuming it's directly in a view, it would get replaced by a generated URL, like /home/checkdirectory Your code, which uses @Html.Action("checkdirectory", "home") actually executes a separate action, and injects the response as a string into the view where it's called. Probably not what you were intending. So, let's try to get you on the right path. Assuming your controller action looks something like [HttpGet] public ActionResult CheckDirectory(string email = "") { bool exists = false; if(!string.IsNullOrWhiteSpace(email)) { exists = YourCodeToVerifyEmail(email); } return Json(new { exists = exists }, JsonRequestBehavior.AllowGet); } You could, using jQuery (because XMLHttpRequests are not fun to normalize), do something like $(function(){ var url = '@Url.Action("checkdirectory", "home")'; var data = { email : $('#email').val() }; $.get(url, data) .done(function(response, status, jqxhr) { if(response.exists === true) { /* your "email exists" action */ } else { /* your "email doesn't exist" action */ } }) .fail(function(jqxhr, status, errorThrown) { /* do something when request errors */ }); }); This assumes you have an <input /> element with an id of email. Adjust accordingly. Also, the Url helper can only be used within a view; if you're doing this in a separate JavaScript file, replace it with a hard-coded string (or whatever else works for you). Edit: Since it seems I didn't entirely get what you were trying to do, here's an example of returning a different view based on the "type" of user: public ActionResult ScheduleMe(string email = "") { if(!string.IsNullOrWhiteSpace(email)) { ActionResult response = null; var userType = YourCodeToVerifyEmail(email); // Assuming userType would be strings like below switch(userType) { case "STAFF": response = View("StaffScheduler"); break; case "STUDENT": response = View("StudentScheduler"); break; default: response = View("ReadOnlyScheduler"); break; } return response; } return View("NoEmail"); } This assumes you would have 4 possible views: the three you mentioned, plus an "error" view when no email parameter was given (you could also handle that by redirecting to another action). This variation also assumes a user has somehow navigated to something like hxxp://yourdomain.tld/home/[email protected]
unknown
d8754
train
This code should work: private void Add_Click(object sender, RoutedEventArgs e) { if (gridcontrol.Children .OfType<TextBox>() .Any(tb => string.IsNullOrEmpty(tb.Text))) { MessageBox.Show("Please enter values in all the fields"); } else { ... } }
unknown
d8755
train
You need to provide the full path. If you want the first icon in your .exe then you don't need a icon index: RequestExecutionLevel Admin Section WriteRegStr HKCR ".foo" "" "foofile" ; .foo file extension WriteRegStr HKCR "foofile\DefaultIcon" "" "$INSTDIR\MyApp.exe" SectionEnd Other icons need a icon index: WriteRegStr HKCR "MyProgId\DefaultIcon" "" "$INSTDIR\MyApp.exe,1"
unknown
d8756
train
It depends on how the web pages linked by RSS feed are opened. If they are opened within your app using a WebBrowser control, then you must track history of read feeds yourself within your app. See WPF WebBrowser Recent Pages. You can use the Navigated event of the WebBrowser control. If they are opened using a particular web browser, then you can eventually read somehow the history of that particular browser. But when the history gets deleted, your read/unread status gets deleted as well.
unknown
d8757
train
I found your question whilst looking for essentially the same thing for my own project. I did find https://groups.google.com/forum/#!topic/google-maps-js-api-v3/7oWus3T5Ycw which I'm sure could be adapted, but if you look at the source of the example it says the code "is available for a fee". My approach was going to be to place a temporary marker on the map at a certain position in the window, but then it would have to be recalculated and moved each time the map was moved or zoomed. A: An alternative approach is to use the Drawing Library, as suggested on my post by Suvi Vignarajah Positioning a draggable map marker at top-left of map window (there's a jsFiddle in the comments that shows my final solution) I'm still thinking your idea of a custom control is actually the best in terms of intuitive UX
unknown
d8758
train
You need to wrap the ScrollView with a View that has height. ScrollViews must have a bounded height in order to work. You can read more details about that here: https://facebook.github.io/react-native/docs/scrollview Do it something like below: render() { return ( <View style={styles.container}> <View style={{height: 80}} > <ScrollView ... EDIT Your code actually works. Maybe you just want to see if your scrollview works when the whole screen is occupied. Try this below and you will see, I simply multiplied the text contents 80 times: render() { return ( <ScrollView style={styles.container}> <View style={{ flex: 1, backgroundColor: "#fff", flexGrow: 1 }}> {Array(80) .fill(1) .map((item, index) => ( <Text>Hallo {index}</Text> ))} </View> </ScrollView> ); } A: Remove flex:1 Give height:"100%" width: "100%"
unknown
d8759
train
You're setting the title of the whole view, which in turn automatically sets the title of the tabBar and the nav controller. To set the title of them each individually, You first set the nav bar by accessing the nav item: [[self navigationItem] setTitle:(NSString *)]; Then you set the tabBar title by accessing the tab bar item and setting its title like so: [self.tabBarItem setTitle:(NSString *)]; Good Luck! A: use self.navigationItem.title for the navigation bar. A: This is a common mistake and happened to me so many times. To get around this, every ViewController comes with a navigationItem property giving you even further options. Use following line inside your ViewControllers to set the title: self.navigationItem.title = @"Your Desired Title";
unknown
d8760
train
you can use woocommerce_before_add_to_cart_quantity hook as following add_action( 'woocommerce_after_add_to_cart_quantity', 'by_now' ); function by_now() { echo '<div class="test"> buy now </div>'; } in your css add : .test { display: inline-block; } .woocommerce div.product form.cart .button { vertical-align: middle; float: none !important ; } Output output in your site you need to place the code inside your functions.php A: You can add "Buy Now" before by using hook woocommerce_before_add_to_cart_button. add_action( 'woocommerce_before_add_to_cart_button', 'custom_content_before_addtocart_button', 100 ); function custom_content_before_addtocart_button() { // custom content. echo 'Buy Now'; } You can add "Buy Now" after by using hook woocommerce_after_add_to_cart_button. add_action( 'woocommerce_after_add_to_cart_button', 'custom_content_after_addtocart_button', 100 ); function custom_content_after_addtocart_button() { // custom content. echo 'Buy Now'; }
unknown
d8761
train
This issue must be fixed by the package's developer or you can send try and fork their project if you want. There are only a few packages supporting the Lumen framework for now. Note: I've just opened an issue asking for Lumen compatibility linking to the following conversation. - A simple solution would be to not use helpers that are only defined by illuminate/foundation. Then this would allow usage in any app that uses laravel components. I'd always recommend that. :) - @GrahamCampbell What's a better way to get the config path? - Resolve 'path.config' from the ioc container.
unknown
d8762
train
I made a an app with rich push notifications a long time ago, and this is the tutorial I used for that https://medium.com/@lucasgoesvalle/custom-push-notification-with-image-and-interactions-on-ios-swift-4-ffdbde1f457 I hope it is as helpful to you as it was for me.
unknown
d8763
train
This is what always do in these handlers: * *Create the dialog and have a member variable at the class/activity level *Create a private method in the class/activity to dismiss the dialog *Call this private method in your handler What you are creating is not a Dialog, it is DialogBuilder. You need to create it as below: AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setCancelable(true); builder.setIcon(android.R.drawable.ic_dialog_alert); builder.setTitle("..."); builder.setMessage("message"); builder.setNegativeButton("OK", null); AlertDialog dlg = builder.create();
unknown
d8764
train
Shouldn't be particularly complicated, just .includes all the bits you want to eager load .. @community.codes.recent.includes(user: :profile) Also, are a Community's codes always equal to that of all of it's Users? If so, you should be using a has_many :codes, through: :users association on Community.
unknown
d8765
train
No you can't... Any change in any of your app permission (from the settings) Your app is killed and next time when you launch your application either from app switcher or from the app icon it starts a new process. This is how it works in IOS. Also See this answer.
unknown
d8766
train
I suggest you use a sandboxed IFrame e.g. http://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/ <iframe sandbox="allow-same-origin allow-scripts allow-popups allow-forms" src="https://blah.com/index.html" style="border: 0; width:130px; height:20px;"> </iframe> You can tweak how much power the content in the Iframe has (i.e. can it run scripts). I guess you could also look at using a partial view. My guess is you'd need to use a WebClient instance to download the HTML source of the target webpage, and then pass that HTML into a partial view. But I don't see how any script tags would render correctly for you, which means the page would not be interactive.
unknown
d8767
train
Both results are correct. select count(col_name) counts the records where col_name is not null while select count(*) counts all records, regardless of any null values. This is documented on Tahiti: If you specify expr, then COUNT returns the number of rows where expr is not null. You can count either all rows, or only distinct values of expr. If you specify the asterisk (*), then this function returns all rows, including duplicates and nulls. COUNT never returns null.
unknown
d8768
train
Did you try this: Perl::Critic::Policy::Variables::ProhibitReusedNames;
unknown
d8769
train
You should define your function as static inline in the .h file: static inline float clampf( float v, float min, float max ) { if( v < min ) v = min; if( v > max ) v = max; return v; } The function must be absent in the .c file. The compiler may decide not to inline the function but make it a proper function call. So every generated .o file may contain a copy of the function. A: You have it almost correct. You actually have it backwards; for inline functions you must put the inline definition in the header file and the extern declaration in the C file. // mymath.h inline float clampf( float v, float min, float max ) { if( v < min ) v = min; if( v > max ) v = max; return v; } // mymath.c #include "mymath.h" extern float clampf( float v, float min, float max ); You have to put the definition (full body) in the header file, this will allow any file which includes the header file to be able to use the inline definition if the compiler chooses to do so. You have to put the extern declaration (prototype) in the source file to tell the compiler to emit an extern version of the function in the library. This provides one place in your library for the non-inline version, so the compiler can choose between inlining the function or using the common version. Note that this may not work well with the MSVC compiler, which has very poor support in general for C (and has almost zero support for C99). For GCC, you will have to enable C99 support for old versions. Modern C compilers support this syntax by default. Alternative: You can change the header to have a static inline version, // mymath.h static inline float clampf(float v, float min, float max) { ... } However, this doesn't provide a non-inline version of the function, so the compiler may be forced to create a copy of this function for each translation unit. Notes: * *The C99 inlining rules are not exactly intuitive. The article "Inline functions in C" (mirror) describes them in detail. In particular, skip to the bottom and look at "Strategies for using inline functions". I prefer method #3, since GCC has been defaulting to the C99 method for a while now. *Technically, you never need to put extern on a function declaration (or definition), since extern is the default. I put it there for emphasis.
unknown
d8770
train
Use the BIOS.WriteCharacterAndAttribute function 09h. Put either blue or red foregroundcolor in BL depending on the character at hand (read from the matrix). mov si, offset oneMatrix mov cx, 1 ; ReplicationCount mov bh, 0 ; DisplayPage More: ... position the cursor where next character has to go lodsb mov bl, 01h ; BlueOnBlack cmp al '0' je Go mov bl, 04h ; RedOnBlack Go: mov ah, 09h ; BIOS.WriteCharacterWithAttribute int 10h ... iterate as needed Take a look at this recent answer. There's some similarity... If you need the output to create a glyph on a graphics screen, then next code will help: mov si, offset oneMatrix mov bh, 0 ; DisplayPage mov bp, 8 ; Height mov dx, ... ; UpperleftY OuterLoop: mov di, 11 ; Width mov cx, ... ; UpperleftX InnerLoop: lodsb cmp al '0' mov al, 1 ; Blue je Go mov al, 4 ; Red Go: mov ah, 0Ch ; BIOS.WritePixel int 10h inc cx ; Next X dec di jnz InnerLoop inc dx ; Next Y dec bp jnz OuterLoop
unknown
d8771
train
Hello I think the problem is @ on the first foreach loop. Please remove it and try. And one more thing if you want to use html in the Razor code then you can use @Html.Raw(). (Example @Html.Raw("<tr>"))
unknown
d8772
train
Yes, you can always use functions out of another javascript file. though if you executed the code immediately you need to specify the right order: First the function definition, then the function call so: <head> <script src="javascript.js" type="text/javascript"></script> <script src="main.js" type="text/javascript"></script> </head>
unknown
d8773
train
You may create n- dimensional grids using ndgrid, but please keep in mind that it does not directly create the same output as meshgrid, you have to convert it first. (How to do that is also explained in the documentation)
unknown
d8774
train
for event in pygame.event.get(): if event.type == pygame.QUIT: run = False pygame.quit() pygame.display.update() When the event loop happens, if you close the window, you call pygame.quit(), which quits pygame. Then it tries to do: pygame.display.update() But pygame has quit, which is why you are getting the message. separate the logic out. Events in one function or method, updating in another, and drawing and updating the display in another to avoid this.
unknown
d8775
train
Use clip-path .num { background:pink; display:inline-flex; font-size:20px; width:80px; height:80px; align-items:center; justify-content:center; clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%); } <div class="num">1</div> A: Or if you don't want to play with clips than you can use the following: <div class="num"><span>1</span></div> CSS .num { width: 0; height: 0; border: 15px solid transparent; border-bottom-color: pink; position: relative; top: -15px; text-align: center; color: white; font-weight: bold; vertical-align: center; } .num span { width: 20px !important; height: 40px !important; position: absolute; margin-left: -10px; vertical-align: center; margin-top: 5px; z-index: 1 } .num:after { text-align: center; content: ''; position: absolute; left: -15px; top: 15px; width: 0; height: 0; border: 15px solid transparent; border-top-color: pink; } But be aware: this only works if you have fix sizes. If you use percentage, than you have to always calculate the margins/paddings.
unknown
d8776
train
Some sample apps that do many of the things you speak of are shown here. The Graph API is probably your best bet right now for delivering the content and access you need and there are numerous tutorials online for how to use it, including the Facebook Developers site itself. A: You will find good Tuts on ThinkDiff, e.g. http://thinkdiff.net/facebook/new-javascript-sdk-oauth-2-0-based-fbconnect-tutorial/ http://thinkdiff.net/facebook/php-sdk-3-0-graph-api-base-facebook-connect-tutorial/ http://thinkdiff.net/facebook/graph-api-iframe-base-facebook-application-development-php-sdk-3-0/ A: I know this is an older question, but the current method for authentication is OAuth 2.0. Facebook provides a pretty good outline of what steps are necessary in this Reference: https://developers.facebook.com/docs/authentication/client-side/ This example allows the authentication to occur entirely in Javascript on the client side so that you can request a potential user to authenticate via Facebook and then confirm access to your application. If the user is already logged in, only the access confirmation for your application is performed. If the user is already logged in and access has already been granted, the user is not required to login, or reconfirm access.
unknown
d8777
train
Something like this: select * from data2 union select * from data3 order by event_timestamp, level_id; Using UNION and order by event_timestamp, level_id; https://dbfiddle.uk/?rdbms=mysql_5.7&fiddle=03b02e0d079011aa4f9e3af7974a98f1
unknown
d8778
train
I don't know why you want to remove all styles for a browser version. I suppose that you have some CSS problems with IE7, and often a good way of fixing it, rather than deleting all your CSS, is to use ie7.js: http://code.google.com/p/ie7-js/. Here is a demo of what it can do. Also, this script has a version for IE8 and IE9. A: <!--[if lt IE 8]> <body class='oldIE'> <![endif]--> <!--[if gte IE 8]> <body class='ok'> <![endif]--> <!--[if !IE]> <body class='ok'> <![endif]--> here you would need to prefix all the styles you don't IE7 to apply with .ok another method would be <!--[if lt IE 8]> //include an old IE specific stylesheet or none at all <![endif]--> <!--[if gte IE 8]> //include your stylesheets <![endif]--> <!--[if !IE]> //include your stylesheets <![endif]--> A: The best solution is to remove a specific class name rather than wiping the entire CSS for an element: // Identity browser and browser version if($.browser.msie && parseInt($.browser.version) == 7) { // Remove class name $('.class').removeClass('class'); // Or unset each CSS selectively $('.class').css({ 'background-color': '', 'font-weight': '' }); }
unknown
d8779
train
assuming the variable s represents your html string, a RexExp replace as follows should work just fine. s = s.replace(/<!--[\s\S]+?-->/g,""); Variable s should now have comments removed.
unknown
d8780
train
It looks like Hibernate Search can't find org/hibernate/search/test/analyzer/solr/stoplist.properties in the classpath. Make sure it's there.
unknown
d8781
train
The answer I received from Microsoft: this isn't possible in this architecture. The key identifier is bound up in the ciphertext and interpreted by the EKM provider, not SQL Server. SQL Server doesn't even know which key is being used. It would be on the EKM provider to provide UAC.
unknown
d8782
train
Not Sure whether this can imply in the case of codenameone. But u can try :- MediaPlayer player = MediaPlayer.create(this, R.raw.music); player.setLooping(true); // Set looping player.setVolume(100,100); public int onStartCommand(Intent intent, int flags, int startId) { player.start(); return 1; } @Override public void onDestroy() { player.stop(); player.release(); } public void onStart(Intent intent, int startId) { // TODO } Or u can refer to the discussion here : Play Background Sound in android applications A: Check out the developer guide for code samples of this including a small sample of an audio recording/playback app: Form hi = new Form("Capture", BoxLayout.y()); hi.setToolbar(new Toolbar()); Style s = UIManager.getInstance().getComponentStyle("Title"); FontImage icon = FontImage.createMaterial(FontImage.MATERIAL_MIC, s); FileSystemStorage fs = FileSystemStorage.getInstance(); String recordingsDir = fs.getAppHomePath() + "recordings/"; fs.mkdir(recordingsDir); try { for(String file : fs.listFiles(recordingsDir)) { MultiButton mb = new MultiButton(file.substring(file.lastIndexOf("/") + 1)); mb.addActionListener((e) -> { try { Media m = MediaManager.createMedia(recordingsDir + file, false); m.play(); } catch(IOException err) { Log.e(err); } }); hi.add(mb); } hi.getToolbar().addCommandToRightBar("", icon, (ev) -> { try { String file = Capture.captureAudio(); if(file != null) { SimpleDateFormat sd = new SimpleDateFormat("yyyy-MMM-dd-kk-mm"); String fileName =sd.format(new Date()); String filePath = recordingsDir + fileName; Util.copy(fs.openInputStream(file), fs.openOutputStream(filePath)); MultiButton mb = new MultiButton(fileName); mb.addActionListener((e) -> { try { Media m = MediaManager.createMedia(filePath, false); m.play(); } catch(IOException err) { Log.e(err); } }); hi.add(mb); hi.revalidate(); } } catch(IOException err) { Log.e(err); } }); } catch(IOException err) { Log.e(err); } hi.show();
unknown
d8783
train
Maybe try exec("python pdf.py", $response, $error_code); and see if anything useful is returned in $response or $error_code?
unknown
d8784
train
You can make it available when you configure the docker container by mounting the Jenkins folder on the build agent. pipeline { agent { docker { .... // Make tools folder available in docker (some slaves use mnt while other uses storage) args '-v /mnt/Jenkins_MCU:/mnt/Jenkins_MCU -v /storage/Jenkins_MCU:/storage/Jenkins_MCU' ... } .... stage(...){ environment { myToolHome = tool 'MyTool' } steps { ... sh "${myToolHome}/path/to/binary arguments" .... I am not sure how to get the path of the location for jenkins on the build agent, so in this example it is hard coded. But it makes the tool available in the docker image.
unknown
d8785
train
ONce you partition the data using df.write.partitionBy("col1").mode("overwrite").csv("file_path/example.csv", header=True) There will be partitions based on your col1. Now while reading the dataframe you can specify which columns you want to use like: df=spark.read.csv('path').select('col2','col3') A: Below is the code for spark 2.4.0 using scala api- val df = sqlContext.createDataFrame(sc.parallelize(Seq(Row(1,3,5),Row(2,4,6))), StructType(Seq.range(1,4).map(f => StructField("col" + f, DataTypes.IntegerType)))) df.write.partitionBy("col1") .option("header", true) .mode(SaveMode.Overwrite) .csv("/<path>/test") It creates 2 files as below- * *col1=1 with actual partition file as below- col2,col3 3,5 *col2=2 with actual partition file as below- col2,col3 4,6 same for col2=2 I'm not seeing col1 in the file. in python- from pyspark.sql import Row df = spark.createDataFrame([Row(col1=[1, 2], col1=[3, 4], col3=[5, 6])]) df.write.partitionBy('col1').mode('overwrite').csv(os.path.join(tempfile.mkdtemp(), 'data')) api doc - https://spark.apache.org/docs/latest/api/python/pyspark.sql.html
unknown
d8786
train
Open command palette, run "Remote-SSH: Settings", then config "Remote.SSH: Remote Server Listen On Socket" to true. This did the trick for me.
unknown
d8787
train
So the solution was two things * *upgrade handlebars to v0.4.41 (I was on 0.4.0) *use {{ page.title }}
unknown
d8788
train
Simply check that the callback argument is a function. if(typeof callback === 'function'){ return callback(a+b); } Thus, your sum function can be written as : function sum(a, b, callback) { if(typeof callback === 'function'){ return callback(a+b) } else { return a+b; } } (Demo JSFiddle) A: Hi you can have your code as below function sum(a, b, callback) { if(typeof callback === 'function'){ return callback(a+b) } else { return a+b; } } which is also mentioned in the above post
unknown
d8789
train
According to Peter Ledbrook, this is a non-trivial conflict between Hibernate and Searchable: http://jira.grails.org/browse/GPSEARCHABLE-19 The solution is to turn off mirroring in the Searchable plugin and handle updating indexes manually.
unknown
d8790
train
How are you running your program? If you run it with "java -jar myprog.jar", use "java -Djava.net.preferIPv4Stack=tru -jar myprog.jar". If you run it by double clicking the jar file or something like that, you might need to set the property in your code, by adding System.setProperty("java.net.preferIPv4Stack", "true");
unknown
d8791
train
I achieved to get what I want, I've just changed the type of the chart, now I'm using "timeSeriesChart". <style name="table 1_TH" mode="Opaque" backcolor="#646464" forecolor="#FFFFFF" > <box> <pen lineColor="#969696" lineWidth="1.0"/> </box> </style> <queryString> <![CDATA[]]> </queryString> <field name="TimePoints" class="java.util.Date"/> <field name="LongAxis" class="java.lang.Double"/> <field name="Lesion" class="java.lang.String"/> <field name ="nbInstance" class="java.lang.Integer"/> <detail> <band height="400" > <printWhenExpression><![CDATA[$V{REPORT_COUNT}==$F{nbInstance}]]></printWhenExpression> <timeSeriesChart> <chart> <reportElement style="table 1_TH" x="10" y="0" width="800" height="400"/> <chartTitle> <titleExpression><![CDATA["Lesion's evolution"]]></titleExpression> </chartTitle> </chart> <timeSeriesDataset> <timeSeries> <seriesExpression><![CDATA[$F{Lesion}]]></seriesExpression> <timePeriodExpression> <![CDATA[$F{TimePoints}]]></timePeriodExpression> <valueExpression><![CDATA[$F{LongAxis}]]></valueExpression> </timeSeries> </timeSeriesDataset> <timeSeriesPlot > <plot backcolor="#323232" /> <timeAxisLabelExpression/> <timeAxisFormat> <axisFormat/> </timeAxisFormat> <valueAxisLabelExpression/> <valueAxisFormat> <axisFormat/> </valueAxisFormat> </timeSeriesPlot> </timeSeriesChart> </band> </detail>
unknown
d8792
train
I don't think this is a code issue as further testing by making lngLast_CS_Sheet equal the number of CS sheets in the workbook, the code runs without error. This error has only occurred in this workbook and not others with exactly the same code modules. Therefore I conclude this to be a user induced error somewhere within the workbook which I will tray & track down
unknown
d8793
train
To remove the edge effects you could stack three copies of the data, create the density estimate, and then show the density only for the middle copy of data. That will guarantee "wrap around" continuity of the density function from one edge to the other. Below is an example comparing your original plot with the new version. I've used the adjust parameter to set the same bandwidth between the two plots. Note also that in the circularized version, you'll need to renormalize the densities if you want them to add to 1: set.seed(105) bdays <- data.frame(gender = sample(c('M', 'F'), 100, replace = T), bday = sample(1:365, 100, replace = T)) # Stack three copies of the data, with adjusted values of bday bdays = bind_rows(bdays, bdays, bdays) bdays$bday = bdays$bday + rep(c(0,365,365*2),each=100) # Function to adjust bandwidth of density plot # Source: http://stackoverflow.com/a/24986121/496488 bw = function(b,x) b/bw.nrd0(x) # New "circularized" version of plot bdays %>% ggplot(aes(x = bday)) + geom_density(aes(color = factor(gender)), adjust=bw(10, bdays$bday[1:100])) + coord_cartesian(xlim=c(365, 365+365+1), expand=0) + scale_x_continuous(breaks=seq(366+89, 366+365, 90), labels=seq(366+89, 366+365, 90)-365) + scale_y_continuous(limits=c(0,0.0016)) ggtitle("Circularized") # Original plot ggplot(bdays[1:100,], aes(x = bday)) + geom_density(aes(color = factor(gender)), adjust=bw(30, bdays$bday[1:100])) + scale_x_continuous(breaks=seq(90,360,90), expand=c(0,0)) + ggtitle("Not Circularized")
unknown
d8794
train
@PpppppPppppp, I managed to get the result with some hacks. Do post if you found another way to do it. Here's the final result: Instead of setting left and right borders for cell, set black colour to cell's contentView and place a view inside with leading and trailing constraints to make it look like it has a border. Then provide a viewForHeaderInSection and a viewForFooterInSection with masked corners as required in your UI. Some hacks required in the footer to hide the top border. I didn't use any custom UITableViewCell or UITableViewHeaderFooterView since this is only for demo. FInd the whole code for table view below. extension ViewController: UITableViewDataSource, UITableViewDelegate { func numberOfSections(in tableView: UITableView) -> Int { return 4 } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return 6 } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) cell.textLabel?.text = "index: \(indexPath.row)" return cell } func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { return 50 } func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { let header = UIView(frame: .init(x: 0, y: 0, width: tableView.bounds.width, height: 70)) header.backgroundColor = .white let innderView = UIView(frame: .init(x: 0, y: 20, width: header.bounds.width, height: 50)) header.addSubview(innderView) innderView.backgroundColor = .lightGray innderView.layer.cornerRadius = 8 innderView.layer.borderColor = UIColor.black.cgColor innderView.layer.borderWidth = 2 innderView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner] return header } func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { return 70 } func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { let footer = UIView(frame: .init(x: 0, y: 0, width: tableView.bounds.width, height: 20)) let innerView = UIView(frame: .init(x: 2, y: 0, width: footer.bounds.width-4, height: footer.bounds.height-2)) footer.addSubview(innerView) innerView.backgroundColor = .white innerView.layer.cornerRadius = 8 innerView.layer.maskedCorners = [.layerMinXMaxYCorner, .layerMaxXMaxYCorner] footer.backgroundColor = .black footer.layer.cornerRadius = 8 footer.layer.maskedCorners = [.layerMinXMaxYCorner, .layerMaxXMaxYCorner] return footer } func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat { return 20 } } A: I do think @Jithin answer using adding a subview is the easiest and greatest answer, but if you really want to draw your own border line, we can use UIBezierPath to achieve this. (which I think is a little bit overkill for this). extension ViewController: UITableViewDataSource { func tableView(_ tableView: UITableView, willDisplayHeaderView view: UIView, forSection section: Int) { let cornerRadius: CGFloat = 10.0 let lineWidth: CGFloat = 2 // deduct the line width to keep the line stay side the view let point1 = CGPoint(x: 0.0 + lineWidth / 2, y: view.frame.height) let point2 = CGPoint(x: 0.0 + lineWidth / 2, y: 0.0 + cornerRadius + lineWidth / 2) let point3 = CGPoint(x: 0.0 + cornerRadius + lineWidth / 2, y: 0.0 + lineWidth / 2) let point4 = CGPoint(x: view.frame.width - cornerRadius - lineWidth / 2, y: 0.0 + lineWidth / 2) let point5 = CGPoint(x: view.frame.width - lineWidth / 2, y: 0.0 + cornerRadius + lineWidth / 2) let point6 = CGPoint(x: view.frame.width - lineWidth / 2, y: view.frame.height - lineWidth / 2) // draw the whole line with upper corner radius let path = UIBezierPath() path.move(to: point1) path.addLine(to: point2) path.addArc(withCenter: CGPoint(x: point3.x, y: point2.y), radius: cornerRadius, startAngle: .pi, endAngle: -.pi/2, clockwise: true) path.addLine(to: point4) path.addArc(withCenter: CGPoint(x: point4.x, y: point5.y), radius: cornerRadius, startAngle: -.pi/2, endAngle: 0, clockwise: true) path.addLine(to: point6) path.addLine(to: point1) let topBorder = CAShapeLayer() topBorder.path = path.cgPath topBorder.lineWidth = lineWidth topBorder.strokeColor = UIColor.purple.cgColor topBorder.fillColor = nil // add the line to header view view.layer.addSublayer(topBorder) } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "testingCell", for: indexPath) as! TableViewCell cell.cellLabel.text = "\(mockData[indexPath.section][indexPath.row])" cell.backgroundColor = .green if indexPath.row == mockData[indexPath.section].count - 1 { cell.setAsLastCell() // we can add a mask to cut those area outside our border line let maskPath = UIBezierPath(roundedRect: cell.bounds, byRoundingCorners: [.bottomLeft, .bottomRight], cornerRadii: CGSize(width: 10, height: 10)) let maskLayer = CAShapeLayer() maskLayer.path = maskPath.cgPath cell.layer.mask = maskLayer } else { cell.setAsNormalCell() cell.layer.mask = nil } return cell } } And here is the UITableViewwCell: class TableViewCell: UITableViewCell { @IBOutlet weak var cellLabel: UILabel! let leftBorder = CALayer() let rightBorder = CALayer() let bottomBorder = CAShapeLayer() let cornerRadius: CGFloat = 10 let lineWidth: CGFloat = 2 override func awakeFromNib() { super.awakeFromNib() } override func layoutSubviews() { super.layoutSubviews() leftBorder.frame = CGRect(x: 0, y: 0, width: lineWidth, height: self.frame.height) leftBorder.backgroundColor = UIColor.blue.cgColor self.layer.addSublayer(leftBorder) rightBorder.frame = CGRect(x: self.frame.width - lineWidth, y: 0.0, width: lineWidth, height: self.frame.height) rightBorder.backgroundColor = UIColor.blue.cgColor self.layer.addSublayer(rightBorder) // same idea as drawing line in the header view let point1 = CGPoint(x: 0.0 + lineWidth / 2, y: 0.0) let point2 = CGPoint(x: 0.0 + lineWidth / 2, y: self.frame.height - cornerRadius - lineWidth / 2) let point3 = CGPoint(x: cornerRadius + lineWidth / 2, y: self.frame.height - lineWidth / 2) let point4 = CGPoint(x: self.frame.width - cornerRadius - lineWidth / 2, y: self.frame.height - lineWidth / 2) let point5 = CGPoint(x: self.frame.width - lineWidth / 2, y: self.frame.height - cornerRadius - lineWidth / 2) let point6 = CGPoint(x: self.frame.width - lineWidth / 2, y: 0.0) let path = UIBezierPath() path.move(to: point1) path.addLine(to: point2)[![enter image description here][1]][1] path.addArc(withCenter: CGPoint(x: point3.x, y: point2.y), radius: cornerRadius, startAngle: .pi, endAngle: .pi/2, clockwise: false) path.addLine(to: point4) path.addArc(withCenter: CGPoint(x: point4.x,y: point5.y), radius: cornerRadius, startAngle: .pi/2, endAngle: 0, clockwise: false) path.addLine(to: point6) bottomBorder.path = path.cgPath bottomBorder.strokeColor = UIColor.red.cgColor bottomBorder.lineWidth = lineWidth bottomBorder.fillColor = nil self.layer.addSublayer(bottomBorder) } func setAsNormalCell() { leftBorder.isHidden = false rightBorder.isHidden = false bottomBorder.isHidden = true } func setAsLastCell() { leftBorder.isHidden = true rightBorder.isHidden = true bottomBorder.isHidden = false } } And of course, the above code is just for testing purposes and maybe a bit messy, but I hope it can explain a bit about drawing a line. The result: A: You can give corner radius to your tableview. tableView.layer.cornerRadius = 10 tableView.layer.borderColor = UIColor.black.cgColor tableView.layer.borderWidth = 1 A: I have a UICollectionView extension however it should work the same for UITableView @objc func addBorder(fromIndexPath:IndexPath, toIndexPath:IndexPath, borderColor:CGColor, borderWidth:CGFloat){ let fromAttributes = self.layoutAttributesForItem(at: fromIndexPath)! let toAttributes = self.layoutAttributesForItem(at: toIndexPath)! let borderFrame = CGRect(x: fromAttributes.frame.origin.x ,y: fromAttributes.frame.origin.y ,width: fromAttributes.frame.size.width ,height: toAttributes.frame.origin.y + toAttributes.frame.size.height - fromAttributes.frame.origin.y) let borderTag = ("\(fromIndexPath.row)\(fromIndexPath.section)\(toIndexPath.row)\(toIndexPath.section)" as NSString).integerValue if let borderView = self.viewWithTag(borderTag){ borderView.frame = borderFrame } else{ let borderView = UIView(frame: borderFrame) borderView.tag = borderTag borderView.backgroundColor = UIColor.clear borderView.isUserInteractionEnabled = false borderView.layer.borderWidth = borderWidth borderView.layer.borderColor = borderColor self.addSubview(borderView) } }
unknown
d8795
train
Actually, when you use the "su" hack what you are getting is a shell that runs as root (if the device has been modified to support that) If you don't want a root shell but an ordinary one running as your application's userid, you could presumably run /system/bin/sh or whatever it is on your device instead of su.
unknown
d8796
train
Because inline, DOM level-zero events like this, when specified in HTML, are evaluated. So you have to imagine that what's specified in the attribute is evaluated as JS, and: PhotoUpload.removeOldPhoto ...when specified as JavaScript, is a reference to a function, not an invocation of one. PhotoUpload.removeOldPhoto() ...is an invocation. Contrast this with the property equivalent to the onclick attribute, where the situation is reversed - you would specify a function reference, not invocation. someElement.onclick = myfunc; //not myfunc();
unknown
d8797
train
Let me explain please. The way to find an OrderItemIntent (XXXIntent) file * *Move to Intents(XXX).intentdefinition file. *Select a intent from any custom intents. *Move to Inspector panel from Xcode right side and go to third Identity Inspector section *You can find 'Custom class' blank and there are a right arrow button which connect to Class file. *Click that button Thanks A: It seems like Xcode has a bug in the generated Intent class for Objective-C. However you can go to your project settings, search for Intent Class Generation Language and chose Swift. That should fix the problem so far.
unknown
d8798
train
When you click on register. You can find all the <li> elements in #box2 ol and append it to #dialog. Do it after $( "#dialog" ).dialog( "open" ); as when the dialog box is close its css has display:none and because of that you probably cannot add any element on it(probably). you can do it something like below. (Tested) $( "#register" ).click(function() { $( "#dialog" ).dialog("open"); var newcontent = document.createElement('div'); newcontent.innerHTML = $("#box2 ol").html(); document.getElementById("dialog").appendChild(newcontent); }); Update: I updated the solution (working). (thanks for the fiddle). Here is the working fiddle : Working Fiddle
unknown
d8799
train
Used as self.arg but set as self.args. Use the same name in both places.
unknown
d8800
train
The second one didn't work because it was executed in the global context. Here is an article regarding the this context in the function passed to setTimeout, as per MDN (Check 'The "this" problem)' Your code, if written this way, would work: setTimeout(flake.remove.bind(flake),1000);
unknown